Skip to content

feat: remember workspace model and mode on send - #3968

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/workspace-remember-model-mode
Sep 7, 2026
Merged

feat: remember workspace model and mode on send#3968
ibetitsmike merged 4 commits into
mainfrom
mike/workspace-remember-model-mode

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Remember each workspace's model and mode when the user sends a message, using the existing send-time persistence. Picker changes stay local. Synthetic turns and stream resumes do not replace the saved selection.

Fresh or reloaded browser clients snapshot the last submitted choices for every main workspace. A running client does not apply later backend AI settings, including for workspaces opened later in that client; reload to restore newer choices from another client. This deliberately excludes live synchronization so delayed send echoes cannot overwrite unsent choices. ACP load/resume in the same running adapter preserves its active unsent mode, model, and thinking settings; a fresh adapter restores persisted settings. ACP keeps one active draft; switching to another mode restores that mode's saved settings, without retaining a history of unsent per-mode drafts.

Removed picker-time writes, pending guards, rollback/serialization machinery, and the unrelated descriptor expansion from the previous implementation. Rebased onto current main, preserving its newer preference-hydration coverage.

CI fixes also seed the restored Goal tab in the split-sidebar E2E fixture and move the QuickJS-backed code-execution tests into the existing isolated-process group. The isolation group retains its existing signal-crash retry behavior; no production runtime changes.

Validation

  • make static-check passed using pinned Bun 1.3.5.
  • 647 affected workspace-service, browser, thinking, and ACP tests passed.
  • Split-sidebar E2E reproduced the CI count mismatch, then passed three consecutive runs with the corrected fixture and expectation.
  • Updated the wake-admission race test to pause at pricing admission instead of synthetic settings persistence, which this PR intentionally removes.
  • Red-green coverage for initial restoration, preserving open-composer choices, synthetic/resume exclusions, malformed model choices, and ACP prompt settings.

Review scope

Deferred lazy hydration on workspace navigation (PRRT_kwDOPxxmWM6gBcoj): this PR intentionally restores a client-load snapshot instead of tracking composer mounts or per-workspace dirty state.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: dfbedb12c4

ℹ️ 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 src/browser/contexts/AgentContext.tsx Outdated
Comment thread src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
ibetitsmike added a commit that referenced this pull request Aug 25, 2026
Codex review feedback on #3968:
- AgentContext rolls the optimistic local mode switch back when the
  backend write fails (unless the user re-switched meanwhile), so a
  client cannot silently diverge from the backend-authoritative agent.
- ProposePlan handlers clear the pending agent guard when the follow-up
  send fails (failed Result or throw); a stuck guard would block all
  backend agent seeds for the workspace.

---

_Generated with `xum` • Model: `anthropic:claude-fable-5` • Thinking: `xhigh`_

<!-- xum-attribution: model=anthropic:claude-fable-5 thinking=xhigh -->
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: 4103151aff

ℹ️ 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 src/browser/utils/workspaceAiSettingsSync.ts Outdated
Comment thread src/browser/contexts/WorkspaceContext.tsx Outdated
Comment thread src/node/services/workspaceService.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: bf11f76b9d

ℹ️ 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 src/node/services/workspaceService.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: cd2228a734

ℹ️ 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 src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
Comment thread src/node/services/workspaceService.ts
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: badc083c61

ℹ️ 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 src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
Comment thread src/node/services/workspaceService.ts Outdated
Comment thread src/browser/contexts/AgentContext.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: 2d9d468281

ℹ️ 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 src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
Comment thread src/browser/contexts/WorkspaceContext.tsx Outdated
Comment thread src/browser/contexts/AgentContext.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: c53bc5bc8a

ℹ️ 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 src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
Comment thread src/node/services/workspaceService.ts Outdated
Comment thread src/node/acp/configOptions.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: 9793b2969b

ℹ️ 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 src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: 9f54ba0f67

ℹ️ 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 src/browser/contexts/AgentContext.tsx Outdated
Comment thread src/browser/features/Tools/ProposePlanToolCall.tsx Outdated
@ibetitsmike ibetitsmike changed the title 🤖 feat: remember last used model and mode per workspace across clients feat: remember workspace model and mode on send Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: 96209923fe

ℹ️ 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 src/browser/contexts/WorkspaceContext.tsx Outdated
Comment thread src/node/acp/configOptions.ts Outdated
Comment thread src/browser/utils/workspaceModeAi.ts Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

Please review the reduced send-only implementation at 866d4c7, now reconciled with current main.

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

Copy link
Copy Markdown

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: 866d4c7d41

ℹ️ 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 src/node/acp/configOptions.ts
@chatgpt-codex-connector

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

@codex review

Please review the narrowed send-only contract documented in the description. Initial-load restoration only, no live synchronization or per-agent unsent draft history. Latest head is c841243.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: c841243f07

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

@chatgpt-codex-connector

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

The reduced implementation has a clean Codex code/security verdict on c841243, zero unresolved review threads, passing local static checks, and 590 passing affected tests. The full CI unit job crashed inside Bun 1.3.5 twice (exit 132, native segmentation fault, no failing test assertions); the retry reached a different test before the same native crash. The first crash-site suite passes locally with coverage. I am leaving this runtime/CI blocker separate rather than expanding the persistence PR with unrelated runtime workarounds.

@ibetitsmike
ibetitsmike force-pushed the mike/workspace-remember-model-mode branch from c841243 to a3f7ad8 Compare September 7, 2026 20:28
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Rebased the simplified send-only persistence change onto current main. The new wake-admission regression test now pauses at pricing admission because synthetic turns intentionally do not persist settings. Local static checks and all 631 affected tests pass. Please review current head a3f7ad8.

@chatgpt-codex-connector

This comment has been minimized.

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

Copy link
Copy Markdown

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: a3f7ad8ef1

ℹ️ 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 src/browser/contexts/WorkspaceContext.tsx Outdated
Comment thread src/node/acp/agent.ts
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

Review responses:

  • PRRT_kwDOPxxmWM6gBcoj, hydration on later navigation: intentionally not added. This reduced PR restores all main-workspace choices on initial browser-client load, not on each composer mount. A running client does not live-apply later backend settings, even for a workspace opened later. Reload picks up the last submitted choices. The description and guard comment now state that boundary explicitly; tracking mounts or dirty state would reintroduce the synchronization machinery removed by this simplification.
  • PRRT_kwDOPxxmWM6gBcol, ACP load/resume: fixed locally by retaining the existing mode and AI settings as one active session draft and returning those settings in config options. Both load and resume tests reproduced the old model/thinking being sent before the fix, and pass with it. Fresh adapters still restore persisted settings.

All 647 affected tests pass. The rebased head also completed all required CI, including Test / Unit. The broad local coverage run did not reproduce the native Bun crash, but exposed separate browser test failures being checked in isolation. No CI runtime workaround was added.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

The ACP load/resume fix now preserves the active draft and returns matching config options. Both paths reproduced the wrong prompt model/thinking before the fix and pass afterward; all 647 affected tests and local static checks pass.

Please review the explicit client-load snapshot contract in the updated description. Per-navigation hydration and live browser settings synchronization are intentionally out of scope for this reduced implementation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 5ab27cbbed

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

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Only two CI/test fixes since the clean code/security review:

  • The split-sidebar fixture includes Goal up front and expects four tabs after Instructions migration. This reproduced the CI expected-3/received-4 failure locally, then passed three consecutive Electron runs.
  • The QuickJS-backed code_execution suite now uses the existing isolated-process group and its existing signal-crash retries. A native Bun crash was reproduced locally; the exact updated isolated CI phase passes all 522 tests.

Local static checks and actionlint also pass. No additional production changes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 67074a7a0b

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

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 10f6e48 Sep 7, 2026
19 of 20 checks passed
@ibetitsmike
ibetitsmike deleted the mike/workspace-remember-model-mode branch September 7, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant