The Open Framework for Building Agents
fix(eve): preserve local subagent trace visibility (#3331)
Chad Hietala520f49817695
diff --git a/.changeset/fix-local-subagent-trace-visibility.md b/.changeset/fix-local-subagent-trace-visibility.mdnew file mode 100644index 000000000..c974ca54c--- /dev/null+++ b/.changeset/fix-local-subagent-trace-visibility.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Keep local subagent workflow visibility metadata aligned with the inherited trace decision so Agent Runs does not hide content that was exported for the child.diff --git a/packages/eve/src/execution/eve-workflow-attributes.test.ts b/packages/eve/src/execution/eve-workflow-attributes.test.tsindex 2a56d4d3f..123348649 100644--- a/packages/eve/src/execution/eve-workflow-attributes.test.ts+++ b/packages/eve/src/execution/eve-workflow-attributes.test.ts@@ -95,6 +95,52 @@ describe("isWorkflowTraceContentVisible", () => {});});+ it("uses the inherited decision for a verified local subagent", () => {+ const serializedContext = {+ [CHANNEL_CONTEXT_KEY_NAME]: { audience: "unknown", kind: "agent/local" },+ [SessionTraceSeedKey.name]: {+ decision: { action: "record", recordInputs: true, recordOutputs: true },+ spanId: "1".repeat(16),+ traceFlags: 1,+ traceId: "2".repeat(32),+ },+ "eve.parentSession": {+ callId: "call-1",+ rootSessionId: "root-session",+ sessionId: "parent-session",+ turn: { id: "turn-1", sequence: 0 },+ },+ };++ expect(isWorkflowTraceContentVisible(serializedContext)).toBe(true);+ expect(+ buildSubagentRootAttributes({+ identity: { nodeId: "subagents/general" },+ parentCallId: "call-1",+ parentSessionId: "parent-session",+ parentTurnId: "turn-1",+ rootSessionId: "root-session",+ serializedContext,+ }),+ ).toMatchObject({+ "$eve.is_trace_content_visible": true,+ });+ });++ it("does not trust an unbound serialized trace decision", () => {+ expect(+ isWorkflowTraceContentVisible({+ [CHANNEL_CONTEXT_KEY_NAME]: { audience: "unknown", kind: "http" },+ [SessionTraceSeedKey.name]: {+ decision: { action: "record", recordInputs: true, recordOutputs: true },+ spanId: "1".repeat(16),+ traceFlags: 1,+ traceId: "2".repeat(32),+ },+ }),+ ).toBe(false);+ });+it("does not infer forwarded acceptance from projected metadata", () => {const serializedContext = {[CHANNEL_CONTEXT_KEY_NAME]: { audience: "unknown", kind: "http" },diff --git a/packages/eve/src/execution/eve-workflow-attributes.ts b/packages/eve/src/execution/eve-workflow-attributes.tsindex cf845d3cd..0a2d17bc9 100644--- a/packages/eve/src/execution/eve-workflow-attributes.ts+++ b/packages/eve/src/execution/eve-workflow-attributes.ts@@ -103,7 +103,10 @@ export function isWorkflowTraceContentVisible(serializedContext: Record<string,const seed = serializedContext[SessionTraceSeedKey.name] as SessionTraceSeed | undefined;if (seed !== undefined) {const traceState = resolveForwardedTraceSeed(seed)!;- if (traceState.forwardedTracePolicy !== undefined) {+ if (+ traceState.forwardedTracePolicy !== undefined ||+ readParentSessionId(serializedContext) !== undefined+ ) {const decision = traceState.decision;return decision?.action === "record" && decision.recordInputs && decision.recordOutputs;}