Skip to content

fix: retain structured tool results in unified sessions - #76102

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/goose-session-normalization
Nov 9, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/goose-session-normalization

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve separately supplied tool.execution_complete.data.structuredContent in the full unified session, alongside the existing primary output view. This fixes the loss of typed Goose shell stdout, stderr, and exit_code observed in seven completions across the conformance run and the smoke run.

  • Add the optional JSON-compatible field to canonical and unified types and regenerate both schemas.
  • Retain nested JSON, Unicode/escaping, and explicit empty/falsy values without restoring provider envelopes or compact MCP RPC response bodies.
  • Apply existing registered-secret and structural-redaction rules to the new payload; correlation metadata remains protected.
  • Add sanitized projection/serialization regressions and direct native-shape assertions through Goose canonical and raw-log collection. Update the session specification and changeset.

Validation

  • Reproduced the bug before the fix: 11 targeted regression failures.
  • Focused projection, Goose, and generated-schema suites: 344 tests passed.
  • make fmt-cjs, make lint-cjs, and TypeScript typecheck passed (lint reports existing warnings, no errors).
  • make agent-report-progress passed: build, changed-file lint, schema freshness, TypeScript checking, and 266 impacted JavaScript tests. No Go changes; impacted Go tests were correctly skipped.
  • A pure local projection of the original captured agent artifacts preserves all seven previously dropped structured results, without altering their output arrays.

Evidence limits

No workflow dispatch, new inference, MCP startup, or credential changes. The captured artifacts are existing live Actions evidence; projecting them locally is not a new hosted verification. Neither sampled run contained reasoning, failed tools, or subagents, so those live mappings remain unverified. Existing published artifacts are not rewritten.

Preserve separately supplied structuredContent through typed canonical and unified session schemas and publication redaction. Cover sanitized Goose tool results, nested JSON and falsy values without restoring provider envelopes or RPC bodies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings November 9, 2026 03:14
@pelikhan
pelikhan merged commit 00f2780 into main Nov 9, 2026
46 of 47 checks passed
@pelikhan
pelikhan deleted the pelikhan/goose-session-normalization branch November 9, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The default serializer does not redact registered secrets in object keys, allowing retained structuredContent keys to leak secrets into usage/aw_session.jsonl.

1 open issue
What changed in this PR

This PR preserves separately supplied structuredContent alongside primary tool output in gh-aw’s unified sessions, retaining typed Goose shell results for downstream consumers.

Changes:

  • Add the optional field to canonical and unified types, schemas, and projection.
  • Extend payload-redaction handling and add retention, serialization, and Goose regressions.
  • Document the behavior and add a patch changeset.
File Description
docs/​src/​content/​docs/​specs/​unified-agent-session-specification.md Documents independent structured-result retention.
docs/​public/​schemas/​unified-session.schema.json Allows structured content in unified completions.
docs/​public/​schemas/​agent-session.schema.json Allows structured content in canonical completions.
actions/​setup/​js/​unified_session_payload.test.cjs Adds projection, serialization, and redaction regressions.
actions/​setup/​js/​unified_session_payload.cjs Retains the structured-content field during projection.
actions/​setup/​js/​types/​unified_session.d.ts Exposes the field in unified completion types.
actions/​setup/​js/​types/​agent_session.d.ts Defines the optional JSON-compatible field.
actions/​setup/​js/​session_artifact.cjs Classifies structured content as a redactable payload.
actions/​setup/​js/​parse_goose_log.test.cjs Checks retention against native Goose results.
.changeset/​patch-unified-tool-structured-content.md Records the patch-release change.

Review effort: Max (auto)

["assistant.refusal", ["content", "explanation"]],
["tool.execution_start", ["input", "parameters", "command"]],
["tool.execution_complete", ["output", "result", "error", "fileEdits"]],
["tool.execution_complete", ["output", "structuredContent", "result", "error", "fileEdits"]],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants