Skip to content

Respect resume cwd overrides for idle cached threads#24528

Merged
etraut-openai merged 3 commits into
mainfrom
etraut/fix-resume-cwd-overrides
May 26, 2026
Merged

Respect resume cwd overrides for idle cached threads#24528
etraut-openai merged 3 commits into
mainfrom
etraut/fix-resume-cwd-overrides

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

Fixes #24186.

Why

When the TUI resumes a thread through the local app-server daemon with a selected workspace, thread/resume can hit an already-loaded but idle cached thread. That path previously rejoined the cached CodexThread, so cwd/config overrides in ThreadResumeParams were ignored and the resumed session kept using the old cwd.

What changed

App-server now treats a loaded-but-idle thread with no subscribers as a cache entry when resume overrides differ: it unloads that cached thread and lets the normal resume path rebuild it with the requested cwd/config. Threads that still have subscribers, or active runtime work, continue to rejoin the existing loaded thread so in-flight state remains observable.

The existing thread teardown helper was generalized from archive-specific cleanup to shared unload cleanup for this path.

@etraut-openai etraut-openai marked this pull request as ready for review May 26, 2026 04:42
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f24a0de688

ℹ️ 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".

Comment thread codex-rs/app-server/src/request_processors/thread_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/thread_processor.rs Outdated
Comment thread codex-rs/app-server/src/request_processors/thread_processor.rs
@etraut-openai etraut-openai force-pushed the etraut/fix-resume-cwd-overrides branch from f24a0de to 7982f7f Compare May 26, 2026 04:58
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7982f7fb4f

ℹ️ 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".

Comment thread codex-rs/app-server/src/request_processors/thread_processor.rs
@etraut-openai etraut-openai merged commit 5cd9b80 into main May 26, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/fix-resume-cwd-overrides branch May 26, 2026 20:50
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resuming a session from a different cwd with a separate app-server ignores the selected cwd

2 participants