feat(watch): show plan mode as its own session status - #35
Merged
Conversation
`lcc start` launches every session with `--permission-mode plan`, so the dashboard showed the same `active` on both sides of the line that matters: whether the agent has been approved to touch files. A row now reads `plan` until it is. Claude Code reports the mode itself, on `PreToolUse`, `UserPromptSubmit` and `Stop` — three of the six events already registered — so this needs no new hook. Reading `permission_mode` out of the payload does break the rule the module header states, that the matcher does the discrimination and lcc reads no fields; there is no matcher that selects on the mode, so the exception is contained instead: an absent or unrecognised value is a no-op, freezing the last mode reported rather than clearing it. Plan mode is projected at the point a status is reported rather than applied as a transition. It is a mode, not an event — nothing fires when a plan is approved, the next hook simply carries a different mode — so modelling it as a state would put "which mode am I in" inside `apply` and "does this decay" inside `decay`, for something neither of them drives. `waiting` outranks it: the approval prompt at the end of a plan is a permission prompt, and that is the one signal the dashboard exists for.
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.
lcc startlaunches every session in plan mode, soactivewas true on both sides of the only line that matters — whether the agent has been approved to touch files. A row now reads◈ planuntil it is, and the marker going away is the useful half.permission_modeonPreToolUse,UserPromptSubmitandStop. Verified against a real 2.1.223 session rather than inferred —watch_hooks.zig's payload fixture is now a captured payload, andNotification/SubagentStart/SessionEndgenuinely carry no mode, which is why the daemon holds the last one it was told.Review notes
planis projected at the point a status is reported, not applied as a transition — nothing fires when a plan is approved, so a state would put "which mode am I in" insideapplyand "does this decay" insidedecay.watch_status.presentholds the precedence, andwaitingoutranks plan mode: the approval prompt at the end of a plan is a permission prompt.statusgains"plan"as a value; no JSON key was renamed or dropped. A caller switching onactive/idleseesplanfor a planning session, which is the point.lcc openalready flags that asoutdated_build.