Repository navigation
feat(agent): resume previous conversations - #414
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d654ecff0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let command = if resume { | ||
| CodexCommand::ResumeSession { | ||
| cwd, | ||
| session_id: session_id.clone(), | ||
| } |
There was a problem hiding this comment.
Reject browser sessions with incompatible tool contracts
When a legacy Red session is selected, resume routes it directly to ResumeSession without the tool-contract compatibility check used by AgentResumeSession immediately above. The picker deliberately discovers legacy Red rollouts, whose snapshots default to contract version 0, and Codex cannot replace a persisted thread's dynamic-tool catalog on resume; consequently these sessions can run with stale tool schemas instead of remaining transcript-only and starting a compatible thread. Determine compatibility from the persisted metadata or continue such sessions in a fresh thread rather than resuming them directly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Prepared in local commit 7b089e1: direct resume now requires a known matching tool-contract version. Unknown or obsolete catalogs continue user/assistant history in a fresh Red thread with the current editor tools. Added coverage for missing, legacy, and matching versions. The full library suite passes (2739 tests), and all-targets/all-features clippy passes. Publication is currently blocked by PushPatrol and requires a manual push; leaving this thread open until the commit is visible on the PR.
| fn session_browser_query_changed(query: String) { | ||
| if !state().session_browser_open || query == state().session_browser_query { return; } | ||
| red::state_patch(AgentState { session_browser_query: query }); | ||
| let previous = red::string(state().session_browser_debounce, ""); | ||
| if previous != "" { red::execute("CancelTimeout", previous); } | ||
| let timer = red::execute("SetTimeout", 150); | ||
| red::state_patch(AgentState { session_browser_debounce: timer }); |
There was a problem hiding this comment.
Clear stale session rows while search is pending
After the query changes, the old result blocks and session_browser_results remain active until the 150 ms debounce and server request complete. During that interval, pressing Enter emits activate_block for the still-selected old row rather than filter_submit, so typing a query and immediately confirming can switch to a session that does not match the entered query. Clear or disable the existing action rows when scheduling the search, or reject activation unless the current query equals session_browser_results_query.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Prepared in local commit 7b089e1: session activation is rejected while the query differs from the query that produced the displayed results. Query changes also invalidate the outstanding request so a late response cannot be relabeled as current. Extended the bundled picker regression test to type a new query and immediately activate an old row. The full library suite passes (2739 tests), and all-targets/all-features clippy passes. Publication is currently blocked by PushPatrol and requires a manual push; leaving this thread open until the commit is visible on the PR.
Red persists Agent conversations, but there is no in-pane way to find and reopen them. Starting a new conversation should not make earlier Red or Codex work difficult to recover, and browsing history should not discard the current transcript position or unsent draft.
This change:
Alt-s, and:AgentSessionsHow to Test
Alt-s. Search the list, useAlt-sto cycle Red, This workspace, and All Codex, move with arrows orCtrl-j/Ctrl-k, and toggle the latest-exchange preview withAlt-p.Esc. The original conversation, transcript position, focus, and unsent draft should be restored exactly.Enteron a previous Red session. Its transcript and any surviving annotations should be restored in the same pane.Focused automated validation:
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features --lib session(75 passed)cargo test --all-features --test codex_app_server direct_app_server_lists_searches_and_continues_sessions_for_redcargo test --all-features --lib annotation(27 passed)