Skip to content

Default autopilot mode for new sessions (d key) - #32

Merged
bearmug merged 20 commits into
mainfrom
feat/default-autopilot
Mar 24, 2026
Merged

Default autopilot mode for new sessions (d key)#32
bearmug merged 20 commits into
mainfrom
feat/default-autopilot

Conversation

@bearmug

@bearmug bearmug commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #31

  • Add configurable default autopilot mode (~/.csm/config.json) that applies to all newly discovered sessions — press d to cycle OFF → ON → YOLO
  • Three-tier precedence: per-session override (autopilot.json) > global default (config.json) > built-in OFF
  • TUI surfaces the default everywhere: status bar badge, zoom panel (default) label, hints bar, help overlay, first-run tip in empty state

Changes

Daemon

  • config.go — new Config struct with load/save for ~/.csm/config.json
  • state.goGet/SetDefaultAutopilot(), applyDefaultAutopilot() helper used in RegisterSession + UpdateSessionFromScanner
  • handler.goset_default_autopilot and get_config actions; default included in state snapshots

Client

  • client.goSetDefaultAutopilot(), GetConfig() methods; StateUpdate.DefaultAutopilot field

TUI

  • app.god key binding, status bar [⚙ default: AUTO] / [⚠ default: YOLO] badge, first-run tip
  • zoom.go⚙ AUTO (default) annotation when session inherits global default
  • hints.god default hint, help overlay documentation

Tests

  • 7 new tests: default applied on register, persisted overrides default, persistence to disk, scanner discovery, get/set round-trip

Design (from autoresearch UX analysis)

  • Hybrid pattern (tmux-style): config file for scriptability + TUI toggle for discoverability
  • Safe by default: no config = OFF, zero surprise on upgrade
  • Invisible upgrade: existing users see no behavior change

Test plan

  • go build ./... + go test ./... pass for both daemon and tui
  • Manual: start TUI → press d → verify status bar shows default mode
  • Manual: start new Claude session → verify it inherits the default
  • Manual: press a on a session → verify per-session override takes precedence
  • Manual: restart daemon → verify default persists from config.json

bearmug added 20 commits March 24, 2026 22:31
Cycles through "" → "on" → "yolo" → "" with appropriate flash feedback
using existing styleAutopilotOn/styleAutopilotWarn styles. Includes TODO
comment for wiring client.SetDefaultAutopilot once Agent B's changes land.
When defaultAutopilot is "on" shows [⚙ default: AUTO] badge (green),
when "yolo" shows [⚠ default: YOLO] badge (yellow). No indicator when
no default is set — status bar stays clean.
When a session's AutopilotMode matches the global defaultAutopilot,
the zoom header badge shows '⚙ AUTO (default)' or '⚠ YOLO (default)'
so users can distinguish daemon-inherited from manually-set modes.
Adds 'd default' hint after 'a autopilot' in the session hints bar
so users discover the default autopilot feature. Not shown for PR view
since PRs don't have a session default concept.
… overlay

Adds 'd  Cycle default autopilot for new sessions' to the Sessions section
of the help overlay, and explanatory text clarifying that defaults apply
only to new sessions and per-session overrides take precedence.
When no sessions exist and no default autopilot is configured, the empty
state shows a subtle italic tip: "Press 'd' to set a default autopilot
mode for all new sessions". Tip disappears once a default is set.
Uses inline text styles (no padding) for flash messages instead of badge
styles to keep status bar flash clean: green bold for AUTO, orange bold
for YOLO, dim for OFF.
All renderZoom calls in test file updated to pass the new defaultAutopilot
string parameter. All tests pass cleanly.
Complete 10-cycle autoresearch log for default autopilot TUI presentation:
Model field, 'd' key binding, status bar indicator, zoom badge annotation,
hints bar, help overlay, empty state tip, flash styling, build/test fixes.
Adds the defaultAutopilot string field to Model for tracking the global
default autopilot mode for new sessions ("", "on", "yolo"). Includes
TODO comment for wiring to StateUpdate.DefaultAutopilot post-merge.
- Remove TODO stubs: stateMsg now reads DefaultAutopilot from daemon
- d key calls client.SetDefaultAutopilot() instead of local-only update
@bearmug
bearmug merged commit 243f567 into main Mar 24, 2026
1 check passed
@bearmug
bearmug deleted the feat/default-autopilot branch March 24, 2026 21:50
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.

Default autopilot mode for newly discovered sessions

1 participant