Repository navigation
Preserve Goose tool diagnostics and unified session evidence - #67349
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #67349: the PR does not carry the 'implementation' label (has_implementation_label=false) and has 0 new lines in default business logic directories (threshold 100, no custom .design-gate.yml). 4 files changed.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
There was a problem hiding this comment.
🟡 Changes recommended
Shell failures can be marked successful, and invalid explicit metadata can produce schema-invalid session artifacts.
2 open findings
What changed in this PR
Improves Goose log parsing so canonical sessions retain tool diagnostics, ordering, metadata, accounting, and terminal failures.
Changes:
- Preserves MCP identities, shell results, streaming order, and cumulative usage.
- Adds CI-derived regression fixtures and round-trip validation.
- Documents Goose session behavior.
| File | Description |
|---|---|
docs/src/content/docs/reference/engines.md |
Documents parser guarantees. |
actions/setup/js/parse_goose_log.cjs |
Enhances Goose event normalization. |
actions/setup/js/parse_goose_log.test.cjs |
Adds parser and collection regressions. |
actions/setup/js/fixtures/goose_ci_sessions.cjs |
Adds sanitized CI fixtures. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Request changes
The Goose parser change regresses startup-failure diagnostics: the new mcp.event path currently drops serverName during unified-session normalization, so persisted artifacts no longer say which extension failed to start.
Blocking theme
Please wire the new diagnostic shape all the way through normalizeUnifiedSessionEvent()/schema coverage before merging. The current tests only round-trip the parser output, so this loss does not get caught once the event is collected into a unified session.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 44.7 AIC · ⌖ 5.76 AIC · ⊞ 19.5K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (via pr-triage: bug_fix). This PR fixes real data-loss bugs in the Goose adapter — MCP identity, shell exit codes, falsy tool arguments, streaming text ordering, and cumulative usage reconciliation — each backed by CI-derived fixtures and targeted regression tests. Root causes are addressed directly in parse_goose_log.cjs, not papered over.
📋 Key Themes & Highlights
Key Themes
- Two moderate-impact design concerns flagged inline in
parse_goose_log.cjs:exitCodeextraction gates ontoolName === "shell", coupling the parser to one hardcoded tool name instead of a shape check.- The new streaming-text dedup key does a broad
JSON.stringifyof the whole event per delta, which is costly and fragile to get right.
Positive Highlights
- ✅ Excellent regression coverage: sanitized CI fixtures (
goose_ci_sessions.cjs) for success/failed-tool/terminal-error/startup-failure paths, each round-tripped through canonical serialization. - ✅ Root-cause fixes, not symptom patches: falsy argument preservation,
isMaxTurnsErrorcorrectly distinguishes turn limits from credit-limit errors, cumulative usage reconciliation viareconcileSessionUsageinstead of overwriting. - ✅ Backward compatibility explicitly tested (
goose.max_turns/goose.mcp_failurelegacy events still handled). - ✅ Docs updated to describe the new preserved semantics.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 90.3 AIC · ⌖ 14.5 AIC · ⊞ 10.1K
Comment /matt to run again
There was a problem hiding this comment.
Impeccable Review — harden + audit (bug_fix)
Reviewed the Goose adapter diff (parse_goose_log.cjs, new goose_ci_sessions.cjs fixtures, expanded parse_goose_log.test.cjs, doc update). This is a non-UI log-parsing fix, so applied harden (missing/edge-state handling) and audit (correctness/quality) in place of the UI-focused modes.
Verification performed (vitest unavailable offline, so logic was exercised directly with node -e against the real modules):
- MCP server identity + shell exit-code propagation into
tool.execution_start/tool.execution_complete✅ - Falsy tool-argument preservation (
null/false/0/""/{}/[]) without defaulting to{}✅ - No text-merge across intervening reasoning/tool observations; distinct streaming metadata kept separate ✅
- Envelope metadata (
id/timestamp/parentId/vendor) retained instead of overwritten ✅ - Cumulative usage reconciliation across multiple
complete/errorrecords, preserving prior accounting on a later terminal error ✅ goose.max_turns/goose.mcp_failurelegacy canonical events still round-trip; newmcp.event/session.error-based diagnostics work equivalently ✅- Malformed tool request/response records emit
session.collection_warningwithout fabricating lifecycle events ✅ - Full CI-fixture round trip through
collectUnifiedSession+normalizeUnifiedSessionEvent(schema validation itself skipped —ajvunavailable offline) ✅
No correctness, security, or missing-edge-case issues found. Documentation update in engines.md accurately reflects the new behavior.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 127 AIC · ⌖ 13.1 AIC · ⊞ 8.1K
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Why
Existing Goose smoke artifacts expose MCP server identity and command exit codes that were retained only in duplicated native envelopes, then lost from the essential unified session. The adapter also replaced null tool arguments with
{}, could reorder streamed text around tool/reasoning observations, and discarded prior accounting when a later terminal error arrived.Changes
isErrorflags, and structured result exit codes into standard tool lifecycle fields; nonzero observed exit codes control failure while contradictory native flags remain preserved.mcp.eventstartup diagnostics andsession.errormaximum-turn diagnostics while retaining compatibility with older canonical Goose extensions.The PR includes the coordinated shared session projection/type/schema/spec prerequisite as intact cherry-pick
57fc6d19e2(originalb39ff126e9). This wiresmcp.event.serverNameand standard session errors through publication and rendering instead of leaving startup diagnostics dependent on a separate PR. Goose-specific review fixes are isolated in3bee66dd97.Evidence and limits
Compared native
agent-stdio.log, persistedagent-session.jsonl, andusage/aw_session.jsonlfrom existing runs 37865761051, 37552916488, 37266019863, 37264898160, and 37248341114. Verified exact text, tool correlation/outcomes, and available accounting. Two older canonical artifacts use legacy records and fail the current schema; prior artifacts are not rewritten.37829720724 had no retrievable jobs, artifacts, or logs. No workflows were triggered. Reasoning, refusal, maximum-turn, conflicting exit flags, and snapshot edge cases are synthetic coverage rather than observed CI evidence.
Validation
npm --prefix actions/setup/js run typecheck --silentPATH="/opt/homebrew/bin:$PATH" make fmtPATH="/opt/homebrew/bin:$PATH" make lint: passed with existing repository warnings. Initial Go-linter runner contention was resolved with its supported serial-runner mode, followed by a successful full target retry.go test ./pkg/cli -run '^TestGooseUnifiedSessionReconstruction$' -count=1go test ./actions/setup -count=1PATH="/opt/homebrew/bin:$PATH" make agent-report-progress: build, scoped lint, schema freshness, and impacted tests passed (202 tests). Installed Bash 5 avoids macOS Bash 3's missingmapfile.All five in-scope review threads were replied to and resolved after publishing fixes. The initial CI snapshot had 61 successful checks, 9 skipped, and no failures on the prior HEAD. CI on the new agent-pushed HEAD remains unverified until a maintainer re-triggers it.