Default autopilot mode for new sessions (d key) - #32
Merged
Conversation
…canner, extract helper
…ctions to control server
…ent to TUI subscribers
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #31
~/.csm/config.json) that applies to all newly discovered sessions — pressdto cycle OFF → ON → YOLO(default)label, hints bar, help overlay, first-run tip in empty stateChanges
Daemon
config.go— new Config struct with load/save for~/.csm/config.jsonstate.go—Get/SetDefaultAutopilot(),applyDefaultAutopilot()helper used inRegisterSession+UpdateSessionFromScannerhandler.go—set_default_autopilotandget_configactions; default included in state snapshotsClient
client.go—SetDefaultAutopilot(),GetConfig()methods;StateUpdate.DefaultAutopilotfieldTUI
app.go—dkey binding, status bar[⚙ default: AUTO]/[⚠ default: YOLO]badge, first-run tipzoom.go—⚙ AUTO (default)annotation when session inherits global defaulthints.go—d defaulthint, help overlay documentationTests
Design (from autoresearch UX analysis)
Test plan
go build ./...+go test ./...pass for both daemon and tuid→ verify status bar shows default modeaon a session → verify per-session override takes precedenceconfig.json