fix(watch): give sessions the hooks their status depends on - #34
Merged
Conversation
The daemon bakes its own socket into every hook command line precisely so a report cannot be misdirected by the environment it inherits: a hook runs with the session's, which belongs to whichever shell started that session. The flag was parsed into HookOpts and then never read, so every report went to whatever watch_paths.socket derived from that environment instead. Those two agree on a default install, which is why it survived. A daemon under LCC_WATCH_DIR received nothing, silently, and its sessions sat at the status they registered with for as long as they ran.
writeHookSettings wrote hooks.json at startup and nothing ever handed it to `claude --settings`, so no session lcc launched carried a single lcc hook. Every unit passed and the registry looked healthy. Sessions reached idle on their first byte of output — which only means the exec worked — and stayed there through hours of work, because nothing was left that could report anything else. The flag goes on in the daemon rather than in a client. There are two register paths, `lcc start --watch` and the dashboard's enter, and a flag added to one and forgotten in the other is exactly how the hooks came to be written but never installed. /bin/cat can no longer stand in for claude in the tests: launched the way a real session now is, it exits with "illegal option" before a test can type into it. The stand-in is a script in the test's own tmpdir that ignores what it is handed, which is what a stand-in for a program with flags has to do.
A main agent that hands work to subagents ends its own turn, so Stop fires and the row reads idle — "finished, come back whenever" — while a dynamic workflow grinds away underneath it. The one question this dashboard exists to answer is where the work is, and idle was the wrong answer to it. active rather than waiting, because yellow has to go on meaning that a person is blocking the session. Subagents block on nobody, and one colour covering two states that call for opposite responses is a colour that means neither.
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.
hooks.jsonand never handed it toclaude --settings, the hook handler ignored the--socketbaked into its own command line, and a session whose subagents were doing the work still reportedidle. Nothing lcc launched had ever reported its own status —lcc openshowed whatever the first byte of pty output left behind, for as long as the session ran.starting → active → idle → exited, and a spawned subagent puts it back toactive.SubagentStartmaps toactiverather thanwaitingon purpose — yellow has to go on meaning that a person is blocking the session, and subagents block on nobody.chore/hide-daemon-concept(refactor(cli): talk about sessions, not the daemon behind them #33), notmaster: the comments here use thelcc open --stop-allvocabulary that PR introduces./bin/catalso stops working as a test stand-in once sessions are launched with real flags — it exits on the unknown option — so the daemon tests write a script stand-in into their own tmpdir.