Skip to content

Conversation

@leeroybrun
Copy link
Contributor

This PR fixes a subtle permission-mode mismatch in the New Session flow and makes local permission-mode persistence more robust.

  • Fix /new permission-mode UI for Codex/Gemini: AgentInput now falls back to the explicitly selected agentType when metadata.flavor is missing (common in /new before a session exists). This ensures the correct permission-mode menu/options are shown and applied for the selected agent.

    • File: sources/components/AgentInput.tsx
  • Harden local per-session permission-mode persistence: permission modes are stored per sessionId in MMKV under session-permission-modes. This PR avoids a bug where an in-memory 'default' could “win” over a persisted non-default mode during session merges, and updates persistence incrementally so modes for sessions that aren’t currently loaded don’t get accidentally dropped.

    • File: sources/sync/storage.ts

Testing

  • Manually tested on web: create a new session via /new, switch agents (Codex/Gemini/Claude), select a non-default permission mode, send first message, and confirm the created session shows the expected mode.

…persistence

- Use `agentType` as fallback when `metadata.flavor` is missing in `AgentInput` (fixes `/new`).
- Make `storage.applySessions()` prefer persisted/non-default permission modes over `'default'`.
- Persist permission modes incrementally per `sessionId` under `session-permission-modes`.
@leeroybrun leeroybrun changed the title Fix /new permission-mode selection + harden per-session permission-mode persistence fix: /new permission-mode selection + harden per-session permission-mode persistence Dec 30, 2025
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