Skip to content

feat(desktop): add a CodeMode preference #2578

Closed
Closed

Description

@Astro-Han

Problem

CodeMode is available through the Runtime's explicit per-run toolMode, but the standard Desktop product has no user-facing way to select it. Direct remains the only effective product default.

Decision

Add one persisted tool-mode preference to the existing chat defaults settings:

  • auto
  • direct
  • code_mode

auto is the default and currently resolves to direct for every model. direct and code_mode are explicit user overrides.

Resolve the preference once at the product boundary into the existing Runtime ToolMode. Do not add auto to Runtime execution, duplicate the tool surface, or create another CodeMode path.

Scope

  • Add the closed preference type and settings normalization.
  • Add the selector to Settings alongside the existing chat defaults.
  • Propagate the resolved mode when creating a new run.
  • Persist the effective direct or code_mode value in the existing AgentRun record.
  • Show a clear unavailable state if the selected backend cannot execute CodeMode.
  • Preserve older settings files by normalizing a missing value to auto.

Acceptance

  • Existing settings resolve to auto, which currently produces Direct behavior.
  • Selecting Direct never exposes exec.
  • Selecting CodeMode exposes the existing exec path without changing tool authority or settlement.
  • The setting survives restart and applies to new runs.
  • Unsupported backends do not silently ignore an explicit CodeMode selection.
  • No model is automatically enabled by this issue.

Non-goals

  • Choosing model-specific defaults.
  • Adding CodeModeOnly.
  • Changing the CodeMode executor or Runtime tool contract.
  • Adding another tool registry, permission path, or execution mode.

Part of #1383.

Activity

  1. self-assigned this
    on Aug 9, 2026
  2. added
    enhancement
    on Aug 20, 2026
  3. nagarwal-godaddy commented on Aug 25, 2026

    @nagarwal-godaddy

    Picking this up — plan: closed auto|direct|code_mode preference resolved once at the product boundary into existing ToolMode.

  4. Astro-Han commented on Sep 17, 2026

    @Astro-Han
    ContributorAuthor

    Shipped in #5219 (3cfcb09fd): chatDefaults now carries a persisted codeModeEnabled preference (packages/core/src/settings.ts:515) with a selector in General settings, and #5345 applies it per turn. The landed shape is a toggle rather than the three-value auto / direct / code_mode enum proposed here, since auto and direct resolve identically for every model today. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions