Fix ACP-created Zed threads missing from Codex desktop history#188
Open
qqmikey wants to merge 2 commits intozed-industries:mainfrom
Open
Fix ACP-created Zed threads missing from Codex desktop history#188qqmikey wants to merge 2 commits intozed-industries:mainfrom
qqmikey wants to merge 2 commits intozed-industries:mainfrom
Conversation
- mark ACP-created sessions as CLI threads instead of unknown\n- persist only plain user text to cross-session history\n- exclude slash commands and embedded resources from persistent history
- persist slash-backed user prompts that still submit normal user input\n- preserve ResourceLink prompts in cross-session history\n- add regression coverage for replayable and non-replayable prompt blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionSource::Cliinstead ofUnknownso Codex classifies new Zed-launched sessions as interactive threadsProblem
Threads created from Zed through
codex-acpwere persisted locally, but they were not registered with the same metadata and history semantics as direct Codex sessions. As a result, the transcripts existed on disk, but the Codex desktop app could not reliably discover them in the thread list/history flow.In the failing path:
SessionSource::UnknownThat combination left ACP-created threads present in rollout/session storage while still being effectively invisible in the desktop history experience.
Root Cause
Codex core currently treats only known interactive sources as part of the normal interactive discovery flow. Initializing ACP sessions as
Unknownmeant they were not classified the same way as direct Codex sessions.Separately, ACP prompt submission was missing the
Op::AddToHistorystep that direct Codex UI uses to persist user drafts/prompts into cross-session history after submission.During implementation, there was also a follow-up correctness concern: writing the entire ACP prompt payload to persistent history would have leaked embedded resource contents and slash commands into global history. This patch now narrows history persistence to plain user-entered text from standard prompts only.
Implementation
Session classification
SessionSource::CliThere is no dedicated
SessionSource::Zedin core today.Cliis the least misleading currently-supported interactive source that preserves discoverability without pretending ACP is VS Code-specific.Persistent history registration
Op::AddToHistoryafter standard non-slash ACP prompt submissionContentBlock::Text/compact,/undo,/review, and custom slash prompts~/.codex/history.jsonlBehavior After This Change
codex-acpare no longer recorded assource = "unknown"Test Plan
cargo fmt --checkcargo testcargo build --releasecodex-acp, send a prompt, and confirm the thread appears in the Codex desktop app historyNotes
UnknownSessionSource::Zed, ACP should switch to that source instead of continuing to use the CLI fallback