Repository navigation
A Pi chat shows the turns made outside it - #31618
Conversation
When a Pi chat's agent opens its conversation, Orca asks Pi for the entries saved after the point the chat last accounted for (get_entries since that entry id) and adds the terminal's turns once, in Pi's order, under the "Continued outside this chat." divider. That point is saved on the conversation handle after each chat turn and at each open. When the chat's own unsaved work and the terminal's share a suffix that can't be split (Orca died mid-turn), that suffix is skipped rather than duplicated, and later terminal turns show normally. A Pi reply over the 8 MiB line limit now fails only the optional read that asked for it instead of ending the chat.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
04d4b9e0-433d-4486-b984-4b5224ae9060
📒 Files selected for processing: 18
src/main/jsonl-rpc/agent-connection.tssrc/main/jsonl-rpc/peer-oversized-reply.tssrc/main/jsonl-rpc/peer.test.tssrc/main/jsonl-rpc/peer.tssrc/main/native-chat/agent-session-journal/journal-legacy-import.tssrc/main/native-chat/agent-session-journal/journal-pi-active-branch.tssrc/main/native-chat/agent-session-wire/structured-agent-session-journal-views.tssrc/main/pi/rpc-history-capture.tssrc/main/pi/rpc-history-catch-up.test.tssrc/main/pi/rpc-history-catch-up.tssrc/main/pi/rpc-history-import.tssrc/main/pi/rpc-history-journal-view.tssrc/main/pi/rpc-launch-resolution.tssrc/main/pi/rpc-runtime-registration.tssrc/main/pi/rpc-session-file-tail.tssrc/main/pi/rpc-session-startup.tssrc/main/pi/rpc-session.tssrc/main/pi/rpc-turns.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
The Codex catch-up's agent-neutral parts move to one module: the open-time envelope (its own deadline and cancellation, never gating the open), the bounded staged batch, the single settlement commit that re-checks the journal before writing, and the "Continued outside this chat." divider. Codex keeps only how it reads its saved turns and what the chat already holds. No behavior change; the other agents' catch-up builds on this instead of copying it.
…er' into brennanb2025/flip-pi-catchup
… when the agent asks
…er' into brennanb2025/flip-pi-catchup
…ommit to be written A journal write barrier that never settled after the import was admitted held the provider's open past the catch-up deadline. The wait now ends with the deadline or the open's cancellation, like every other step.
…er' into brennanb2025/flip-pi-catchup
…the pinned real Pi
…er' into brennanb2025/flip-pi-catchup
…er' into brennanb2025/flip-pi-catchup
…er' into brennanb2025/flip-pi-catchup
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f8f3c26d-a3e3-4ad8-a313-4f59713babb4
📒 Files selected for processing: 18
.github/workflows/pi-provider-runtime.ymlsrc/main/codex/codex-history-import-plan.tssrc/main/codex/codex-structured-thread-catch-up.tssrc/main/daemon/ndjson.test.tssrc/main/jsonl-rpc/peer-oversized-reply.tssrc/main/jsonl-rpc/peer.test.tssrc/main/jsonl-rpc/peer.tssrc/main/native-chat/agent-session-journal/journal-legacy-import.tssrc/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.tssrc/main/native-chat/transcript-line-decoders-omp.tssrc/main/pi/rpc-history-catch-up.test.tssrc/main/pi/rpc-history-catch-up.tssrc/main/pi/rpc-history-import.tssrc/main/pi/rpc-history-journal-view.tssrc/main/pi/rpc-launch-resolution.tssrc/shared/main-process-ndjson-framer.tstests/tools/pi-provider-runtime-smoke.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
…catchup # Conflicts: # src/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.test.ts
|
Pi turns saved from a terminal were missing when returning to Orca. This change reconciles Pi's active branch when its process starts again, importing outside rows once before the next ordinary Send. Rewinds keep older visible rows and append the new branch. Review fixed rewind rejection, dropped image prompts, clipped decoded content, queued input hiding outside turns, late oversized optional replies closing the connection, and smoke-proof termination. Two rounds plus final integration review and comparison with the common pattern passed. All 54 checks on
Intended differences from the common pattern: Orca keeps displayed history separately from Pi’s file, which terminal writers and copied/forked sessions can also extend. It therefore imports one atomic batch into the host’s saved journal and correlates Pi’s entry ID with the journal position using the existing resume cursor. Rewinds retain already displayed older rows; ambiguous crash gaps are conservatively skipped to avoid duplicate work. Required or unidentified record loss remains fatal because silently dropping it can lose a final tool result or leave a dialog unanswered. These choices meet Orca’s external-writer and saved-history requirements; they do not imply identical architectures. Catch-up shares the existing 30-second startup budget. Optional failure logs/skips and opens normally, retaining prior coverage; a whole-history reply above the 8 MiB line limit may repeatedly skip. Import admits one whole batch, at most 1024 operations/16 MiB. Outside writes wait for a running Pi to restart; ambiguous old/adopted/crash gaps deliberately baseline to avoid duplicates. Existing decoded-content/image-preview restrictions remain. Required/unknown/aggregate/lifecycle record loss stays fatal; the separate single-event-size limitation is STA-11625. Follow-ups found during QA remain separate: folder catalog and shell-history loss, stale Session History snapshots, duplicate Pi/OMP discovery, and restored terminal's old working directory. Pi's stale snapshot is tracked alongside Codex without claiming its exact Codex cause proved. Current forced catalog Refresh matches physical records; native and catalog counts measure different items. Detailed QA qualifications
For Brennan’s review Before/after and flow screenshots — actual head and scenario on eachBefore — actual older build 9f0d55e: outside terminal turns are missing after returning to native chat. This is the historical baseline, not current main. After — e202aa7: real outside continuation imported by normal Send, before the new reply. e202aa7 — actual shared-ancestor rewind and repeat; earlier rows remain and new branch appears once. e202aa7 — genuine previously moved/forked folder restored, continued and reopened without duplicate copied rows; no new move on this head. e202aa7 — retained image opens in its dialog; payload/pixels are separately verified. e202aa7 — full decoded long output; actual disclosure/tool fold and complete bodies were separately checked. e202aa7 — first encrypted phone-originated Send and outside import, shown in the desktop companion. e202aa7 — phone repeat reply and prior outside pair visibly retained in the desktop companion; this is not a phone screen. e202aa7 — genuine registered-worker mailbox reply after composer-assisted recovery; full tool bytes are verified separately.
Ordinary CLI on e202aa7 — the outside pair and divider precede the assignment reply; the same chat then answers both CLI messages. |











Pi conversations continued in a terminal could return to Orca with outside turns missing: Pi's saved conversation and Orca's displayed history were not reconciled.
When Pi starts again, Orca now imports the outside active branch once, in order, under “Continued outside this chat,” before delivering the next ordinary Send. A terminal rewind keeps older displayed rows and appends its new branch under the existing rewound divider. Revealing a resting tab alone does not start Pi or import history.
This catch-up change is useful on its own when a Pi conversation is continued with
pi --session <file>and reopened in Orca. Enabling the separate in-place chat/terminal switch is outside this PR.Verification on
e202aa7d2024f632b7d783529e546505332f456a:Cleanup accepted: the final packet passed 50 independent saved-receipt checks. Recorded processes exited; assigned ports were reported empty and the QA-only source delta restored. The QA lead’s genuine completion was accepted, its supervised terminal released and ticket 1402 returned. Historical and descendant-tree limitations below remain.
Intended differences from the common pattern: Orca keeps displayed history separately from Pi’s file, which terminal writers and copied/forked sessions can also extend. It therefore imports one atomic batch into the host’s saved journal and correlates Pi’s entry ID with the journal position using the existing resume cursor. Rewinds retain already displayed older rows; ambiguous crash gaps are conservatively skipped to avoid duplicate work. Required or unidentified record loss remains fatal because silently dropping it can lose a final tool result or leave a dialog unanswered. These choices meet Orca’s external-writer and saved-history requirements; they do not imply identical architectures.
Catch-up shares the existing 30-second startup budget. Optional failure logs/skips and opens normally, retaining prior coverage; a whole-history reply above the 8 MiB line limit may repeatedly skip. Import admits one whole batch, at most 1024 operations/16 MiB. Outside writes wait for a running Pi to restart; ambiguous old/adopted/crash gaps deliberately baseline to avoid duplicates. Existing decoded-content/image-preview restrictions remain. Required/unknown/aggregate/lifecycle record loss stays fatal; the separate single-event-size limitation is STA-11625.
Follow-ups found during QA remain separate: folder catalog and shell-history loss, stale Session History snapshots, duplicate Pi/OMP discovery, and restored terminal's old working directory. Pi's stale snapshot is tracked alongside Codex without claiming its exact Codex cause proved. Current forced catalog Refresh matches physical records; native and catalog counts measure different items.
Detailed QA qualifications
.claude.jsonand.codex/config.toml, actors UNKNOWN. No attribution or real-content read/copy/restore is claimed.Before/after and flow screenshots — actual head and scenario on each
Before — actual older build 9f0d55e: outside terminal turns are missing after returning to native chat. This is the historical baseline, not current main.
After — e202aa7: real outside continuation imported by normal Send, before the new reply.
e202aa7 — actual shared-ancestor rewind and repeat; earlier rows remain and new branch appears once.
e202aa7 — genuine previously moved/forked folder restored, continued and reopened without duplicate copied rows; no new move on this head.
e202aa7 — retained image opens in its dialog; payload/pixels are separately verified.
e202aa7 — full decoded long output; actual disclosure/tool fold and complete bodies were separately checked.
e202aa7 — first encrypted phone-originated Send and outside import, shown in the desktop companion.
e202aa7 — phone repeat reply and prior outside pair visibly retained in the desktop companion; this is not a phone screen.
e202aa7 — genuine registered-worker mailbox reply after composer-assisted recovery; full tool bytes are verified separately.
Ordinary CLI on e202aa7 — the outside pair and divider precede the assignment reply; the same chat then answers both CLI messages.