Skip to content

fix: advertise working app chat turns on other computers - #2432

Merged
santoshkumarradha merged 11 commits into
app/v3from
fix/app-working-beats
Nov 6, 2026
Merged

santoshkumarradha merged 11 commits into
app/v3from
fix/app-working-beats

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

A chat continued through codeaf app could run its first turn before its asynchronous sync drive was ready. The hooks were installed, but liveDrive.Working(true) discarded the state while no drive existed. Other computers saw the holder without seeing the running turn.

agents.take → agents.send
  retain working state during drive startup
  install drive → replay current working state
  finish turn → await capture off the turn goroutine → publish → clear working

A generation check prevents an older capture from clearing a newer turn. All heartbeat paths retain working while the final turn is pending. Directory capability learning ignores open pairing routes: /v1/link/limits has no directory headers and previously disabled working beats for the shared service address.

Evidence

  • Before: the app-door regression timed out observing working: true; trace showed Working(true) with no ready drive. The pairing regression sent false after link limits.
    After: TestAppTakenChatAdvertisesWorkingDuringTurn passes through two real app processes, agents.take, and agents.send. Channel gates force startup overlap and hold the final publish; the observer's chats.list is true during both, then false with a newer saved head. No sleeps or live model in this test.
  • TestAppNewerTurnKeepsWorkingWhilePreviousCaptureFinishes, TestHTTPWorkingCapabilitySurvivesLinkLimits, and TestHTTPBeatWorkingOnlyWhereAdvertised pass. Existing parked-drive, journal-ownership, terminal publish/release, and all three idle-release tests pass with their original assertions. Manual and real-number change entry updated. The pairing-copy gate also has a deterministic final-snapshot regression: previously shown random check words remain variable text after the final event clears Words. This fixes the “cello”/“cell” false positive without waiving it; the regression and real pairing test pass 10 repetitions.
  • Built the production code at d01ec2042 with make build (the final commit changes only the pairing-copy test); removed the old rig binary before copying the build. Unmodified /home/santosh/work/relay-e2e/run2.py, hosted dev relay, deepseek/deepseek-v4.1-flash: desk working true at 5.9s, still true at the first idle sample at 66.1s. A settled replay changed only the in-memory stop condition to keep both apps open until clearing: true at 4.1s, idle/true at 66.7s, idle/omitted at 70.0s. Holder remained caf-b; status remained running/open. Original rig scripts and homes retained.
  • make pr-ready BASE=origin/app/v3 TEST_TIMEOUT=30m passed on final head 39dda90c7, against base 11782a93f: light gate including all laws, then fresh cmd/codeaf (1465.366s), cellsync (3.721s), and directory (12.034s). Every selected test passed on its first run: no retries, exclusions, or known-failure exceptions. The existing 30-minute timeout override accommodates the unsharded app suite, which exceeds the default 15-minute package budget.

CI touched codeaf remains red because its 15-minute package budget expired at 900.045s, just as TestC1TerminalLinkApprovalRequiresA began (0s). Failed CI job. The local full suite above passed with the 30-minute override. This CI failure is documented, not waived; no tests were excluded.

Merge Danger

Door: two-way. No stored format or protocol change; optional working beats remain capability-gated.

Blast Radius: sync. Shared app and terminal end notifications await capture through guard.Go, bounded by the existing capture timeout. The generation check protects newer turns. Capturing and publishing remain asynchronous.

@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 5, 2026 22:19
santoshkumarradha added a commit that referenced this pull request Nov 6, 2026
* ci: shard cmd/codeaf so the touched gate fits the 15-minute ceiling

cmd/codeaf run whole passed the per-package fifteen-minute timeout on the
four-vCPU runner once app/v3 pull requests began running the gate (#2432
timed out at 900s). It joins tui3 and session in HEAVY_PKGS.

* docs: change entry for #2443

* docs: change entry for #2443
santoshkumarradha and others added 3 commits November 5, 2026 21:08
…ults

The child is a whole test binary started with -test.v, and its stdout went
to the parent's stderr, so each of its twenty "--- SKIP" lines counted as a
result of the parent. Once cmd/codeaf ran sharded (#2443), the shard runner
refused the package for reporting results it never listed. The output is now
buffered and logged only when the test fails.
# Conflicts:
#	cmd/codeaf/app_relay_test.go
@santoshkumarradha
santoshkumarradha merged commit faed775 into app/v3 Nov 6, 2026
7 checks passed
@santoshkumarradha
santoshkumarradha deleted the fix/app-working-beats branch November 6, 2026 02:41
AbirAbbas added a commit that referenced this pull request Nov 10, 2026
Brings the idle hand-off up to app/v3 a687c92, resolving 13 files.

app/v3's 93d4b7f restored dev's ownership rules: an expired hold admits
nothing, reopening acquires a new fence, and a take needs the exact fence.
The merge keeps those rules for every hold except one this window released
itself after its saved state reached the sync service. Only that window
may retake the chat when new work arrives in it. It does so by
conditionally acquiring a new fence, with the saved head unchanged, before
any write. It never heartbeats the released fence. A lapse that was not a
release keeps app/v3's behaviour. 93d4b7f's own regression tests pass
(TestReleasedSameFenceRetiresReceiptUntilContinuation,
TestAnExpiredHoldCannotAuthorizeTools, TestStartupAcquiresNewHold,
TestIdleExpiredHoldRequiresContinuation,
TestIdleWatchReconnectAndProcessReacquisition,
TestRelayOutageO4FailedIdleRenewalKeepsWorkLocal,
TestConditionalAcquireRejectsNewerFenceWithSameHead,
TestTakeF2SameHolderSameHeadFenceChange).

Other interactions resolved:
- Saves at pauses (#2356): release now also waits for the capture and
  for no unsaved turns.
- Chat rows (#2425, #2348): the new rows carry can_open beside working,
  notes, sharing and move.
- Beat state (#2432): a fresh fence resets it.
- Opening stamp (#2556): kept with the metadata-write hook.

TestIdleOpen_C6_D2 now finds the freed row at the fence the reopened
writer holds, because reopening takes a new fence on app/v3.

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.

1 participant