fix(desktop): the renderer's act channel no longer crosses answers between concurrent acts

Merged
DA
11d ago
+100-19

The bug

renderer/act.ts sent every act through one shared Atom.fn, and the atom's promise mode answers every pending caller with the atom's newest result. Two acts out at once crossed answers: the earlier caller received the later act's value ("Invalid answer to the act …" once a kind's guard noticed, or a wrong-shaped value where it did not). The coding-agents branch found this because an agent's transcript read is held open for 20 s, which made the crossing certain; main has the same bug for any two acts in flight.

The fix

Ported verbatim from #1872 (squash commit 9e64d41d): each call is its own promise on window.sidecar.act, and useAct no longer goes through useAtomSet. act.ts is byte-identical to the branch's, so the branch's later merge into main takes it without conflict.

The test

use-act.test.ts is the branch's test with the act kinds main has: microphone.request and microphone.route out at once, the later answered first, each heard by its own caller. Fails on main without the fix (the status act received the route's answer), passes with it. The second case holds the refused and invalid-answer rejections.

Out of scope: everything else in #1872.

Checks

  • ./scripts/check.sh exits 0.
  • Renderer change; CI could not verify it on a Mac. Dean waived ./scripts/verify.sh for this port.

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Devin Review