Skip to content

fix(status): omo and gjc finish as done, and work as working - #44

Merged
devswha merged 1 commit into
mainfrom
fix/done-after-identity-change
Sep 25, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/done-after-identity-change

Conversation

@devswha

@devswha devswha commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

omo and gjc panes read READY after finishing, where Claude Code and Codex read DONE. They also showed no RUN while working, and no "finished" alert came.

Cause, traced live in the isolated test herdr session. I sent one tiny prompt to omo 5.0 in a pane that was not focused. herdr's status events were:

pi/idle → pi/working → claude/unknown (the whole turn) → claude/idle
  • herdr reports done for an agent that goes back to idle while its pane isn't focused. It works this out by following the agent it saw working.
  • omo, and gjc, have no herdr integration, so herdr recognises them from their screen and processes.
  • omo's label turns from pi to claude while its claude child runs. The agent herdr saw working (pi) never finished, and the claude it then saw never worked, so the end came out as plain idle.
  • gjc is recognised the same way. A short failing turn did reach done in the test session (the provider there answers 401), so the gjc case couldn't be reproduced end to end here. The fix covers any agent herdr loses track of this way.

Fix: CompletionTracker (server/completion.ts)

  • It keeps whether each pane worked since it was last idle, done or seen.
  • Finish: an idle that follows work, in a pane herdr does not have focused, is reported as done until the pane is focused in herdr or works again. That is what herdr reports for agents it doesn't lose. The focus check is one snapshot per finish, because events don't carry focus.
  • Mid-turn: an unknown after work, while an agent is still in the pane, is reported as working. With no agent left, unknown stays unknown, because the agent quit.
  • Ordering: a finish still waiting on its focus check is dropped if a newer event for the same pane arrives first.
  • Coverage: the collector now passes the event's agent along. Status events, the machines list, /api/session and the WebSocket snapshot all go through the tracker, so the sidebar, the chat and web push agree.

Claude Code and Codex aren't affected: herdr already reports done for them, and a pane you have focused in herdr stays idle.

Testing

  • Live omo, through this server:
    • Before: idle → working → unknown → idle.
    • After: idle → working → working → done, and /api/session says done.
    • After pane.focus in herdr, /api/session says idle.
  • Unit tests (server/completion.test.ts):
    • the omo sequence
    • a focused pane stays idle
    • herdr's own done is left alone
    • a finish overtaken by a newer event is dropped
    • an agent that quit stays unknown
    • panes that disappear are forgotten
  • The collector test now expects agent in parsed frames.
  • bun run typecheck passes, bun test passes 335/335, and bun run test:ui passes 8/8.
  • Removed the omo, claude and gjc session directories these live traces created, all under /tmp/status-* cwds.

🤖 Generated with Claude Code

herdr reports `done` for an agent that went back to idle in a pane it
does not have focused. It follows the agent it saw working, and agents it
recognises from their screen and processes (no integration) can change
identity on the way: live-traced in the test herdr session, an omo turn
reads pi/working, then claude/unknown for the whole turn while omo's
claude child runs, then claude/idle. The sidebar said READY for a finished
pane, showed no RUN while it worked, and no done alert came.

CompletionTracker (server/completion.ts) keeps whether each pane worked
since it was last idle, done or seen. An idle that follows work, in a
pane herdr does not have focused (asked with one snapshot per finish, as
events do not say), is reported as done until the pane is focused or
works again, which is what herdr reports for agents it does not lose; an
unknown after work with an agent still there is reported as working. A
finish still asking about focus never lands after a newer event of its
pane. The collector passes the event's agent along; status events, the
machines list, /api/session and the WebSocket snapshot all go through the
tracker, so the sidebar, the chat and web push agree.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@devswha
devswha force-pushed the fix/done-after-identity-change branch from c8b4aaa to 560fcc0 Compare September 25, 2026 18:17
@devswha
devswha merged commit bde4d74 into main Sep 25, 2026
@devswha
devswha deleted the fix/done-after-identity-change branch September 26, 2026 14:48
devswha added a commit that referenced this pull request Nov 20, 2026
…LL (S2-30..S2-34, S2-37 line) (#4311)

## Track E step 2: the app's account screens (S2-30, S2-31, S2-32, S2-33
minimal, S2-34, one S2-37 line), behind OVIS_ACCOUNT_OPENS_ALL

One PR for Track E's cleared set (relay-hub speed-up rule). Based on
Track D's #4324 head (`feat/s2-26-account-row-rights` 56b1e12, on main
a79d6ca with Tracks A and B merged); it merges right after #4324 and is
retargeted to main then. Supersedes #4294 (S2-30) and #4296 (S2-31).
Cleared by range-diff against the cleared heads (hub + security-triage,
latest: 150/150 '=' at e5ccb30).

### Flag off
With OVIS_ACCOUNT_OPENS_ALL off, a PC lists no account-opens-all/1 and
the app shows and sends nothing new; the PC's roster refuses the
account-records forward exactly as main does (403 forbidden, a5090b6 /
4f7bc54).

### Pieces and receipts
| Piece | Device table rows | Cleared head | Receipts | Ledger |
|---|---|---|---|---|
| S2-30 account open from the sign-in key | T34, T40, P7, P18, G5 |
e472ee0 (+ wire tests b0b57ca) | gate r1-r3, r3 CLEAR; t13r YES |
none |
| S2-31 device notices of the selected PC | P10, P15, T34, T57, T58 |
b441382 | gate r1-r3 CLEAR on 5fc3526; close-X and two-step label
deltas: hub read + t13r YES; lead OK on '2단계 인증 확인 안 됨' | none |
| S2-32 Not me with per-PC receipts | T51, T60, T65 | 4f7bc54 |
pre-review r1-r3; hub cleared 4f7bc54; t13r YES (d8b558a) |
postponed: already_applied wording, Not me after a refused refresh |
| S2-33 the new device's wait card (minimal) | T53, T57, T67, P17 |
f0b174b | hub r2: own commits clear; t13r YES (range-diff) | none |
| S2-34 pairing fingerprint on both surfaces | T71, T72, P11 | aa61b12
| hub cleared at r2; t13r YES (range-diff) | postponed: device wait up
to 5 s past PENDING_MS |
| S2-37 one line: relay-only PC limit on setup | T70 | 888aa72 | hub
cleared r3; t13r YES (range-diff) | none |

Postponed until after switch-on (final scope): It's me, S2-35, S2-36,
the rest of S2-37. Track B's S2-13 commits sit under S2-34 as
cherry-picks (pairing fingerprint, key proof, pending keys, b8edf9e);
they drop out when #4301 merges.

### Changed at the collapse (besides the rebase onto D)
- Conflicts resolved by keeping both sides: shared/relay-channel.ts (E's
negotiation guard + D's hold/receipts forwarding), shared/relay-mux.ts
(D's held/not_listed/admission + B's key_proof_required),
shared/relay-mux-engine.test.ts (both test blocks).
- e6dcb8d: the app offers Track D's ACCOUNT_OPENS_ALL_FEATURE; E's
copy of the constant is gone.
- ee7c9f4: S2-30's wire-byte tests folded in (they need D's decoder).
- One new pin for S2-33: a decoded held refusal reaches the shell's wait
card with its deadline, and with none while the notice is unpublished.

### Since the collapse (each red first; hub checked, security-triage
YES)
- CodeRabbit round: tab race on the sign-in key, lost registration
reply, holds without a deadline and clock skew, open admissions across a
reconnect, a late decline reply, pending keys on sign-out, and a failed
account-service post of Not me's block now kept with a one-tap retry of
the same signed ids (ledger S32-1 for durable retry). New sentence (lead
OK): 'The block did not go through yet.' / '차단이 아직 전달되지 않았어요.' + 'Try
again'.
- Docs: '### Limits of this release' in docs/account.md.
- Rebased onto Track D: B's S2-13 cherry-picks dropped (on main); the
roster block test now signs with members older than any join hold on a
PC that has caught up.

### End-to-end (loopback relay + fake account service, flag on; not
staging)
List admission with the app event socket staying open; the Google 'not
confirmed' notice; Not me through the owner-only roster forward; the
held wait card; fingerprint pairing + Decline; Revoke all: all PASS
(scripts/account-opens-all-e2e-qa.ts, local branch). Not run here: a
block queued before list admission, lift by an older two-step signer
(staging).

### Captures
http://100.106.153.26:18765/s2-screens/ (owner OK; lead OK on the one
new sentence).

### Exports (each new export with its production caller, tests excluded)

##### S2-30
## New exports and their production callers
| Export | Caller (file:line) |
|---|---|
| `accountDevice` | src/lib/relay/shell.tsx:407 |
| `ACCOUNT_OPENS_ALL_MUX_FEATURE` | shared/relay-channel.ts:142,
shared/relay-channel.ts:208 |
| `AccountOpenUnsupportedError` | shared/relay-channel.ts:23,
shared/relay-channel.ts:267 |
| `AccountRowImmutableError` | src/lib/account/accountDevice.ts:21,
src/lib/account/accountDevice.ts:38 |
| `isFatalRelayError` | src/lib/relay/transport.ts:291,
src/lib/relay/transport.ts:355 |
| `myPcs` | src/components/AccountSection.tsx:795,
src/components/RelayAccountPcs.tsx:24 |
| `newKey` | src/lib/account/signInKey.ts:18,
src/lib/account/store.ts:134 |
| `nextOpenStep` | src/lib/relay/shell.tsx:298 |
| `openRefusalOf` | src/lib/relay/shell.tsx:296,
src/lib/relay/transport.ts:60 |
| `registerSigningBytes` | shared/account-records.ts:173,
src/lib/account/service.ts:383 |
| `signInKey` | src/lib/account/store.ts:77,
src/lib/relay/accountController.ts:327 |
| `withAccountDevice` | src/lib/relay/shell.tsx:407 |

### Flag off
Nothing is offered or sent: the service answers 404 (registration
returns null), PCs list no capability, and HELLO is unchanged.

### Tests (written first, each red before its code)
- caaf00e test(app): register this sign-in's own key, keep QR or
digits when the service has no release (T34, G5, T40, P18)
- db09308 feat(app): register this sign-in's own key with the account
service, null when it has no release (T34, G5, T40, P18)
- 39717c3 test(app): only a PC that lists account-opens-all/1 offers
it (G5)
- ddb2b8f feat(app): read account-opens-all/1 from a PC's trusted
features (G5)
- 87b78a0 test(app): a held account sign-in waits, an unlisted one
retries once then offers QR or digits (T34, G5)
- 5b7b482 feat(app): decide the next step when a PC refuses the
account sign-in (T34, G5)
- 0ed6f9b test(app): each sign-in registers a key of its own once and
keeps its number (T34, P18, P21, G5)
- 1a39d8f feat(app): each sign-in registers a key of its own and keeps
its number (T34, P18, P21, G5)
- a89d360 test(app): read held, not_listed and admission from the PC's
refusal, anything else keeps today's handling (T34, G5)
- eddcf3f feat(app): read the PC's account refusal from the relay
sign-in error (T34, G5)
- a0cf7b8 test(app): offer the account-opens-all mux feature in the
relay HELLO only when asked (T34, G5)
- 19f2861 feat(app): offer the account-opens-all mux feature in HELLO
when signing in with the sign-in key (T34, G5)
- 811de61 test(app): sign in to a PC as this sign-in key's account
row, whose key never moves (T34, T40)
- 60b6612 feat(app): sign in to a PC as this sign-in key's account row
and never move its key (T34, T40)

### Validation
`bun run check fast` on the stack top feat/s2-36 at 43234892 (contains
S2-30..S2-36), on main 0839031, via dori heavy: workflow syntax,
generated types/themes fresh, typecheck, build, unit tests (145 s),
actionlint all ok. Per-branch: each tip's own tests + i18n + conventions
+ typecheck. Electron suite (S2-35) 131/131.

##### S2-31
## New exports and their production callers
| Export | Caller (file:line) |
|---|---|
| `DeviceNotices` | src/App.tsx:1137 |
| `keyFingerprint` | src/components/DevicePairedNotice.tsx:39 |
| `noticeSeen` | src/lib/useDeviceNotices.ts:47 |
| `TOLD_KINDS` | src/components/DevicePairedNotice.tsx:20 |
| `useDeviceNotices` | src/App.tsx:337 |
| `withNoticeAcked` | src/lib/useDeviceNotices.ts:52 |
| `withNoticeDecided` | src/lib/useDeviceNotices.ts:59 |
| `withNoticeReplay` | src/lib/useDeviceNotices.ts:38 |

### Flag off
Nothing new is shown or sent: the PC lists no account-opens-all/1, so
every new path stays closed.

### Tests (written first, each red before its code)
- c4ca972 test(app): device notices replay once, ack without deciding,
keep an open admission (T57, P15)
- 1b3a400 feat(app): keep each PC's device notices in journal order
until decided (T57, P15)
- 1341a2a test(app): each PC's notices show once, are acknowledged
once, and a dismiss decides nothing (T57, G5)
- b1b22d2 feat(app): show each PC's device notices and acknowledge
them on that PC (T57, G5)

### Captures
http://100.106.153.26:18765/s2-screens/ (owner OK required before merge)

### Validation
`bun run check fast` on the stack top feat/s2-36 at 43234892 (contains
S2-30..S2-36), on main 0839031, via dori heavy: workflow syntax,
generated types/themes fresh, typecheck, build, unit tests (145 s),
actionlint all ok. Per-branch: each tip's own tests + i18n + conventions
+ typecheck. Electron suite (S2-35) 131/131.

### Since the gate-CLEAR head 5fc3526 (hub + t13r YES on each delta)
- Owner's close X: e7f47e1 red, d82159a fix (an open admission
notice hides locally only; no onDismiss, no ack, no answer).
- Two-step label (owner's Google decision, lead OK on the wording):
e06d278, 182a66c, 8d567de reds; b441382 fix (a list admission
whose two_step is present and not set/verified shows '2단계 인증 확인 안 됨' /
'Two-step sign-in not confirmed' even without a method).

#### New exports and production callers (tests excluded)

| Export | Production caller |
|---|---|
| DeviceNotices | src/App.tsx:1137 |
| keyFingerprint | server/push.ts:440, server/push.ts:599,
server/push.ts:605 |
| noticeSeen | src/lib/useDeviceNotices.ts:47 |
| NoticeSocket | src/lib/useDeviceNotices.ts:20 |
| PcNotices | src/lib/deviceNotices.ts:27, src/lib/deviceNotices.ts:41,
src/lib/deviceNotices.ts:45 |
| TOLD_KINDS | src/components/DevicePairedNotice.tsx:21 |
| useDeviceNotices | src/App.tsx:337 |
| withNoticeAcked | src/lib/useDeviceNotices.ts:52 |
| withNoticeDecided | src/lib/useDeviceNotices.ts:59 |
| withNoticeReplay | src/lib/useDeviceNotices.ts:38 |

None is tests-only.

##### S2-32

| Export | Production caller |
|---|---|
| ACCOUNT_SIGN_OUT_EVENT | src/components/AccountDeviceNotices.tsx:133,
src/components/AccountDeviceNotices.tsx:137,
src/lib/account/service.ts:504 |
| answerOnPc | src/lib/account/noticeAnswer.ts:57 |
| AnswerSocket | src/lib/account/noticeAnswer.ts:16,
src/lib/account/noticeAnswer.ts:48 |
| BlockOutcomes | src/components/AccountDeviceNotices.tsx:104 |
| BlockSend | src/lib/account/fleet-block.ts:60,
src/lib/account/fleet-block.ts:62, src/lib/account/fleet-block.ts:67 |
| canBlockAdmission | src/components/AccountDeviceNotices.tsx:40,
src/lib/account/fleet-block.ts:22 |
| FleetBlock | src/components/AccountDeviceNotices.tsx:39,
src/lib/account/fleet-block.ts:35, src/lib/account/fleet-block.ts:65 |
| indexedAccountService | src/components/AccountDeviceNotices.tsx:47,
src/components/AccountDeviceNotices.tsx:89,
src/components/AccountSection.tsx:192 |
| notMeBlocks | src/components/AccountDeviceNotices.tsx:51 |
| NotMeButton | src/components/AccountDeviceNotices.tsx:105 |
| notMeTransports | src/components/AccountDeviceNotices.tsx:76 |
| OwnKey | src/components/AccountDeviceNotices.tsx:17,
src/lib/account/fleet-block.ts:12, src/lib/account/fleet-block.ts:21 |
| postSafetyRecord | src/components/AccountDeviceNotices.tsx:92 |
| recordsOnPc | src/lib/account/noticeAnswer.ts:64,
src/lib/account/noticeAnswer.ts:65 |
| sendBlocks | src/components/AccountDeviceNotices.tsx:90 |
| useAccountDeviceNotices | src/App.tsx:336 |
| withBlockReceipt | src/lib/account/fleet-block.ts:79 |

None is tests-only. Not me posts the signed block to the account service
(POST /v1/safety-records, ovis-sh/account #44) and to each roster PC;
the roster forward of POST account/records is owner-only
(server/machine-api.ts) and carries x-herdr-machine for the receiver's
origin check. A PC reads blocked only on its own channel's receipt.

##### S2-33

| Export | Production caller |
|---|---|
| holdWaitMs | src/components/JoinWait.tsx:34 |
| JoinWait | src/components/AddPcSheet.tsx:165,
src/components/RelayShellScreens.tsx:272 |

None is tests-only.

##### S2-34

| Export | Production caller |
|---|---|
| declinePendingKey | src/App.tsx:1137 |
| KeyFingerprintWait | src/components/AddPcSheet.tsx:167,
src/components/RelayShellScreens.tsx:267 |
| PendingKeys | src/App.tsx:1137 |
| useRosterEvents | src/App.tsx:319 |

None of Track E's is tests-only. Rows from Track B's S2-13 (#4301:
pairing fingerprint, key proof, pending-key routes, incl.
PAIR_FINGERPRINT_PATTERN which only B's test uses) sit under this branch
as cherry-picks and drop out when S2-13 merges and this branch rebases;
they are listed in #4301.

##### S2-37 line

| Export | Production caller |
|---|---|
| relayOnlyPc | src/components/RelayOnlyWarning.tsx:21,
src/components/SetupGuide.tsx:778, src/components/SetupGuide.tsx:1117 |
| RelayOnlyWarning | src/components/SetupGuide.tsx:75,
src/components/SetupGuide.tsx:841 |

None is tests-only.

---------

Co-authored-by: sisyphus-dev-ai <[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