Skip to content

Commit 212a52e

Browse files
V48 Gate 3 (implementation-only): name raw LLM I/O sidecar files phase-agent-step-failsafe-generation
The prior key was the raw internal execution path (run id, seq-N/gen-N node ids) — unique but unreadable. Now it mirrors the same hierarchy the processing-indicator sentence reads out loud: phase, agent, step, failsafe, generation (thricified). A monotonic counter prefix from writeRawLLMIO still guarantees file uniqueness, so this name only needs to be legible.
1 parent 255635d commit 212a52e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

packages/agent-generics/src/diagnostics/instrumentation.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ function getCtx(execution: Execution, sequence?: string) {
1414
// Surface any provider/model already stored on ancestors (best-effort)
1515
let providerUp: string | undefined;
1616
let modelUp: string | undefined;
17+
let failsafeUp: string | undefined;
1718
try { providerUp = (execution as any).findUp?.('llm', 'provider'); } catch {}
1819
try { modelUp = (execution as any).findUp?.('llm', 'model'); } catch {}
19-
return { phase, step, agentName, execId, path, correlationId, sequence, provider: providerUp, model: modelUp };
20+
try { failsafeUp = (execution as any).findUp?.('ptrr', 'failsafe'); } catch {}
21+
return { phase, step, agentName, execId, path, correlationId, sequence, provider: providerUp, model: modelUp, failsafe: failsafeUp };
2022
}
2123

2224
let __diagBannerPrinted = false;
@@ -45,12 +47,13 @@ function maybeLogDiagnosticsBanner() {
4547
} catch {}
4648
}
4749

48-
// The literal wire-call correlation key for the raw LLM I/O sidecar — the
49-
// full execution path (which already encodes phase/agent/step/failsafe/
50-
// gen-N/generation) plus the sequence, so concurrent or repeated calls
51-
// within the same agent never collide.
50+
// A human-readable name for the raw LLM I/O sidecar file — phase, agent,
51+
// step, failsafe, generation (thricified) — mirroring the same hierarchy
52+
// the processing-indicator sentence reads out loud. writeRawLLMIO prefixes
53+
// every file with a monotonic counter, so this name only needs to be
54+
// legible, not unique.
5255
function rawLLMPathKey(ctx: ReturnType<typeof getCtx>): string {
53-
return [...(ctx.path || []), ctx.sequence].filter(Boolean).join(':');
56+
return [ctx.phase, ctx.agentName, ctx.step, ctx.failsafe, ctx.sequence].filter(Boolean).join('-');
5457
}
5558

5659
export async function logLLMSubstepStart(

0 commit comments

Comments
 (0)