Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 6, 2025

Thinking level is stored per workspace again, with project seeding for new workspaces.

  • Workspace/project/global scope for thinking level (key: thinkingLevel:{scopeId})
  • Toggle (Ctrl+Shift+T) cycles allowed levels; no extra lastActiveThinking state
  • Command palette thinking helpers use workspace store/persisted helpers (no direct localStorage map)
  • When creating a workspace, its project's last thinking level seeds the new workspace

Tests: make static-check

Generated with mux

Copy link

@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.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 79 to 80
window.addEventListener("storage", handleStorage);
return () => window.removeEventListener("storage", handleStorage);

Choose a reason for hiding this comment

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

P1 Badge Thinking context ignores same‑tab palette updates

The new ThinkingProvider only subscribes to the native storage event, but updatePersistedState (used by the command palette’s onSetThinkingLevel) emits a custom storage event and does not trigger storage in the same tab. As a result, changing thinking level from the palette updates localStorage but never updates the context state, so UI controls and useSendMessageOptions keep using the stale level until a model change or reload. Subscribing to the custom event (as the previous usePersistedState implementation did) is needed to keep same-tab changes in sync.

Useful? React with 👍 / 👎.

@ammar-agent ammar-agent force-pushed the thinking-level-per-model branch from b386164 to 51a62e3 Compare December 6, 2025 20:55
Thinking level is now stored per model instead of per workspace:
- When switching models, the thinking level for that model is loaded
- When changing thinking level, it's saved for the current model
- This allows different models to have different thinking preferences

Storage key changes:
- thinkingLevel:{modelName} - main thinking level per model
- lastActiveThinking:{modelName} - for toggle keybind restoration

Removed:
- lastThinkingByModel:{model} (consolidated into main storage)
- Workspace-based thinking level sync during workspace creation

The toggle keybind (Ctrl+Shift+T) still remembers the last active
(non-off) level for quick on/off toggling.
@ammar-agent ammar-agent force-pushed the thinking-level-per-model branch from 4f1d6ca to 0220fe1 Compare December 6, 2025 21:26
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