Skip to content

fix(chat): attach uncertain send status to matching transcript turns - #16

Merged
christso merged 1 commit into
christso/mainfrom
fix/chat-uncertain-transcript-status
Nov 5, 2026
Merged

christso merged 1 commit into
christso/mainfrom
fix/chat-uncertain-transcript-status

Conversation

@christso

@christso christso commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Change

An uncertain Send now no longer shows a second full message beside its native transcript turn. When this browser has one unique match in the same PC, pane and history, the warning and recovery controls appear under that turn. Ambiguous and reloaded copies remain collapsed above the composer.

Matching changes presentation only: it does not confirm delivery, release the queue, or resend input. Repeated sends reserve their own echoes; focused, expanded or selected recovery stays in place until the interaction ends.

The design follows Paseo’s canonical user-message echoes and Claude Code’s queued/sent distinction, while retaining uncertainty because native transcripts do not carry Ovis message IDs. This frontend follow-up is separate from upstream receipt recovery.

Related: devswha#2716, devswha#2792

Validation

  • bun run check fast: passed (10,635 tests, zero failures; 41 skips).
  • 92 targeted unit tests and TypeScript check passed.
  • 26 browser cases passed across desktop/phone and local/remote PC namespaces, including delayed echoes, repeated text, reload, replaced history, virtualization and keyboard focus.
  • Existing chat virtualization and terminal review browser suites passed.
  • Isolated native Codex: two Send now cases each produced one native user turn; copy, terminal review and dismissal preserved the draft and sent no new input. Reload retained compact recovery. No page errors.
  • Full local integration/Windows suites skipped; required hosted CI must pass before merge.
  • Independent review completed; all three findings received regression tests and fixes, with a clean closure review.

Evidence

Before/after MP4s and reproduction details. The recordings use a real Codex transcript in a test session; the harness deliberately maps the interruption warning to generic submit_changed to cover older/generic outcomes. This proves that UI path, not the original remote incident’s exact acknowledgement failure.

One transcript message with attached uncertainty

@christso

christso commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner Author

Independent code-review agent receipt for de7ba960a5293bda67289f357476ac924ebfe69d:

Seven review lenses completed (correctness, project standards, testing, maintainability, performance, frontend races and adversarial), followed by independent validation. Three P2 findings were confirmed and fixed before publication:

  1. A delayed native echo could remount a focused/expanded recovery row. Placement now waits while focus, disclosure or selection engages the row; the browser regression covers desktop/phone and both PC namespaces.
  2. An ordinary confirmed send could compete with an equal-text uncertain queued attempt. Ordinary sends now retain distinct echo reservations before and after settlement; a regression exercises both states.
  3. Whole-second timestamp allowance could attach recovery to an unread older identical turn. Uncertain placement omits that allowance and requires a dated baseline; ordinary waiting-send behavior remains unchanged.

An independent read-only closure review inspected all three fixes and found no remaining concrete defect. The attempted cross-model peer failed during ACP initialization before source egress (npm EOVERRIDE); the adversarial review used an in-process fallback. No CodeRabbit review has run on this fork. This independent agent review is the substitute required by AGENTS.md for merging without CodeRabbit.

Validation: bun run check fast passed (10,635 tests; zero failures; 41 skips), 92 focused tests and typecheck passed, all 26 focused browser cases plus existing chat virtualization/terminal suites passed. Isolated native Codex compatibility recording passed two Send now cases and copy/peek/draft/dismiss/reload assertions. The generic error-code projection is explicit fault injection; no live user pane was recorded or prompted. Required hosted CI must be green before merge.

@christso
christso merged commit fb4d2dd into christso/main Nov 5, 2026
12 checks passed
@christso
christso deleted the fix/chat-uncertain-transcript-status branch November 5, 2026 05:28
devswha added a commit that referenced this pull request Nov 26, 2026
…dd a PC (devswha#4487)

Part 1 of 3 of the one Connect a PC screen. This PR changes only the
hosted page (`src/`); the phone app's own pages (`app/`) follow in parts
2 and 3.

## What changes for a person

The hosted page had three different screens called Connect a PC: the
front page with Ovis relay | Tailscale | SSH tabs, each tab holding its
own list of PCs; and `/#add` (More → Connect a PC inside a PC), a
tab-less list of ways plus "Your PCs". They become two views:

- **My PCs** is the front page once the person is signed in or this
phone saved any PC. It is one list of every PC: the relay's (this
phone's pairings, then the account's PCs it can open) and the ones the
phone app saved by a Tailscale address, over SSH or at another address.
Each row shows the PC's name, a small way tag (Relay / Tailscale / SSH /
Address) and, for a relay PC, On, Off or Update needed. Tapping a row
opens the PC as before. **Add PC** stays at the bottom of the screen
while the list scrolls. The account's notices (join requests, new PC,
unconfirmed PC), the "no PC is online" card, the directory error with
Try again, the account ⋮ menu, Forget on a row this phone can forget,
and Removed on a PC that removed this phone all stay on My PCs. Signed
out, a sign-in that ended or was signed out everywhere is said above the
list too.
- **Add a PC** is the three tabs, holding only the ways in, with no
list: the sign-in (signed out) and the PC's QR (a code where there is no
scanner, a browser) on the relay tab; the Tailscale address field, its
QR and the Tailscale-off card; user@host and Add by address on SSH. It
opens from Add PC, with Back to My PCs, and is the front page itself,
titled Connect a PC, when the person is signed out with nothing saved.
- **`/#add`** (More → Connect a PC inside a relay PC) now shows My PCs
with Back to the PC the person came from, whose row says **In use now**
instead of its state.
- The #16 one-line front page is folded into My PCs: with no PC on, the
same list with its rows saying Off under "No PC is online" and Check
again (the launch's own retry, or the sign-in's when nothing is saved
here); with no PC in the account yet, the empty list saying "Sign in
with the same account on the PC where Ovis runs" over Add PC. Its "Other
ways to connect" goes with it.
- A row says first what this device knows itself (a pairing's saved Ovis
too old, then a check that found it off or on), then the account's word.
Forget sits in a column of its own beside the row's open link.
- Add PC over My PCs has an entry of its own in the history: the phone's
or browser's Back returns to My PCs, and the focus moves to Add PC's
title and back.
- **Needs approval** is no longer shown as a PC's state on these views:
an account PC this phone is not let into yet says On or Off like any
other, and tapping it leads to the same wait-for-approval screen as
before.

Unchanged: the join, wait, declined and removed screens (the plain wait
a sign-in's launch puts up on a PC's own page), sign-in, the PC's own
pages, the desktop/Mac `ConnectPhoneDialog`, and the phone app's own
pages. In the phone app, More → Connect a PC on a PC opened by Tailscale
or SSH still goes to the app's own screen (`addPcExit`, part 2 changes
that). A relay with no account service keeps its plain list of pairings
as the front page; with nothing saved it opens on the tabs instead of
the old tab-less screen.

The layout follows the mockup the owner approved (one list, Add pinned
at the bottom), as the Claude app keeps New chat within reach over its
list of chats; no pixels copied.

## Known limits

- Reloading `/#add` loses the In use now mark and its Back target (the
page before this PR had the same reload limit for its Back).
- One PC saved under several routes (relay and a Tailscale name, say)
shows as several rows: grouping them needs a verified PC id per saved
route.

## Removed

- `RelayAddPc` (the tab-less `/#add` screen) and `SavedPcs`; its helpers
(`Way`, `AddressForm`, `scanQr`, `sshHandoff`, `useAddressOpen`,
`addressOf`, `publicHttp`) stay and the tabs use them.
- `ScanQrStep` and the signed-out branches of `RelayShellCardContent`
that drew the old front pages.
- The per-tab "PCs this phone is on" lists, the #16 front page's own
layout (PcApprovalWait's account menu and Other ways to connect), and
the strings "PCs this phone is on", "Enter an address" and "Other ways
to connect".

## Evidence

Before/after captures at 390 px (light, Korean; plus 360, 768 and 1280)
were shown to the owner: signed out, signed in with 2 PCs, 7 PCs of
mixed ways (the list scrolls, Add PC stays), Add a PC on each tab,
`/#add` from inside a PC (In use now), and the browser without a
scanner. They come from a fixture with made-up PCs, no real account.

## Validation

- `bun run check fast` on the head (1933b56): workflow syntax,
generated types and themes, typecheck, build, unit tests (1149 files,
23,265 pass, 0 fail).
- Browser regressions that walk these screens, in the CI runner image on
the head (`bun run build:shell` and the app build first, each through
`bun run check run`): `add-pc-more-relay-regression.ts` pass (now also:
a row's chevron and middle hit the open link, never Forget, at both
densities; Back from Add PC lands on My PCs with the focus);
`relay-shell-browser-qa.ts` pass;
`relay-second-device-join-regression.ts` pass (6 cases);
`relay-offline-reasons-regression.ts` pass (5 cases);
`relay-join-browser-qa.ts` pass (16 cases).
- `HERDR_TEST_SHARDS=4 bun run check integration` on this PC (on
fb4f22e; later commits change `src/` and browser scripts only): 2,287
pass, 6 fail, 113 skip in 151 files. The 6 are
`server/machine-profile.contract.test.ts` (4) and
`server/reattach.contract.test.ts` (2): neither imports `src/`, both
fail the same way on a clean `origin/main` on this PC, and both pass in
the CI runner image (108 pass, 0 fail).
- `scripts/acceptance/first-run.ts` (not in CI): its list steps are
tightened, but in the image it stops at `phone.pairs` (4 pass, 2 fail, 9
blocked) exactly as `origin/main` does, so those steps did not run.
- The adversarial review's 12 findings and what became of each are in a
comment on this PR.
- Skipped: the whole browser lane (`check browser`), native Windows and
macOS, and device QA on Android or iOS.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Nov 26, 2026
… key (devswha#4531)

## What changed

For the 24 hours after a PC joins the account in one press (`new_until`
on its directory entry), a device of the account that is not paired with
it now gets in on the person's press the same way it gets into any other
PC of the account. The press on that PC's join sheet (**Ask to join**,
on the PC's own page, where a tap on its row in My PCs also leads) first
signs in with this device's registered account key. Only when that is
refused or cannot be tried does the same press send the join request it
sends today, with no second press.

The decision behind it, in plain words: a press is enough. During the 24
hours nothing opens the new PC without that press: its page load still
puts up the sheet first, a launch still never opens it (it puts up the
sheet, or asks to join it, below), and a reload never opens it by
itself. The **New PC** mark, the **I didn't add this** notice and every
other 24-hour behaviour (nothing in the app is selected by itself on
that PC) stay as they are.

## Why

Before this, nothing ever used the account key for such a PC. Its page
skipped the account sign-in for a new PC (`openUnpaired`:
`!isNewAccountPc(...)`), and the sheet's press only ever sent a join
request (PAIR with intent `account`). On a PC with no paired member,
that join is a first join, which only the PC's own window can Allow. So
a PC with no screen added by `ovis add` (devswha#4514), by the Mac app's add
over SSH, or by one press could not be opened by any device for 24
hours. Yet the PC had already admitted the account's eligible devices
from the account's list, and it answers ok to their account sign-in:
`server/devices.ts:2263` `matchAccountRelay` → `listedAccess` →
`server/account/account-devices.ts:131` `access()`. Nothing on the PC
reads `new_until`, and the only hold is the usual 10-second join hold
that the client already waits out. On a PC with a screen, the phone said
"press Allow on the PC" while the PC already listed that phone as
"Through your account".

## The condition, before and after

Before:
- Page load (`openUnpaired`): the account sign-in when `join &&
accountOpen && openKey !== null && !isNewAccountPc(pc) &&
!launchJoinFor(pc)`, otherwise the join sheet.
- Sheet press (`confirmed` → `pair()`): always the join request.

After:
- Launch with nothing saved to open (`showFront`, `shell.tsx:507`): when
the account's PC it picks is inside its 24 hours and this device may
sign in to it by the account key (the same `accountOpenOf` guards), it
puts up that PC's sheet and asks nothing: no `keepConfirmedPc`, no
launch card. One press there opens it by the account key. A new PC
without that way in, and any PC that is not new, keep the launch's join
asked at once, as before.
- Page load: unchanged. It uses the same condition, now built by
`accountOpenOf(pc)` plus `!isNewAccountPc(pc)`
(`src/lib/relay/shell.tsx:1266`).
- Sheet press (`src/lib/relay/shell.tsx:1064`, `pressedAccountOpen`):
the account sign-in, marked `pressed`, when the account's row for this
PC is inside its 24 hours (`isNewAccountPc`, an unreadable window
included) and `join && accountOpen && openKey !== null &&
!launchJoinFor(pc)` hold. Those are the same guards a load uses. In
every other case it sends the join request as before: every PC that is
not new, a fresh never-seen PC (the "new" sheet), a new PC with no key
registered here, and a page whose read of the account failed or was not
answered.
- The sheet starts a fresh read of the account's PCs as it comes up
(`arrived()`, unchanged), and that read blanks the rows until it is
back. A press made during it now waits for it (`shell.tsx:1066`, the
existing `readAgain`, bounded by `ACCOUNT_READ_WAIT_MS`) before
choosing, so a quick tap on a new PC is not sent as a join only because
its row was not back yet. For a PC that is not new, a press in that
window gets the same join as before, at most that long later.
- A refusal of the pressed sign-in goes through the existing handling in
`failed()`:
- `not_listed` gets one retry, then the join. `admission` and a PC
without the account's way in (`AccountOpenUnsupportedError`) get the
join. `held` waits and retries (JoinWait), and a frozen hold waits. All
of this is unchanged from a load.
- New for `pressed` only, in the existing "pair" step: `keepConfirmedPc`
before the existing `joinPc` fallback (`shell.tsx:699`). The sheet that
follows then sends the join at once. This is the same one-navigation
consent that a launch's join and a typed-code match already use, so the
person is not asked to press twice.
- New for `pressed` only (`shell.tsx:690`): `auth_failed` goes to that
same "pair" step. A PC answers a key it does not list (not eligible, the
account service's own rule for a new sign-in method, removed) with a
bare `auth_failed`, not `not_listed`: `server/devices.ts:2267` returns
null for a missing row, and `server/relay/session.ts:433`/`:715` close
with `auth_failed`. `server/account/one-press.contract.test.ts` checks
this for a "stranger" key. Without this mapping the existing handling
would show "removed" and mark the PC removed on this device
(`src/lib/relay/shellState.ts:185` → `revoked` → `markRemovedPc`). That
would be a regression from today's join for exactly the device that is
not on the PC's list.
- Any other failure (the PC off, the relay unreachable,
`account_unreachable`, `account_readd_required`, `auth_revoked`) shows
its failure screen. Its Try again tries the account way again, as after
a load.

## Every caller changed

- `src/lib/relay/shell.tsx` `confirmed()`, the sheet's `onPair`:
`pressedAccountOpen`, otherwise `pair()` as before, after the account
read the sheet started when one is still running.
- `src/lib/relay/shell.tsx` `showFront`, the account launch: the branch
above, for a new PC with the account way in.
- `src/lib/relay/shell.tsx` `openUnpaired`: the same condition, moved
into `accountOpenOf` (no behaviour change); its comment now says what
really happens.
- `src/lib/relay/shell.tsx` `failed()`: the two `pressed`-only additions
above.
- `src/lib/relay/shellState.ts`: `Attempt.pressed`.
- Not changed: `accountOpenablePcs` in `pcPick.ts` (a launch still never
opens a new PC), `accountLaunchPcs` and its order, `arrived()`, the
sheet component and its words, the New PC notices, and the in-app hold
of a new PC (`enterApp` → `setPcNewness`).

## Why this is no weaker than today

The join request this replaces on a press is approved by the new PC
itself: on a first join only its own window can approve, and on a PC
with members a member or the PC can. A PC someone else slipped into the
account would simply approve it. The join only adds friction for honest
PCs: the person walks to a PC with a screen, and a PC with no screen
cannot be opened at all. What protects the person is unchanged: nothing
opens the new PC without their press (page load, reload and launch are
each covered by a test), the New PC mark, and **I didn't add this**,
which removes the listing. The PC checks that listing with the account
service before it grants a new account-only session (docs/account.md,
"In one press"), so after a removal the account way is refused within a
minute.

What this lets in: only a device of the same account whose key that PC
already admitted from the account's list. The PC's account rows are per
account, so no device of another account gets in. No device that the
PC's own checks refuse gets in either: a hold makes the device wait, and
freezes, removal evidence and tombstones leave its row out
(`accountRowStale`), so it gets `auth_failed` and then the same join it
would have got before.

One correction to the reasoning as first stated: the join does not add
friction "only on PCs with no screen". It adds a walk to every honest PC
with a screen too. On a PC with no screen it blocks the person
completely.

## A removed device, and one fallback per press

- A device the PC really removed is not turned into a silent re-join.
Its account sign-in gets `auth_failed`, because its row is left out
(`accountRowStale`: tombstones, removal evidence, freezes). The fallback
then sends only the join request the press sent before this change, and
the PC judges it as any other join. A key the account removed is refused
whoever approves it (`server/devices.ts:983`, `admissionAllowed` →
`removedByAccount`). A key the PC revoked is refused for any member's
approval (`server/devices.ts:984` and `:2725`), and it comes back only
when a person approves it on the PC's own window with the digits, as
before. Nothing on this device changes the removed mark: it stays until
the PC actually lets the device in.
- The fallback happens once per press, never in a loop. The flow is
account sign-in, then `auth_failed`, then one join request, which the PC
turns down; after that nothing tries the account way or the join again
by itself. The one-navigation mark that sends the join is taken by that
join's own page. A reload sends nothing and asks for the press again.
Try again on the join's failure screen is a new press, and it sends the
join again (the attempt it retries), as before.
- Pinned by `a device its new PC removed gets only the join a press sent
before, once …` in `shellAccountOpen.test.tsx`. The test runs on the
same document, as in a browser. The account way gets `auth_failed`, then
one join goes up for approval and the PC declines it. After 30 minutes
of fake time there are exactly two attempts (account, join), one
approval prompt, no app, the removed mark is still there, and a reload
sends nothing. A mutation that makes the join's page try the account way
again fails this test.

## What is still refused

- A launch never signs in to a new PC by the account key. It puts up the
sheet, which waits for the press (or, with no account way in, asks to
join, as before).
- A load or a reload of a new PC's page never signs in. It puts up the
sheet.
- With no key registered here, or a PC that does not list the key, no
longer admits it, or predates the account way in, the press sends the
join, which the PC decides as today.
- The account service's own 24-hour rule for a new sign-in method stays.
Such a device is not on the PC's list and gets the join.

## Words on screen

Unchanged. The sheet keeps **Add this device to {name}** with **Ask to
join**, and those words fit both outcomes: the press asks, and a PC that
already let this device in through the account answers at once and
opens. Otherwise the existing **Approve it on {name}** screen with the
number follows. While the account sign-in runs, the sheet shows its
connecting step, whose first line already reads "Ask to join: Through
your account, with this device's key". The sheet does not say, today or
after this change, when or by which sign-in the PC was added; the in-app
notice with **I didn't add this** does. No screenshots, since nothing
drawn changed.

## Validation

- Red first, in `src/lib/relay/shellAccountOpen.test.tsx`: 9 new or
changed tests failed on main's code and pass now. They cover: a new PC's
page load and reload open nothing, and its press tries the account key
and opens on ok; `not_listed` (twice), `admission`, `auth_failed`
(direct and over the wire) and a PC without the way in each send the
join with no second press and mark nothing removed; a hold is waited out
and then the PC opens. Three more pin behaviour that stays, and passed
before and after: a launch's join card for a new PC asks by a join only;
with no registered key the press sends the join; a PC past its 24 hours
whose sign-in was refused at load keeps the press as the join alone.
Added after the review: the three tests named under Review (LOW 1, LOW
2, LOW 3), each checked against a mutation that breaks it. Added before
it: the removed-device / once-per-press test above, and a press made
while the sheet's read of the account's PCs is still out (it waits, then
signs in by the account key). Each of these two was checked against a
mutation that breaks it (the join's page trying the account way again;
no wait for the read): both fail. Those tests drive the same document
the way a browser does, with a fragment change on the page that put the
sheet up (`land`). The A3 test still loads the sheet as a fresh page.
- `dori heavy newpc -- bun run check fast`: green on the final tree
(typecheck, build, 24404 unit tests), as on each earlier push.
- `bun test` on `src/lib/relay/shell*.test.*`,
`src/components/RelayShell.test.tsx` and
`src/components/AddPcSheet.test.tsx`: green.
- Browser, in the CI runner image (`herdr-ci-runner:local`, from a git
bundle of this branch): `relay-second-device-join-regression.ts` (drives
the join sheet from a PC's own page), `relay-first-link-regression.ts`
and `relay-shell-browser-qa.ts` (press the confirm and the new-PC sheet)
pass on the final source, as on each earlier push. None of them drives a
PC inside its 24 hours, and no browser script does.
- Skipped: the integration suite and native Windows (no server, shared
or Windows code changed), and screenshots (no words changed).

## Review

An independent review found no HIGH. Each finding and how it was
resolved:

- MEDIUM: a press made during the account read that the sheet starts
found no row and sent the old join. Fixed in 9937f28, which the
reviewer read and agreed with: the press waits for that read (the
existing `readAgain`, bounded). Pinned by "a press made while the
sheet's page still reads the account's PCs waits for them …"; a mutation
without the wait fails it.
- LOW 1: the `attempt.pressed === true &&` guard on the `auth_failed`
mapping (`shell.tsx:690`) had no test. Mapping every account sign-in's
`auth_failed` to the join passed every shell test. Added "a PC past its
24 hours that answers its page's account sign-in with auth_failed says
this device was removed, as before …": a load's sign-in ends on
`revoked` with the removed mark and no join. The same mutation fails it
now.
- LOW 2: after a successful open, `enrolled` (`shell.tsx:875`) drops
`pressed`, which was unpinned. With `pressed` kept, a later
`auth_failed` on the open session would quietly go to a join instead of
"removed". Added "a new PC opened by the press that later ends its
session with auth_failed says this device was removed …": `revoked`, the
removed mark, no join. Keeping `pressed` in `enrolled` fails it.
- LOW 3: after a press opened a new PC with no screen, `rememberPc`
(`shell.tsx:924`) made it the PC opened last. `accountLaunchPcs` then
asked it first, and when nothing else could be opened, every launch
during its 24 hours sent a first join by itself that only the PC's own
window could allow. Fixed here: for a new PC with the account way in and
a key here, a launch puts up its sheet and sends nothing, so one press
opens it by the account key. A new PC without that way in keeps the
launch's join. Pinned by "puts up the sheet of a new PC this device may
sign in to by the account's key and asks it nothing; one press there
opens it by that key" in `shell.test.tsx`. That test checks: the launch
sends nothing and leaves no confirmed or launch-card mark, the PC's page
shows the sheet and sends nothing, and the press opens it by the account
key. Making the launch ask the join again fails it. "A launch never
opens a new PC by itself" stays pinned by the existing "C3: a launch
never opens an account-only PC when it is inside its new window / its
new window does not parse". The existing "#16: asks to join a PC new in
the account after a sign-in too, at once" still passes for a sign-in
with no registered key.
- LOW 4: known limit, below.

## Known limits

- When the PC runs a newer Ovis than the shell, the first open of a
pressed sign-in reloads the page once
(`src/lib/relay/updateFlow.ts:130`, `reloadOnce`). The reloaded page is
the new PC's own page, which puts the sheet up again, so the person
presses twice. The second press opens it, since the reload happens once
per version.

- For a PC that is not new, an account sign-in made by its page load and
refused with `auth_failed` (a key the PC does not list) still shows
"removed" and marks the PC removed, as before this change. Only the
pressed sign-in maps it to the join. That is left for its own change.
- When the account way is refused on a new PC with no screen and no
member, the join that follows is still a first join that only the PC's
own window (or `ovis approve`, another PR) can allow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus <[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