Skip to content

Cut foreground CLI and Zed over to AgentProfile transitions and application settings #2640

Description

@acoliver

Parent: #2635

Objective

Cut the foreground CLI and Zed execution owner over to the transactional profile controller, including startup, /profile, /provider, /model, profile /set, application /settings, blank /setup, UI/session display settings, persistence conflicts, and checkpoint/restore.

This is the user-facing foreground vertical cut. It consumes the sibling schema/repository and controller/runtime foundations and deletes the foreground legacy path it replaces.

Scope

Startup and unconfigured state

  • Compile startup flags into exactly one initial profile command, never Config precedence plus post-activation overrides.
  • No profile/provider means explicit unconfigured state; configuration/list/setup commands work, model execution returns typed profile-required.
  • --provider ... --model ... --key-name ... creates one blank provider-template document with explicit model/auth reference.
  • Standard --profile-load + --model clones/patches the saved standard document directly.
  • LB --profile-load + --model requires qualified --member; no active-member inference exists at startup.
  • Failed initialization publishes no partial Agent.

Commands and UI

Route CLI and Zed through AgentProfile commands/queries/subscriptions only:

  • /model: exact clone semantics, provider-specific immutable menu source, stale-menu handling.
  • /provider: blank reset including same-provider case.
  • /profile load/save/list/status/delete: exact load, qualified result display, etag conflicts, explicit overwrite/save-as, reverse-reference errors, stale identity, redacted requested/effective status.
  • profile /set: profile-owned keys only; application keys return /settings guidance.
  • /settings: independent application settings service with owner/propagation semantics.
  • /setup: always blank; disposable credential/model tests; Cancel no-op; Finish one commit; optional build→persist→memory ordering.
  • destructive replacement of an unsaved draft requires confirmation; headless adapters use discardUnsaved.
  • commands while busy expose queued/busy/cancelled/stale states accurately.

UI/application ownership

  • ui.showReasoning: persisted application default plus UI-session-only toggle/keybinding; streaming/rerender visibility changes without profile/runtime revision and Agent API keeps structured reasoning.
  • emojifilter, dumpcontext, dumponerror: application-owned; visual effects may be immediate while enforcement is captured in turn/tool context.
  • Service-reconfigure/restart-required settings use explicit paths; no generic mutable SettingsService consumption inside turns.
  • Tool declarations/status are derived from current runtime policy without globally mutating tool registry.

Foreground lifecycle and continuity

  • Commit only at execution-coordinator safe boundary.
  • Preserve conversation/history, session ID, message bus, MCP/environment infrastructure, todos, task manager, checkpoints, and session metrics across profile changes.
  • Replace profile-derived provider/model/settings/policy/LB runtime and rebind listeners/tool declarations.
  • OAuth/failover hooks attach to the new runtime; GCP/provider config is threaded explicitly rather than process.env writes/read-back.
  • Checkpoint/restore saves working identity plus explicit document (including draft), verifies saved etag, reconstructs runtime, and never serializes clients/secrets/tokens/LB cursor/runtime IDs.
  • CLI and Zed share the same state path and differ only in interaction/rendering adapter.

Delete foreground legacy path

Remove or make unreachable for the foreground owner:

  • synthetic profile-as-CLI-arguments and post-switch override reapplication;
  • direct applyProfileWithGuards/applyProfileSnapshot activation/snapshot reads;
  • direct provider/model/profile state reads through Config/runtime accessors;
  • foreground profile process.env mutation/read-back;
  • direct profile directory scans or provider mutation from UI/Zed;
  • legacy currentProfile/activeProvider projection writes.

Do not leave old and new writers active for this owner.

Coordination / non-overlap

Acceptance criteria

  • Foreground CLI and Zed use only Agent profile commands/queries/subscriptions; no private profile store or direct provider mutation remains.
  • Startup produces exactly one command and unconfigured behavior is explicit.
  • Every command follows Transactional per-agent profiles: replace ambient provider/model state with declarative runtime ownership #2635 literal semantics, confirmation, stale, conflict, and redaction behavior.
  • Profile changes preserve session/environment continuity while replacing only profile-derived runtime state at a safe boundary.
  • Reasoning display toggle and application setting propagation do not mutate profile state or in-flight policy incorrectly.
  • Checkpoint/restore preserves explicit saved/draft working state without serializing operational resources/secrets.
  • Foreground legacy profile/snapshot/CLI-override/env/projection paths have no production callers for this owner.
  • Focused CLI/Zed/setup/startup/settings/profile/LB/checkpoint tests plus full test/lint/typecheck/format/build and profile smoke verification pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IDE IntegrationVSCode/Zed integration issues etc.configurationllxprt system configurationmodel configurationProfiles and ephemeral settings, things about configuring models.type: task

    Type

    Projects

    Status
    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions