Skip to content

Fix Pi standard session mapping and shared evidence preservation - #67393

Merged
pelikhan merged 16 commits into
mainfrom
pelikhan-pi-session-parser
Oct 10, 2026
Merged

pelikhan merged 16 commits into
mainfrom
pelikhan-pi-session-parser

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Pi's unified session parser emitted custom pi.* wrappers and duplicated streaming snapshots instead of standard conversation and tool observations. This PR maps recognized Pi output into the shared session vocabulary and closes diagnostic-attribution gaps found during the coordinated engine audits.

Approach

  • Map Pi messages, reasoning, refusals, tools, progress, errors, and lifecycle observations to standard events. Reconcile partial/final snapshots without duplicating content or accounting; preserve exact text and supplied metadata.
  • Preserve observed diagnostic status codes in unified payloads, declarations, and generated schemas. Keep child-agent errors out of the root execution aggregate without creating a universal parent-call alias or changing Pi tool nesting.
  • Exclude quoted errors in observed message and tool output, result, and error payloads from raw diagnostic mining, including nested structured values, redaction, and partial framing. Explicit canonical root errors remain authoritative.
  • Document run evidence and synthetic coverage boundaries. Historical artifacts are not rewritten, and unavailable observations do not produce fabricated tools, outcomes, or metrics.

The branch now includes the latest merged base. Common numeric-step, nullable-exit, rendering, and accounting prerequisites already landed through other engine PRs; they are not new changes in this PR's current diff.

Validation and review fixes

  • Both Copilot findings were reproduced with five failing regressions, fixed in 10418f132d, replied to, and resolved. Coverage includes parent-call-only child diagnostics, root null/empty/invalid identities, all tool payload fields and nested values, genuine root-error controls, and Pi nested-tool scope.
  • make fmt, full make lint, and make agent-report-progress passed. Existing lint warnings remain; no tooling or assertions were disabled. Declared Prettier 3.9.9 was selected instead of an ambient unpinned alpha.
  • Typecheck, schema freshness, 1,621 session tests across 40 suites, 276 diagnostic/consumer tests, and the embedded-parser dependency check passed. The base merge also regenerated and compiled all 334 workflows.
  • Four complete Pi traces replayed through canonical persistence and unified projection with exact content/accounting reconciliation and zero remaining pi.* events: historical success, provider failure, modern success, and failed workflow.

CI and evidence limits

The pre-fix merge-head CI snapshot passed all four CJS shards, typecheck, lint, and documentation build. Python CodeQL run 38045315822 failed during SARIF post-processing because the GitHub installation API rate limit was exhausted, after source analysis and SARIF export completed. That external failure is not locally reproducible. CI at the latest agent-pushed head is unverified and requires a maintainer re-trigger before merge; no workflow was dispatched or rerun.

Other engine fixes remain on their separate branches/PRs unless already merged into the base. Cursor stream-json coverage is documentation-derived and synthetic; Crush has no inspected successful executed conversation. Workflow failure is not proof of inference failure. Pydantic AI and generic-custom audits were archived before completion. AGY's initial canceled workflow-drift check was subsequently completed in its separate PR-finisher follow-up, including all 334 workflows; those supplemental AGY/shared-renderer commits are not incorporated into this branch. No PR was merged by this session.

pelikhan and others added 7 commits October 9, 2026 22:39
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exclude child failures from main execution diagnostics, retain native status codes in essential errors, and avoid derived duplicate parent-tool aliases.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Include reported statusCode/status_code values in root execution errors without coercion or child diagnostic attribution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Respect native message and tool-output evidence before mining raw diagnostic records, including framed DeepSeek answers in live detection and empty-output summaries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match redacted and structured message/tool payloads without mining quoted errors as runtime failures. Preserve lexical framing for partial markers and document the completed cross-engine evidence boundaries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 10, 2026 10:26
Copilot AI balanced review requested due to automatic review settings October 10, 2026 10:26
Preserve Pi and shared diagnostic/projection fixes while incorporating the latest published engine audits. Regenerate session schemas and verify merged parser behavior and workflow compilation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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

Child parent-call diagnostics and non-output tool failures can still be misclassified as root execution errors.

2 open findings
What changed in this PR

Standardizes Pi session events and strengthens unified evidence preservation and diagnostic attribution.

Changes:

  • Maps Pi streams to shared session, tool, lifecycle, and error events.
  • Extends unified schemas, payload normalization, rendering, and legacy projections.
  • Improves diagnostic filtering and documents cross-engine audit evidence.
File Description
docs/​src/​content/​docs/​specs/​unified-agent-session-specification.md Updates mappings and audit evidence.
docs/​public/​schemas/​unified-session.schema.json Extends unified event schemas.
docs/​public/​schemas/​agent-session.schema.json Adds tool-step and nullable-exit fields.
actions/​setup/​js/​unified_session.test.cjs Updates completion projection expectations.
actions/​setup/​js/​unified_session_render.test.cjs Tests safe rendering of new events.
actions/​setup/​js/​unified_session_render.cjs Renders diagnostics and tool updates.
actions/​setup/​js/​unified_session_payload.test.cjs Tests newly preserved evidence.
actions/​setup/​js/​unified_session_payload.cjs Normalizes expanded standard payloads.
actions/​setup/​js/​types/​unified_session.d.ts Declares unified event extensions.
actions/​setup/​js/​types/​agent_session.d.ts Extends canonical tool types.
actions/​setup/​js/​pi_session.test.cjs Expands Pi mapping regressions.
actions/​setup/​js/​pi_session.cjs Standardizes Pi stream events.
actions/​setup/​js/​parse_pi_log.cjs Preserves Pi engine attribution.
actions/​setup/​js/​log_parser_shared.cjs Correlates numeric tool steps.
actions/​setup/​js/​empty_output_outcome.cjs Supplies events during diagnostic mining.
actions/​setup/​js/​agent_execution.test.cjs Tests diagnostic attribution boundaries.
actions/​setup/​js/​agent_execution.cjs Filters quoted and child diagnostics.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread actions/setup/js/agent_execution.cjs
Comment thread actions/setup/js/agent_execution.cjs Outdated
Exclude parent-call-only child diagnostics without changing universal session scope. Attribute all tool output/result/error payloads, including nested values, while keeping explicit root errors authoritative and Pi tool nesting intact.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
pelikhan and others added 5 commits October 10, 2026 04:39
Combine published engine and telemetry fixes with Pi standard mappings. Deduplicate overlapping statusCode fields and remove the obsolete Pi conformance-gap note; preserve distinct tool results and diagnostic attribution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Include the additional main commit that landed during validation. Preserve scoped session diagnostics and apply repository formatting to the merged failure-report wording changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Combine trusted Aider raw-source filtering with canonical conversation and nested tool-payload attribution. Preserve parent-call-only child diagnostic exclusion and reconcile empty-output expectations with main's unknown classification.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep saved-observation migration in the Pi adapter and dispatch it through the central engine registry. Preserve existing messages, outcomes, accounting, provenance, and opaque extensions while normalizing downloaded historical session copies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/38056750007/job/114226773777.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: e32fbcb
Sous-chef work: 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac
Sous-chef state: 9f5791162c59eeee9971cf7ccba67259f20ba7239185d8634b8bd6d4ba06a7cb

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 4.6 AIC · ⌖ 12.4 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 10, 2026 14:09
…arser

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged latest main and fixed the impacted Go test’s stale formatted-output expectation; make agent-report-progress and lint pass. Changes are published in the latest commit.

Copilot AI requested a review from gh-aw-bot October 10, 2026 14:20
@pelikhan
pelikhan merged commit 02c69f7 into main Oct 10, 2026
36 checks passed
@pelikhan
pelikhan deleted the pelikhan-pi-session-parser branch October 10, 2026 14:28
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.

4 participants