@@ -174,16 +174,9 @@ function buildTerminalFitPrompt(): string {
174174}
175175
176176/**
177- * Gateway trace tags for a tutorial prompt run.
178- *
179- * The gateway attributes each `$ai_generation` it emits from the
180- * `X-POSTHOG-PROPERTY-*` headers on the request, so a run with no tags lands
181- * in the unattributed bucket — which is where every tutorial generation went
182- * before this existed. Exported so that contract is testable without booting
183- * the SDK.
184- *
185- * Returns `{}` when the caller supplies no program, keeping the tagless
186- * behavior explicit rather than silently emitting a half-populated bag.
177+ * Gateway trace tags for a tutorial prompt run — without them the gateway has
178+ * nothing to attribute its `$ai_generation` events to. Returns `{}` when no
179+ * program is supplied. Exported so the contract is testable without the SDK.
187180 */
188181export function buildTutorialRunTags ( args : {
189182 programId ?: string ;
@@ -192,9 +185,8 @@ export function buildTutorialRunTags(args: {
192185 if ( ! args . programId ) return { } ;
193186 return buildRunTags ( {
194187 programId : args . programId ,
195- // The tutorial runs against a project, not a codebase, so there's usually
196- // no detected framework — fall back to the program so the axis is never
197- // an empty string in the gateway's breakdowns.
188+ // The tutorial usually has no detected framework; fall back to the
189+ // program so the axis is never an empty string.
198190 integration : args . integration ?? args . programId ,
199191 runId : analytics . runId ,
200192 build : analytics . build ,
@@ -209,10 +201,8 @@ export async function* runMcpPromptViaSdk(args: {
209201 * context so the follow-up prompt can reference what the agent
210202 * already showed. */
211203 resumeSessionId ?: string ;
212- /** Program this run's gateway spend attributes to. Resolved by the caller
213- * (`store.analyticsProgramId`) so both tutorial entry points report as
214- * one program. Omitting it makes the spend unattributable — see the
215- * `ANTHROPIC_CUSTOM_HEADERS` note below. */
204+ /** Program this run's gateway spend attributes to; omitting it leaves the
205+ * spend unattributed. */
216206 programId ?: string ;
217207 /** Integration label for the trace tags; the tutorial usually has none. */
218208 integration ?: string ;
@@ -378,13 +368,9 @@ export async function* runMcpPromptViaSdk(args: {
378368 // default; without this the agent may try to call tools
379369 // before posthog-wizard is connected on turn 1.
380370 MCP_CONNECTION_NONBLOCKING : '0' ,
381- // Same Bedrock-fallback + telemetry-friendly headers as the main
382- // runner, plus this run's trace tags. The gateway reads
383- // `X-POSTHOG-PROPERTY-*` off the request to attribute each
384- // `$ai_generation` it emits, so sending none put every tutorial
385- // generation in the unattributed bucket — `posthog.capture` events
386- // carry a program id but nothing joins them to gateway spend.
387- // Flags stay empty: the tutorial doesn't fork on any.
371+ // Bedrock fallback plus this run's trace tags — the gateway reads
372+ // these to attribute its `$ai_generation` events. Flags stay empty:
373+ // the tutorial doesn't fork on any.
388374 ANTHROPIC_CUSTOM_HEADERS : buildAgentEnv ( wizardMetadata ?? { } , { } ) ,
389375 } ,
390376 } ,
0 commit comments