Skip to content

Conversation

@jjjrmy
Copy link
Contributor

@jjjrmy jjjrmy commented Jan 25, 2026

Summary

  • Add "Default Mode" setting in Preferences to choose between Plan and Agent mode for new chats
  • Fix mode bleeding across chats - mode now persists per-subChat instead of globally
  • Refactor from isPlanMode: boolean to AgentMode type for future extensibility

Changes

New Feature: Default Mode Preference

  • Added dropdown in Settings → Preferences to set default mode ("Agent" or "Plan")
  • New chats now respect the user's default mode preference
  • Works for both new workspaces and new sub-chats within existing workspaces

Per-Chat Mode Isolation

  • Mode is now tracked per-subChat using subChatModeAtomFamily
  • Switching mode in one chat no longer affects other chats
  • Mode persists to localStorage and database

Code Quality Improvements

  • Replaced isPlanMode: boolean with AgentMode type ("agent" | "plan")
  • Added AGENT_MODES array and getNextMode() utility for clean mode cycling
  • Removed deprecated isPlanModeAtom global atom
  • Removed backwards compatibility wrappers (isPlanMode, setIsPlanMode)
  • Fixed duplicate store file (lib/stores/sub-chat-store.ts)

Props Updated (boolean → AgentMode)

Component Change
AgentsSlashCommand isPlanMode?: booleanmode?: AgentMode
AgentSendButton isPlanMode?: booleanmode?: AgentMode
DetailsSidebar isPlanMode: booleanmode: AgentMode
PlanWidget isPlanMode?: booleanmode?: AgentMode
AgentPlanSidebar Added mode?: AgentMode prop

Future Extensibility

Adding a new mode (e.g., "debug") now only requires:

export type AgentMode = "agent" | "plan" | "debug"
export const AGENT_MODES: AgentMode[] = ["agent", "plan", "debug"]

Test Plan

  • Create new workspace → should use default mode from Settings
  • Create new sub-chat within existing workspace → should use default mode
  • Change default mode in Settings → new chats should use new default
  • Toggle mode in existing chat → should NOT affect other chats
  • Refresh app → mode should persist per-subChat
  • Sidebar icons should update immediately when mode changes
  • /plan and /agent commands work correctly
  • Shift+Tab mode toggle cycles through modes

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.

2 participants