Repository navigation
fix: retain structured tool results in unified sessions - #76102
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟡 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"]], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Preserve separately supplied
tool.execution_complete.data.structuredContentin the full unified session, alongside the existing primaryoutputview. This fixes the loss of typed Goose shellstdout,stderr, andexit_codeobserved in seven completions across the conformance run and the smoke run.Validation
make fmt-cjs,make lint-cjs, and TypeScript typecheck passed (lint reports existing warnings, no errors).make agent-report-progresspassed: build, changed-file lint, schema freshness, TypeScript checking, and 266 impacted JavaScript tests. No Go changes; impacted Go tests were correctly skipped.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.