plans/default-agent-mode.md
Make local-agent the optimistic automatic baseline across new-chat surfaces
while preserving confirmed availability fallbacks and explicit choices.
| User state | Automatic effective mode |
|---|---|
| Pro | Agent |
| Non-Pro, quota unresolved | Agent |
| Non-Pro, quota available, no provider yet | Agent provisionally |
| Non-Pro, quota available, eligible non-Google provider | Agent |
| Non-Pro, Google-only | Build |
| Non-Pro, quota confirmed exhausted | Build |
| Explicit default set to Build | Build |
Existing chats with a stored mode remain unchanged. Explicitly selecting Agent remains honored with Google-only, subject to the existing confirmed-quota-exhaustion fallback.
freeAgentQuotaAvailable === false triggers the quota fallback. true and
undefined use the optimistic Agent baseline unless the user is Google-only
or explicitly defaulted to Build.selectedChatMode: "build" as current UI state rather than the
authoritative automatic default. At startup, synchronize implicit Build to
the resolved default, while preserving defaultChatMode: "build", not
persisting provisional Agent while provider or quota state is unresolved,
and retaining the current-session latch for manual selections.chatMode: null, using the
existing nullable schema. Keep initialChatMode as an explicit, latched
override.isChatModeExplicit signal through first-prompt creation
so manual choices are stored immediately while automatic choices remain
implicit.initialChatMode contract: present means explicit and
persisted; absent means use the automatic effective default.chat.chatMode as the marker for an implicit,
not-yet-latched mode."agent" → "build" migration, explicit default
settings, free-model compatibility behavior, and manual Agent selection with
Google.npm run fmt, npm run lint, and
npm run ts.