Let the driver say it started, so both screens agree
The session list reads the manager's status; the session screen replays the transcript. Correcting a relaunched session's stale `exited` by writing the manager's view directly left those two saying different things about one session -- which showed up as a stop button that turned into a play button a moment after the screen opened, and a status row that disagreed with the row it was opened from. So the correction goes through the event sink instead, from the driver that started the process: `EchoDriver::new` and `LlamaDriver::attached` already announce the state they start in, and `ClaudeDriver` was the one starting a process silently. It says idle only when it started one -- adopting says nothing, since a process that was already running may be mid-turn. Coming from the driver also orders it against the exit `follow` reports for a process that dies immediately, which a status written from the manager could not be. Verified against a stand-in CLI: stop, restart the backend, and the list and the transcript's last status both say idle, with the relaunch recorded. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a4ec8cfbd8
commit
1d843f20f2
3 files changed
+79
-43
No files matched your search
@@ -332,10 +332,24 @@ Three decisions worth not undoing:
|
||||
That last rule found a real bug in the launch path, which is where the phone
|
||||
would have hit it: a relaunched session took its status from the transcript,
|
||||
so one whose process had died before a backend restart reported `Exited`
|
||||
while the launch it had just gone through was starting a new process. The
|
||||
status now says `Idle` when a launch leaves a process running — `Exited`
|
||||
there is not merely stale, it is the word that refuses every command and
|
||||
invites somebody to start a second process against a live conversation.
|
||||
while the launch it had just gone through was starting a new process —
|
||||
`Exited` there is not merely stale, it is the word that refuses every command
|
||||
and invites somebody to start a second process against a live conversation.
|
||||
|
||||
**Who says so matters as much as what is said.** The first fix wrote `Idle`
|
||||
straight into the manager's view, and that produced a second bug on the
|
||||
phone: the session list reads the manager's status and the session screen
|
||||
replays the transcript, so a status written in one and not the other is two
|
||||
screens disagreeing about one session — visible as a stop button that turned
|
||||
into a play button a moment after the screen opened. So the rule is that
|
||||
**a driver announces the state it starts in, through the event sink**, which
|
||||
is what `EchoDriver::new` and `LlamaDriver::attached` already did;
|
||||
`ClaudeDriver` was the one that started a process silently. It says `Idle`
|
||||
only when it *started* one — adopting says nothing, because a process that
|
||||
was already running may be mid-turn and the transcript's last word is the
|
||||
better answer until its output says otherwise. Coming from the driver also
|
||||
orders it against the exit `follow` reports, which a status written from the
|
||||
manager could not be.
|
||||
|
||||
On the phone this is one button in the composer, left of Send, whose mark and
|
||||
colour say what pressing it would do now: an orange pause while a turn is
|
||||
|
||||
Reference in new issue
Block a user