Repository navigation
Conversation
Recognize native sessionID context and project typed outputTruncated flags without exposing provider metadata. Preserve accounting reconciliation source order and add live-shaped regressions and schemas. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cross-session aggregate results are incorrectly attributed to the last result-producing session, corrupting per-session token and turn accounting.
1 open issue
What changed in this PR
This PR preserves OpenCode session identity and native output-truncation flags through gh-aw’s unified session pipeline, without exposing provider metadata.
Changes:
- Recognizes native
sessionIDwhile preserving existing field precedence. - Carries boolean truncation flags through parsing, types, projection, and generated schemas.
- Adds regressions for metadata filtering, snapshot reconciliation, and source-ordered accounting, and documents the contract.
| File | Description |
|---|---|
docs/src/content/docs/specs/unified-agent-session-specification.md |
Documents truncation, session scope, and accounting order. |
docs/public/schemas/unified-session.schema.json |
Adds boolean outputTruncated to unified completions. |
docs/public/schemas/agent-session.schema.json |
Adds boolean outputTruncated to canonical completions. |
actions/setup/js/unified_session_payload.cjs |
Preserves truncation in unified projection. |
actions/setup/js/types/unified_session.d.ts |
Includes truncation in unified completion types. |
actions/setup/js/types/agent_session.d.ts |
Defines the optional truncation field. |
actions/setup/js/scripts/session_schemas.test.cjs |
Tests boolean truncation validation. |
actions/setup/js/parse_opencode_log.test.cjs |
Tests truncation, scoping, reconciliation, and accounting order. |
actions/setup/js/parse_opencode_log.cjs |
Extracts native truncation and clears stale flags. |
actions/setup/js/agent_session.test.cjs |
Tests native session identity and precedence. |
actions/setup/js/agent_session.cjs |
Adds native sessionID as a context fallback. |
Review effort: Balanced (auto)
| function sessionContext(event) { | ||
| const data = event?.data ?? {}; | ||
| const sessionId = data.sessionId !== undefined ? data.sessionId : event?.sessionId !== undefined ? event.sessionId : event?.session_id !== undefined ? event.session_id : data.session_id; | ||
| const sessionId = data.sessionId !== undefined ? data.sessionId : event?.sessionId !== undefined ? event.sessionId : event?.session_id !== undefined ? event.session_id : data.session_id !== undefined ? data.session_id : event?.sessionID; |
Preserve canonical outputTruncated and merged structuredContent fields; regenerate session schemas from combined declarations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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
sessionIDin shared session context while preserving existing canonical/legacy field precedence.tool.execution_complete.data.outputTruncated, retaining the flag in unified sessions without admitting provider metadata envelopes.Evidence and validation
Existing live Actions artifacts from 42539715763 and 41940497195 exposed missing session context and a dropped native grep truncation flag. Raw evidence remains private and is not committed.
Local replay of those archived native logs verifies every scoped core event has canonical session context, the observed truncation flag survives, provider metadata remains excluded, and usage totals/turn counts are unchanged. This is local replay, not new live execution.
make agent-report-progress: passed; 262 impacted JavaScript tests passed, schema freshness and build passed. Existing lint warnings remain; no lint errors.Reconciled accounting retains source order and original timestamps, including timestamp regressions; this follows the existing ordering contract. No workflow dispatch, inference, MCP startup, or credential changes. Hosted CI and new live conformance execution remain unverified.