Repository navigation
fix(native-chat): verify the actual CLI conversation during resume - #29124
Conversation
99d9236 to
7cf362c
Compare
…2025/rcc-b-source-admission # Conflicts: # src/main/native-chat/agent-session-journal/journal-legacy-import.ts
|
The conversation-store refactor prevents admission and fallback lookup from independently choosing different locations. Each candidate account now resolves its store once, and admission, lookup and re-admission use that same store while keeping the original account used to resume. Users can still open the saved terminal conversation with its history; an unsaved conversation stays in its terminal and explains when to retry. Current reviewed head: Source review accepted the complete refactor, all six provider registrations and the CLI-fork caller, with no confirmed new behavioral defect. The adopted plan corrections match the implementation. Empty or relative stores remain unavailable, and OpenCode keeps exact database matching. Focused real-app QA ran on integrated #29150 Current QA covered the inherited default Claude account and a local Git workspace. Other providers were source-reviewed; SSH, folder workspaces, named multi-account selection, native continuation and context-window preservation were not re-tested in this focused round. Earlier broader QA below remains qualified to its recorded heads. The initial imported composer briefly showed Sonnet before settling to Opus. This visible mismatch also reproduced on main Both test copies and the QA driver were stopped by their recorded PIDs, real Claude/Codex configuration hashes were unchanged, temporary homes were removed, and qa-gate ticket 104 was released. Main comparison: transient and settled model labelsSame real source transcript; fresh main app profile. Initial Sonnet: Settled Opus: For Brennan's review — fresh whole-window screenshots on the integrated head: Saved source: Imported history: Not yet saved, with source retained: Earlier review and QA evidence, retained at the heads stated belowAll “current” statements in this retained section describe the earlier heads named here. The latest focused review and QA are above. Saved conversations could be refused because create checked unrelated accounts, treated an empty source as unreadable, verified Codex history in a different home from preparation, or reread a terminal's identity after it had closed. These failures could prevent a valid conversation from opening in a new native chat. The host now admits one source account, classifies actual read evidence, uses the same Codex execution home throughout preparation and launch, and keeps a copy of source evidence for the dispatched request. Closing or changing the source afterward cannot reattribute that request. Existing ownership/retry answers and file, provider, directory and account checks remain authoritative. The renderer action is supplied by #29150. Three review rounds finished with four confirmed P2 findings fixed and a final KEEP ruling. The additional QA-discovered failure for an unsaved transcript under a symlinked account folder was fixed in The current head is Integrated A+B+C rendered QA is complete on the Mac: main Twenty-two focused source-admission and renderer contract tests passed on For Brennan's review: the paired screenshots show the intended behavior. The main header was already visible; the improvement is removal of its History lookup. Shared pending is supported by the timestamped observations described above. The deliberate menu/header distinction preserves navigation on the header and feedback without navigation in the menu.
Focused final merge re-check (whole-window screenshots; timestamped DOM/request records prove overlap):
|
…folder A missing transcript stayed unresolved while its account root resolved through symlinks, so containment failed and a not-yet-saved conversation showed a load error instead of the unsaved notice.
…ner-refusal # Conflicts: # src/main/native-chat/agent-session-journal/journal-legacy-import.ts
…' into brennanb2025/rcc-b-source-admission # Conflicts: # src/main/native-chat/agent-session-journal/journal-legacy-import.ts # src/main/runtime/construction/runtime-construction.ts # src/main/runtime/construction/runtime-host-services.ts
…n module Keeps journal-legacy-import.ts under the line limit after the source identity observer landed on top of the streaming import.
…ner-refusal # Conflicts: # src/renderer/src/lib/structured-agent-session-launch-admission.ts
…' into brennanb2025/rcc-b-source-admission
…' into brennanb2025/rcc-b-source-admission
…urce-admission # Conflicts: # src/main/native-chat/agent-session-journal/journal-legacy-import.ts # src/main/runtime/orca-runtime-structured-agent-session-create-intent.test.ts # src/main/runtime/session-tabs/structured-session-create-support.ts # src/main/runtime/structured-agent-session-create-adoption.ts
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9b9687ac-9e73-4933-b498-274c419ff959
📒 Files selected for processing: 42
src/main/ai-vault/session-scanner-discovery-wsl-gate.test.tssrc/main/ai-vault/session-scanner-discovery.tssrc/main/claude/claude-cli-conversations.tssrc/main/codex/codex-ai-vault-session-resume.tssrc/main/codex/codex-cli-conversations.tssrc/main/grok/grok-transcript-import.tssrc/main/native-chat/agent-session-journal/adopted-transcript-source.tssrc/main/native-chat/agent-session-journal/journal-legacy-import.tssrc/main/native-chat/agent-session-journal/journal-newest-item-window.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adopted-import.tssrc/main/native-chat/agent-session-wire/structured-agent-session-attach.tssrc/main/native-chat/codex-adoption-preparation.tssrc/main/native-chat/session-file-resolver.tssrc/main/native-chat/structured-agent-cli-conversation-adoption.test.tssrc/main/native-chat/structured-agent-cli-conversations.tssrc/main/native-chat/structured-agent-cli-source.tssrc/main/native-chat/structured-agent-session-source-admission.test.tssrc/main/native-chat/transcript-opencode-sqlite-query.test.tssrc/main/native-chat/transcript-opencode-sqlite-query.tssrc/main/native-chat/transcript-opencode2-sqlite.test.tssrc/main/native-chat/transcript-opencode2-sqlite.tssrc/main/native-chat/transcript-path-admission.tssrc/main/omp/omp-session-cwd-lookup.tssrc/main/omp/omp-transcript-import.tssrc/main/opencode/opencode-transcript-import.tssrc/main/pi/pi-transcript-import.tssrc/main/runtime/orca-runtime-structured-agent-session-create-intent.test.tssrc/main/runtime/rpc/core.tssrc/main/runtime/rpc/dispatcher-stream-options.tssrc/main/runtime/rpc/methods/structured-agent-session-adoption-replay.test.tssrc/main/runtime/rpc/methods/structured-agent-session-create-handler.tssrc/main/runtime/rpc/methods/structured-agent-session-create.tssrc/main/runtime/rpc/methods/structured-agent-session.test.tssrc/main/runtime/session-tabs/structured-session-create-support.tssrc/main/runtime/structured-agent-session-create-adoption.tssrc/main/startup/main-process-runtime-service.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/structured-agent-session-params.tssrc/shared/structured-agent-session-create.test.tssrc/shared/structured-agent-session-create.tssrc/shared/structured-agent-session-mutation.tssrc/shared/structured-agent-session-surface-capabilities.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.
…ry walks A PI_CODING_AGENT_DIR that already ends in sessions, or any custom folder, made admission expect <dir>/sessions while the lookup searched <dir>, so a found conversation was refused.
… per account Each agent's import described where an account keeps its conversations twice, once for the path check and once for the lookup, and the two could disagree (the linked-folder and Pi custom-root refusals). The import now names one conversation store per account; the create path resolves it once and both the hook-path check and the fallback lookup judge that same store. OpenCode's store is its exact database.

























ELI5
Resuming a saved CLI conversation could fail when its terminal reported a filename different from the conversation ID, another configured account was inaccessible, or Codex history was prepared somewhere other than the new chat's execution home. Closing or replacing the source terminal during preparation could also invalidate a resume that had already reached the host.
The host now admits the saved conversation during chat creation and keeps the original source evidence for that request. A dispatched resume can finish after its source terminal closes, using the original conversation and account. A source already invalid when the host receives the request is refused.
What Changed
agent-session.structured.cli-source.v1. The host derives the path from its own provider status, checks recognized account containment, and validates provider identity and recorded directory during the existing import. Clients supply no paths or credentials. This PR adds host admission; the sender and visible destination publication belong to Resume terminal conversations in native chat without waiting for History #29150.Corrected #29119 was integrated with a normal merge for ownership/replay and missing/empty/unreadable behavior. No new saved fields, source store, discovery service, parser or wire operation is added. Existing ID-only callers remain compatible; the dependent sender must negotiate the optional capability.
Why
The command already names one conversation. The common pattern keeps the conversation identity with the execution host and carries resolved facts through preparation and launch. Reusing create, the existing account resolver and import stream keeps consequential checks together without adding another discovery phase. Request-owned evidence also lets pane teardown proceed normally.
Linked Issue
Part B of the resume-action stack, based on #29119 and consumed by #29150. The stack replaces the approach in #28284. No issue or other PR is closed automatically.
Visual Proof
Rendered QA covered by #29150 integrated QA, pending the refreshed stack.
Testing
Existing import tests cover host path/account containment, provider directory/identity, first-account success despite a later inaccessible account, relevant access failure, zero-byte versus malformed content, and actual Codex materialization with different History and execution homes.
The real-runtime/RPC replay fixture uses an explicit routing gate to close a source after unary dispatch and mutate its nested identity/path after streaming-unary dispatch. It requires the original imported text/account and one acquisition. Before-dispatch absent/replaced evidence remains refused even if live rows return; absent/error evidence cannot override existing-owner or exact replay answers. Deleted-file, account-drift and caller/operation isolation controls remain.
Final head
a836a6c77b1b81db7af7120d0afd466576735304: full PR workflow 38745721909, attempt 1, passed, including the actual PR checks passed aggregate, static analysis/typecheck, all five unit shards, both packages, relay integration, cross-version wire and unit-selection evidence. The final-head log explicitly records both runtime/RPC regression cases and all 59 existing routing tests passing. Supporting macOS/Linux/Windows runtime and transcript-reader contracts, Mobile verify and the test-size gate also passed. Earlier lint and obsolete exact mock-shape failures were corrected; no local pnpm, install, test, lint, typecheck, build or app launch was run. No standalone rendered or live-provider pass is claimed.Review
Independent review confirmed the account-order, empty-source, Codex-home and source-close findings. Their corrections followed fresh bounded technical rulings. Independent final source verification and the narrow static-correction check accepted production head
8cd662b72e6, with no new proven behavioral finding. The subsequent test-only correction updates three existing routing matchers for the approved host-only argument; it changes no production behavior. Full CI passed on that final head. This description makes no merge-readiness or rendered-QA claim.Agent skill upstream boundary
Notes
Intended product requirement: Orca imports external transcripts into its journal and supports several account homes, so canonical file admission and provider-specific validation remain necessary. Folder workspaces and typed OpenCode accounts remain supported. CLI adoption remains local; SSH/WSL sources are refused. No changed credential default or platform/remote support is introduced.
Existing fallback traversal can still be slow. Canonical admission and the later file read can still race with filesystem changes; no bounded reproduction established a new defect, and this PR makes no latency or filesystem-atomicity guarantee. These existing concerns are deferred.
Temporary stack dependency: #29150 owns the renderer sender, deferred visible destination and integrated QA. B alone does not claim removal of the action's History wait or the completed no-destination refusal result.
Author: @BrennanKB5.
Checklist