Files
archived-orca/src
Brennan Benson ef32c76c31 Chats follow an account switch for worker results too (#37126)
* Read the Claude account route off the main thread for chat reads and sends

Chat option reads, model-list reads and every send resolved the selected
Claude account through the router's synchronous state-file read. Route them
through an async twin that shares the same login cache. A relaunch for a
removed account no longer prepares (and recreates) its folder.

* Chats follow an account switch for worker results too

A coordinator chat that had started any worker kept answering every
message on the account it used before a switch, until every worker it
started finished and every result was read. Every new turn, including a
worker's result, now launches on the selected account. A reply already
running finishes where it started, and a chat whose own background work
is still running keeps its process until that work ends.

This removes the per-account result tracking that held the old account
(the parent-work query, the response index and its queued and
usage-limit carve-outs, the input account recipe on the startup attempt,
and the read-only journal restore that only fed it), plus the journal
index and change-feed fields only it read. A relaunch can no longer
prepare, and so recreate, a removed account's folder. The record still
saves the account each launch actually ran on, for Session History.

* Chats reading the Claude account at the same time share one read of its state file

* Test worker results after an account switch through the real account choice, next to a user's message

* Pass the mailbox pointer's sender snapshot in the account-switch worker test

* Import worker custody helpers once in the process listing, and build the expected homes without a shared object
2026-11-01 16:38:10 -08:00
..