Repository navigation
Convert Atomic sessions to the unified session format - #77052
Conversation
d7c6e0a to
a77db04
Compare
|
✅ Ponytail Reviewer completed successfully!
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Reviewed the changed lines and found no actionable correctness, regression, performance, or security issues. The responseId collision handling and Atomic unified-session integration are covered by the added tests. Specialist pass was unavailable because its file access was denied; this review is based on the pre-fetched diff and source inspection.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
What this change does: Atomic emits JSONL and uses the Pi parser to produce unified sessions. The parser also separates turns when response IDs repeat.
Should fix: 1. Reuse the captured stream in the Pi regression test; it satisfies the existing assertions and removes duplicate setup.
Verdict: Ship.
Lean: -43 lines possible.
Generated by ✂️ Ponytail Reviewer for #77052 · codex · routed: gpt61 medium · ~9 AIC · ⌖ ~1 AIC · ⊞ 181
Comment /ponytail to run again
| stopReason: "stop", | ||
| usage: { input: 5, output: 2, cacheRead: 0, cacheWrite: 0, reasoning: 0, totalTokens: 7, cost: { total: 0 } }, | ||
| }; | ||
| const records = [ |
There was a problem hiding this comment.
Should fix: This recreates the same two-turn reused-response-ID stream already in fixtures/atomic_ci_stream.cjs; import atomicWorkflowStream and keep these assertions, which all pass with that fixture, to remove 44 lines of duplicate setup and avoid maintaining two copies of the same case.
There was a problem hiding this comment.
Updated in dcd590e839 to import and reuse atomicWorkflowStream from fixtures/atomic_ci_stream.cjs with the same assertions.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, and /codebase-design. Requesting changes because stdout redaction regressed for multi-line secrets.
📋 Key Themes and Highlights
Key Themes
- Redaction regression (blocking):
sanitizeStdoutno longer usestextMode. A multi-line raw secret leaks. I reproduced this with a Node probe. Adding atextModepass after the line-aware pass closes the leak and keeps JSONL valid. - Pi output change (question):
session.initnow carriestimestampfromcreatedAt. This contradicts the claim that existing Pi projections are identical. I could not confirm against the base commit in this sandbox. - Reconciliation path (suggestion): the
agent_endidentity-vs-position fallback needs a comment and a test.
Positive Highlights
- ✅ The
responseIdreuse fix inpi_session.cjshas a clear regression test. - ✅ The end-to-end
atomic_session_pipeline.test.cjscovers the new parser path. - ✅ The captured JSONL fixture gives realistic coverage.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| continue; | ||
| } | ||
| const messageID = messageIdentity(message); | ||
| const byIdentity = messageID !== undefined ? identityStates.get(messageID)?.find(candidate => !consumedStates.has(candidate)) : undefined; |
There was a problem hiding this comment.
[/codebase-design] The agent_end path adds a second reconciliation route. It picks byIdentity when available, otherwise it falls back to a position-based state. The fallback is reasonable, but the choice is not documented or tested.
💡 Suggested change
Add a short comment on why identity matching is preferred and when the position fallback applies. Add a test where responseId is absent on the agent_end message.
@copilot please address this.
There was a problem hiding this comment.
Documented and tested in dcd590e839. Added a comment explaining why identity matching in turn order runs first and when the position fallback applies, added a regression test where the trailing partial agent_end assistant message has no responseId, and preserved openAssistantState before iterating agent_end.messages so reconciling earlier turns does not overwrite the open partial turn.
| else if (raw.type === "turn_start") { | ||
| } else if (raw.type === "session") { | ||
| const init = emit(raw, "session.init", { sourceEngine, sessionId: raw.id, cwd: raw.cwd, model: raw.model }); | ||
| retainMessageTimestamp(init, { timestamp: raw.createdAt }); |
There was a problem hiding this comment.
[/tdd] session.init now takes createdAt as its top-level timestamp. The PR says existing Pi projections are identical, so this looks like a behavior change for Pi logs too.
💡 Suggested test
Add a Pi-regression assertion that pins the session.init projection, or note in the PR description that this field is intentionally added for Pi. I could not confirm the base output because the sandbox could not fetch the base commit.
@copilot please address this.
There was a problem hiding this comment.
Kept this intentionally for both pi and atomic in dcd590e839, added a Pi regression test in pi_session.test.cjs, and updated the PR description. Existing Pi v3 session headers use timestamp (which createSessionEvent already copied onto session.init.timestamp on main) or omit both fields; retainMessageTimestamp only populates session.init.timestamp from createdAt when timestamp, ts, time, and created_at are all absent.
| } | ||
| const stdout = sanitize(result.stdout); | ||
| const stderr = sanitize(result.stderr); | ||
| const stdout = sanitizeStdout(result.stdout); |
There was a problem hiding this comment.
[/diagnosing-bugs] Stdout redaction regression: sanitizeStdout now runs the line-aware path without textMode. A multi-line secret that appears as raw (non-JSON-escaped) text is not matched per line and leaks. I reproduced this with a Node probe, while the old textMode path redacted it.
💡 Suggested fix and test
Run the line-aware pass, then a textMode: true pass over its output. The second pass closes the leak and keeps JSONL lines valid. Add a regression test in atomic_session_pipeline.test.cjs with a multi-line raw secret on the stdout path.
@copilot please address this.
There was a problem hiding this comment.
Fixed in dcd590e839. Both harness-script and durable.harness-script in shared/atomic.md now run the line-aware JSONL pass followed by sanitizeText (textMode: true), and the Atomic workflows are recompiled. Added a red-first regression test in atomic_session_pipeline.test.cjs covering both harness scripts with a multi-line raw secret and JSON-escaped secrets on stdout, verifying that every JSONL line remains valid and passes unified session validation.
There was a problem hiding this comment.
🟡 Changes recommended
Registered credentials split across JSONL delta records remain reconstructable in stdout and logs, exposing secrets even when final snapshots are redacted.
3 open issues
What changed in this PR
Adds unified-session conversion and step summaries for the experimental Atomic engine, building on its durable-session support.
Changes:
- Switch Atomic to JSON output with JSON-aware stdout redaction and declared log parsing.
- Reuse the Pi parser while preserving Atomic identity and timestamps, and fix cross-turn response-ID collisions.
- Add regression and pipeline coverage, regenerate workflow locks, and update documentation and release notes.
| File | Description |
|---|---|
pkg/workflow/atomic_workflow_test.go |
Verify JSON invocation, parser wiring, and captured CLI sessions. |
pkg/cli/session_parser_test.go |
Add Atomic session reconstruction coverage. |
docs/src/content/docs/reference/third-party-agent.md |
Document Atomic’s structured session support. |
actions/setup/js/rendering_scripts_verifier.test.cjs |
Register Atomic for rendering verification. |
actions/setup/js/pi_session.test.cjs |
Cover response-ID reuse across turns. |
actions/setup/js/pi_session.cjs |
Separate turn state and accounting; preserve engine identity and timestamps. |
actions/setup/js/parse_pi_log.cjs |
Expose Atomic parsing through the shared Pi implementation. |
actions/setup/js/fixtures/atomic_ci_stream.cjs |
Add a captured Atomic tool-call transcript. |
actions/setup/js/engine_log_parser.cjs |
Register Atomic parsing and parser-selection policy. |
actions/setup/js/atomic_session_pipeline.test.cjs |
Test summaries, unified sessions, and reconstruction end to end. |
.github/workflows/smoke-atomic.lock.yml |
Regenerate smoke execution and summary parsing. |
.github/workflows/shared/atomic.md |
Declare JSON execution, stdout redaction, and log parsing. |
.github/workflows/engine-conformance-atomic.lock.yml |
Regenerate conformance execution and summary parsing. |
.changeset/patch-atomic-unified-session-converter.md |
Record the conversion feature and collision fix. |
Review effort: Max (auto)
| const sanitizeStdout = output => redactArtifactMaskedValues( | ||
| output?.toString("utf8") || "", [...sensitiveValues], undefined, () => "[REDACTED]" | ||
| ); |
| - --mode | ||
| - text | ||
| - json |
| const sanitizeStdout = output => redactArtifactMaskedValues( | ||
| output?.toString("utf8") || "", [...sensitiveValues], undefined, () => "[REDACTED]" | ||
| ); |
|
/matt |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~12 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "dcd590e839146a65ee19552c631b33590ba4ec2f",
"kind": "requested",
"schema_version": "1",
"state": "a5df464c09162e6e3983a1e4594f9c1b51529def4ab9e616feb68a34a367cebb",
"work": [
"741d37030d263a1ae13bd54df36d8406ceaac58c51479cfb00c2ffb23ed394fa",
"eb4781d22ceb50fdb7a86e2bde7b1a2eee7c788463ed82dbe1f0708777f1c387"
],
"workflow": "pr-sous-chef"
}
|
|
@lavaman131 try to use indenpendt PRs. Stacks don't work well on the iOS app. |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "6c1b0ef24f3794b0349eeace8f404ac0071e5bce",
"kind": "requested",
"schema_version": "1",
"state": "9cc9a68a06a2e1c0c4e86f8de5cc8fad5df9e56e2ed73bfe6afd425f823c14b8",
"work": [
"741d37030d263a1ae13bd54df36d8406ceaac58c51479cfb00c2ffb23ed394fa",
"eb4781d22ceb50fdb7a86e2bde7b1a2eee7c788463ed82dbe1f0708777f1c387"
],
"workflow": "pr-sous-chef"
}
|
Merged the latest |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "6f28e07785e1f9e077e7abe6f982b8414336b0e5",
"kind": "requested",
"schema_version": "1",
"state": "7c0525ed2f1139d67b146c095ee61bc3085f05ac6844b2bd349f30f978ec8f1d",
"work": [],
"workflow": "pr-sous-chef"
}
|
Switch the Atomic sample to --mode json, declare its log parser, and register atomic on the shared Pi v3 session parser path with sourceEngine set to atomic and session v4 createdAt timestamps retained. Fix cross-turn message and usage collisions in pi_session.cjs when an OpenAI-compatible proxy reuses response IDs across turns.
Run a textMode redaction pass after line-aware JSONL redaction in the Atomic harness script so multi-line raw secrets on stdout are masked while keeping JSONL lines valid. Preserve the open assistant state across earlier agent_end messages, document the identity-vs-position fallback, pin session.init createdAt timestamp projection for Pi, and reuse atomicWorkflowStream in the shared Pi regression test.
6f28e07 to
f03e22b
Compare
Co-authored-by: gh-aw-bot <[email protected]>
f03e22b to
bf873d4
Compare
|
🎉 This pull request is included in a new release. Release: |
Resolve conflicts with the JSONL event output harness (#77052): keep its output sanitizers and --mode json, plus the drive sessions and runs. Workflow runs now use atomic storage import/export <dir> --workflows (Atomic 0.9.84+, detected from export --help offering --workflows), with <dir>/workflows/<runId>.jsonl. The drive's workflows/ folder is replaced only after a successful export, and saved runs the export lacks stay unless the budget prunes them.


cc @pelikhan
Convert Atomic CLI output into gh-aw's unified agent session format and step summaries by running Atomic with
--mode jsonand sharing the Pi v3 JSONL parser.What changed
.github/workflows/shared/atomic.mdfrom--mode textto--mode json, declarebehaviors.log-parsercallingparseAtomicLog, and run line-aware JSONL secret redaction followed by atextModepass on captured stdout so both JSON-escaped and multi-line raw secrets are masked while keeping JSONL valid.parseAtomicLogtoactions/setup/js/parse_pi_log.cjsand registeratomicinactions/setup/js/engine_log_parser.cjs(sessionParsersanddeclaredFirstParserPolicies) without duplicating the Pi parser. Session events, step summaries, and reconstructed unified sessions recordsourceEngine: "atomic"and retaincreatedAttimestamps from Atomic v4sessionheaders.actions/setup/js/pi_session.cjs(transformPiV3EntriesandcomputePiV3Stats) when an OpenAI-compatible proxy reuses the sameresponseIdacross turns. Turn boundaries now reset active message-state and stats maps, andagent_endreconciles transcript snapshots in turn order instead of overwriting earlier turns or duplicating the final assistant message.actions/setup/js/atomic_output_redaction.cjs(createAtomicOutputSanitizers), which the harness loads, and add it to the filesactions/setup/setup.shinstalls. The sample keeps--no-session; Atomic still emits its v4sessionheader in JSON mode.smoke-atomic.lock.ymlandengine-conformance-atomic.lock.yml, update the Atomic row indocs/src/content/docs/reference/third-party-agent.md, and add a patch changeset.Compatibility
GH_AW_SAFE_OUTPUTS->collect_ndjson_output.cjs->agent_output.json), BinEval grading, threat detection, conformance post-steps, and non-zero failure exits continue to work unchanged.timestampor omit it onsessionheaders) and legacy flat logs keepsourceEngine: "pi"and identical event projections;sessionheaders that carrycreatedAtwithout a primarytimestampnow also projectcreatedAtontosession.init.timestampfor bothpiandatomic, and theresponseIdcollision fix benefits both engines.Validation
make buildand./gh-aw compile smoke-atomic engine-conformance-atomic daily-declarative-engine-improver --validate: 3 workflows compiled.go test ./pkg/workflow -run Atomicandgo test ./pkg/cli -run Session: passed.GH_AW_ATOMIC_TEST_CLI=<@bastani/[email protected] cli> go test ./pkg/workflow -run Atomic -count=1: passed. This includes the live--mode jsonnative MCP and provider stream tests, plus unified session verification of the captured output.cd actions/setup/js && npx vitest run atomic_session_pipeline atomic_output_redaction pi_session parse_pi_log rendering_scripts_verifier: 9 files, 149 passed, 1 skipped.make agent-report-progress(Go lint, custom linters, JavaScript lint, impacted tests, full lock-file drift check): passed.smoke-atomicandengine-conformance-atomicwere not dispatched from this local checkout.