Repository navigation
OpenCode and Grok chats show the turns made outside them - #31616
Conversation
…e them When an OpenCode or Grok chat reopens its conversation, the agent replays its saved history before it answers. Orca used to drop all of it. Now the turns in it the chat never saw (made in the agent's own CLI, or anywhere else) are added once, in the agent's order, after the chat's rows and behind the existing "Continued outside this chat." divider. Turns are matched by the agent's own ids: Grok's prompt id (Orca's own turns carry the id Orca sent) and OpenCode's saved message ids, plus the rows of a transcript the chat was adopted from. A send of the chat's own that failed before any reply is matched by its text between the turns proven around it, because OpenCode never tells a client the id it gives a person's message. The import is translated by the same translator and assembler as a live turn into an in-memory overlay, then written as one settlement: a stale or failed import writes nothing, and it never fails the open. A turn imported part-way gets the rest of what the agent saved on a later open.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c80df5c2-cbd7-4471-9c81-e57f9da5484e
📒 Files selected for processing: 13
src/main/acp/acp-history-catch-up.test.tssrc/main/acp/acp-history-catch-up.tssrc/main/acp/acp-history-journal-overlay.tssrc/main/acp/acp-history-replay.tssrc/main/acp/acp-history-translation.tssrc/main/acp/acp-history-turn-matching.tssrc/main/acp/acp-launch-specs.tssrc/main/acp/acp-structured-acquire.tssrc/main/acp/acp-structured-handshake.tssrc/main/acp/acp-structured-session-adapter-resume.test.tssrc/main/acp/acp-timeline-translator.tssrc/main/acp/fixtures/grok-v1-reopen-outside.jsonlsrc/main/acp/fixtures/opencode-v2-reopen-outside.jsonl
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 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-acp-catchup
… when the agent asks
The open envelope, budget, divider and one checked commit now come from the shared catch-up runner; ACP keeps only how it reads the reopen replay and what the chat already holds. The final-barrier deadline test moves with the barrier to the runner.
…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-acp-catchup
…er' into brennanb2025/flip-acp-catchup # Conflicts: # src/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.test.ts # src/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.ts
|
Continuing an OpenCode or Grok conversation in its terminal can leave later turns absent from its saved native chat. This PR imports eligible outside turns after the provider next starts for that same conversation, preserves proven native/adopted history, and revises only earlier imported observations. Viewing History does not trigger import; optional failure is logged and cannot refuse opening or sending. Three correctness rounds and KEEP are complete. Independent source/reference/performance/checklist qualification is accepted; no confirmed open P0/P1 remains. The complete production allocation is 1,222 gross under the approved 1,240 cap. The common pattern does not reconcile outside observations into an independently retained transcript; that difference is intended for this requirement. PERF-01 is closed by five operation-count contract tests with 20 measurements, including journal recovery at 42/402 rows. Cumulative serialization bytes and real-host latency remain unmeasured. Reviewed head On5791751, Claude and Codex completed real replies/tools, graceful restart and primary same-native History reopen with preserved canonical identities/order. Codex changed an existing completed-turn context timestamp/revision after a send. No queued-card pass is claimed. Historical unaffected OpenCode native replies/upgrade and Codex Stop/Interrupted/reopen evidence carries. All required saved-Grok cells are accepted: genuine778 adoption (398 exact full stored records), older content/restart/two primary reopens; pinned-main comparison; same-profile candidate upgrade preserving all398; supplemental69 adoption (167 exact records,37 tool groups), two primary reopens and narrow earlier-content visibility. No new page-fetch or standalone scrollbar/Home success is claimed. Private69 originals remain private, and fully masked derivatives are not transcript proof. OpenCode not exercised: no sign-in on any QA machine The remaining two OpenCode outside-continuation chains and positive imported-archival/live-work and conditional producer-ordering runtime cells are unexercised, not passes. Both pinned versions received one bounded primary OK check on each available remote QA machine. No new account, sign-in, credential refresh or purchase occurred. Brennan disposed this Mac's previous-build failures as its sign-in problem, not the PR; the launcher authorized this coverage disposition after the other available machine checks. No confirmed producer defect or PR regression was established.
These checks do not prove credential rejection on M4Air or Windows low. No Orca build/app was started remotely. Windows low's private 2.0.14 auto-service chose a dynamic loopback port outside its configured gate range; this harness deviation is disclosed, both recorded daemons are stopped and endpoints clear. All owned remote provider processes/auth copies are absent, real config hashes unchanged, leads closed and tickets released. The unused electron queue is cancelled. No passing saved-Grok or Claude/Codex flow was repeated. Grok real replies and provider-start replay are waived by Brennan for grok: “Grok yeah we can skip, maybe you can find some pre-existing grok CLI chats here on my system to test grok here on thi smac”. This remains a coverage gap; saved-chat QA passed without Grok sends. For Brennan’s review Main versus branch: the same saved CHATONE before new input. These screenshots prove saved content survived the restart; they do not prove outside catch-up. Main is 1920×1050 and branch is 2048×1120, with different existing tab sets and sidebar arrangement; no viewport resizing was performed. The baseline outside flow was not captured.
Historical upgrade replies on cfb7e9a. The original OLDCHAT and both new replies remain visible. Historical shared Codex consumer on cfb7e9a. Stop showed Interrupted after the two initial real replies. The subsequent same-chat reply after Session History reopen also completed. These checks do not replace OpenCode catch-up acceptance. Human-review spot: historical content is excluded from live work ownership. The new archival predicate recognizes generated Grok/OpenCode history; genuine Claude/Codex producers cannot enter its positive branch. Their shared native lifecycle checks above carry. Positive imported-state execution exclusion is an unexercised OpenCode runtime cell; existing deterministic journal/recovery contracts cover its source behavior. It is not claimed as a runtime pass. Shared lifecycle on 5791751. These whole-window masked captures show the completed postrestart replies and retained tool cards. They do not prove outside catch-up, imported archival exclusion or a queued-message card. Worktree-list masking hides unrelated names. Saved Grok 778 on 5791751. This whole-window older-page capture masks private transcript bodies and unrelated names. Content equality comes from the canonical record comparison, rather than the masked pixels. Pinned-main saved-Grok comparison. This whole-window capture masks private content while retaining the Reasoning and grouped-tool UI. The complete stored-record comparisons and two ordinary same-chat primary reopens establish preservation; the masked image alone does not establish content equality. Required OpenCode baseline attempts on pinned main 6cd2550. Each whole-window capture shows the one CHATONE prompt, the selected model label and the rejected state, with no assistant reply. Private workspace details are masked. These are failure receipts; they do not prove outside catch-up.
|
…er' into brennanb2025/flip-acp-catchup
…-catchup # Conflicts: # src/main/acp/acp-timeline-translator.ts
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:
ec20eb4a-f148-4a48-b86f-6d0f6e54adf2
📒 Files selected for processing: 21
src/main/acp/acp-history-catch-up.test.tssrc/main/acp/acp-history-catch-up.tssrc/main/acp/acp-history-journal-overlay.tssrc/main/acp/acp-history-replay.tssrc/main/acp/acp-history-translation.tssrc/main/acp/acp-history-turn-matching.tssrc/main/acp/acp-launch-specs.tssrc/main/acp/acp-structured-acquire.tssrc/main/acp/acp-structured-handshake.tssrc/main/acp/acp-timeline-dialect.test.tssrc/main/acp/acp-timeline-translator.tssrc/main/acp/acp-turn-messages.tssrc/main/agent-hooks/first-work-branch-rename.test.tssrc/main/native-chat/agent-session-timeline/provider-timeline-history.tssrc/main/native-chat/agent-session-timeline/provider-timeline-settlement.tssrc/main/native-chat/agent-session-wire/structured-agent-session-current-work.tssrc/main/native-chat/agent-session-wire/structured-agent-session-dead-generation-settlement.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-test-harness.tssrc/main/native-chat/agent-session-wire/structured-agent-session-stale-state-settlement.tssrc/main/native-chat/agent-session-wire/structured-agent-session-unfinished-work.tssrc/main/runtime/rpc/methods/structured-agent-session-rpc.test-fixture.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
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:
27c5ab98-a87f-44b3-8710-d69f0ce6fe2a
📒 Files selected for processing: 6
src/main/acp/acp-history-ordered-availability.tssrc/main/acp/acp-history-replay.tssrc/main/acp/acp-history-scaling.test.tssrc/main/acp/acp-history-turn-matching.tssrc/shared/structured-agent-session-message-projection.test.tssrc/shared/structured-agent-session-message-projection.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.














Problem and change
After continuing the same OpenCode or Grok conversation in its own terminal, Orca's native chat can omit those later turns even though the agent remembers them. This change adds eligible outside turns after the next successful provider start for that same conversation, under “Continued outside this chat.” It preserves proven native and adopted history and updates only content previously imported by this feature.
Viewing a tab or Session History reads saved chat rows. It does not start catch-up. A send that needs a new provider process can trigger catch-up; a send to a retained live process does not. Optional import failure is logged and does not refuse opening or sending. Its awaited work can delay provider setup.
Implementation
The existing connection supplies a bounded copy of the provider's load replay. The ordinary translator and row assembler reconstruct observations in a temporary journal, establish native/adopted ownership, and stage one atomic reconciliation. A stale or contradictory snapshot writes nothing. Imported user rows do not deliver a pending native send, and archival observations do not own live execution or recovery.
Exact provider identities supply coverage proof. OpenCode's remaining output-free requests can match unused, output-free native requests with identical text between proven boundaries. Source-position and per-text native lookup indexes preserve dynamic repeated identities, exact reservations, sequence ties and regressing floors. Replay keeps first-seen identity order with a membership Set. The shared rejected-send visibility helper derives strictly later copy maxima once, preserving its existing display rules for every consumer. All new indexes die after the import.
No new saved field, identity family or wire operation is added. OMP catch-up stays off. Provider commands, settings and switch enablement are unchanged.
Intended differences and limits
Scope and allocation
Full review path: this exceeds the small-change threshold and touches saved chat lifecycle, ordering and process-boundary consumers. Three historical correctness rounds and the accepted decider ruling are preserved. The additive performance design was separately settled by the prescribed architecture panel.
Complete authored production against exact integrated main 6386efa: 1,184 added +38 deleted =1,222 gross lines, within the explicitly approved 1,240 cap. Eighteen production files preserve the previously qualified mechanism. Tests/fixtures/support are 1,989 gross across12 files, with2 routing lines in one file; independent qualification accepts their distinct regression signals. The automated summary above uses its own file classification. Exact cumulative materialized/serialized product bytes and real-host latency remain unmeasured.
Verification and current status
The full review loop completed on
907d2d0365a76aaee93643339969f4c6e617fdcd. Three correctness rounds/KEEP and independent whole-mechanism source/reference/performance/checklist qualification are accepted; no confirmed open P0/P1 remains. The conflict-blocking merge of pinned main0044d2c0b0ddc814693bcc9a730a9b364c6a3dd9into the previously accepted703765db6d538fe3b68717fb81d3619fe0a2d6d0preserves the qualified behavior from QA head5791751cef40e3031d26384aa72e189729395306. Independent narrow integration qualification is AGREE across the one conflict and seven automatic overlaps; the required direct scoped hook passed. QA carries and no flows were rerun. Subsequent commitf840463b1ee41494407f1ab86a5b19ab6a7ffa2eadds only three reason comments for existing journal-scaling test timeouts, satisfying the new main test rule without changing test or production behavior. Final-head CI onf840463b1ee41494407f1ab86a5b19ab6a7ffa2e: 26 SUCCESS /16 SKIPPED, including static analysis/typecheck, all five unit shards, packaging on both platforms, and cross-version compatibility. GitHub is CLEAN/MERGEABLE, out of draft, with all four review threads resolved. All four review threads are resolved.PERF-01 is closed with five scoped operation-count contracts/20 measurements, including journal recovery at 42/402 rows. The real-trigger 20/200 baseline measured suffix work190→19,900, gap/boundary reads800→80,000 and rejected-copy work229→20,299. New contracts observe zero suffix reads, membership 22→202 and copy lookup 60→600 while preserving order/native history/reopen behavior. Cumulative serialization bytes and real-host latency remain unmeasured.
Claude and Codex completed real replies/tools, graceful restart and primary same-native History reopen on 5791751. Original canonical identities/order survived; Codex changed an existing completed-turn context timestamp/revision after sending. No queued-card pass is claimed. Historical unaffected OpenCode native/upgrade replies and Codex Stop/Interrupted/reopen evidence carries.
All required saved-Grok QA is accepted:778 adoption 398 exact full stored records/older content/restart/two primary reopens; pinned-main comparison; same-profile candidate upgrade preserving all398; supplemental69 adoption 167 exact records/37 tool groups/two primary reopens/narrow earlier-content visibility. No new page-fetch or standalone scrollbar/Home success is claimed. Private69 images remain private; fully masked derivatives are not transcript proof.
OpenCode not exercised: no sign-in on any QA machine
The remaining two OpenCode outside-continuation chains and positive imported-archival/live-work and conditional producer-ordering runtime cells are unexercised, not passes. Both pinned versions received one bounded primary OK check on each available remote QA machine. No new account, sign-in, credential refresh or purchase occurred. Brennan disposed this Mac's previous-build failures as its sign-in problem, not the PR; the launcher authorized this coverage disposition after the other available machine checks. No confirmed producer defect or PR regression was established.
These checks do not prove credential rejection on M4Air or Windows low. No Orca build/app was started remotely. Windows low's private 2.0.14 auto-service chose a dynamic loopback port outside its configured gate range; this harness deviation is disclosed, both recorded daemons are stopped and endpoints clear. All owned remote provider processes/auth copies are absent, real config hashes unchanged, leads closed and tickets released. The unused electron queue is cancelled. No passing saved-Grok or Claude/Codex flow was repeated.
Grok real replies and provider-start replay are waived by Brennan for grok: “Grok yeah we can skip, maybe you can find some pre-existing grok CLI chats here on my system to test grok here on thi smac”. That provider-start/reply cell remains a waived coverage gap; saved-chat QA is completed without Grok sends.
Screenshots, original head labels, exact scope, limitations and the review-completion marker are in the single review status comment.
Agent skill upstream boundary
Author: Brennan Benson (@BrennanKB5)