Skip to content

Say when a turn is running on the computer that holds a chat - #2375

Merged
santoshkumarradha merged 3 commits into
app/v3from
feat/working-elsewhere
Nov 5, 2026
Merged

santoshkumarradha merged 3 commits into
app/v3from
feat/working-elsewhere

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

A chat's running status only meant that another computer held the chat open. Nothing said whether a turn was actually running there, so home said held on <device> either way and the desktop app couldn't tell "open there" from "working there". Now the holder says so in its beat.

What changes

  • The beat (internal/cellsync): the seal watch's turn start and end reach the batcher through the sync drive (SealWatch.OnTurnStart/OnTurnEnd → liveDrive.Working → Batcher.Working). The batcher beats as soon as the state changes. A tick skips its beat only when the directory already has the current flag.
  • The wire (internal/directory, internal/clusterstate): Beat.Working, sent only to a relay that answers Codeaf-Working-Beats: 1, because older relays decode strictly. Lease.Working is kept through publishes (a turn publishes as it goes) and cleared by an acquire or a release.
  • Both relays keep the flag and advertise the header: the Go relay (handler.go, rules.go) and the hosted relay (relay/hosted/src/rules.js, identity.js). Every member of a relay cluster must run a build that keeps the flag before any member advertises it.
  • Rows: chatlist.Row.Working (running rows only), app ChatRow.working, and hello advertises chats.working. Home says working on <device>.
  • PROTOCOL.md, the manual page (continuing-a-chat-on-another-computer.md) and a change entry say the same.

It is display only: agents.take does not consult it.

Tests

  • New: TestBatcherBeatsWhenATurnStartsOrEnds, TestLeaseKeepsWorkingUntilTheNextBeatReleaseOrAcquire, TestHTTPBeatWorkingOnlyWhereAdvertised, and a working on case in TestStatusLineCopy. Hosted: a lease test checking that a beat which flips the flag is a change even while a socket vouches for the hold, that a publish keeps the flag, and that a release clears it.
  • go test for clusterstate, directory, chatlist, appwire and cellsync passes, and the manual gate passes. The hosted relay's npm test ran 253 of 253. cellstore fails 3 furrow-build tests identically on the base.
  • The desktop side is https://github.com/Agent-Field/codeaf-desk/pull/196.

🤖 Generated with Claude Code

santoshkumarradha and others added 3 commits November 5, 2026 00:35
A chat row's `running` status only meant another computer held the chat
open. Now the holder tells the relay whether a turn is running there:

- The seal watch's turn start and end reach the sync drive. The batcher
  beats as soon as the state changes, and its tick skips a beat only when
  the directory already has the current flag.
- A beat carries `working` only to a relay that answers
  Codeaf-Working-Beats: 1. The lease keeps it through publishes, and an
  acquire or a release clears it. The Go relay and the hosted relay both
  keep it and advertise it.
- Chat rows carry `working` (hello: chats.working), and home says
  "working on <device>" while a turn runs there.

PROTOCOL.md, the manual page and a change entry say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Another computer reads "not working" as "take it now", and a take that
names the save point before the turn's own publish is refused as
superseded. Found live: Bring here when it finishes failed with
"another device continued this chat first".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@santoshkumarradha
santoshkumarradha merged commit 8200ddb into app/v3 Nov 5, 2026
1 check was pending
@santoshkumarradha
santoshkumarradha deleted the feat/working-elsewhere branch November 5, 2026 16:18
santoshkumarradha added a commit that referenced this pull request Nov 5, 2026
…t's relay cell (#2422)

* Revert "manual: the desktop composer's destination chip (#2420)"

This reverts commit 046003e.

* Revert "chat: message a chat working on another computer; it waits in the queue there (#2408)"

This reverts commit ba629a3.

* Revert "Say when a turn is running on the computer that holds a chat (#2375)"

This reverts commit 8200ddb.
santoshkumarradha added a commit that referenced this pull request Nov 5, 2026
…at, destination chip (#2425)

* Revert "Revert #2420, #2408 and #2375: a second computer writes to a held chat's relay cell (#2422)"

This reverts commit 9316d94.

* chats: guard the note goroutines and count only other computers' writes on a held cell

The re-land of #2375, #2408 and #2420 after #2422. Both note goroutines now run
through guard.Go, and the held-chat drive test no longer counts the holder's own
heartbeat (cellsync's socketMoved renewal when the second window re-dials the
watch socket) as another computer writing to its cell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* changes: entry for the re-land (#2425)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants