Node 25+ exposes its own localStorage/sessionStorage globals, which shadow
jsdom's in the Vitest environment. Tests that spy on Storage.prototype or
pass localStorage to StorageEvent then fail (5 tests in markdown-a and
sessionLastSeen). Bind both globals to the jsdom window's storage instead of
the memory fallback that only kicked in when methods were missing.
via [HAPI](https://hapi.run)
Co-authored-by: HAPI <noreply@hapi.run>
* feat(web): unpin a session from the list on hover
* fix(web): preserve focus when unpinning into a collapsed project
* fix(web): reserve width for visible row quick actions
* fix(web): harden keyboard-only unpin focus handoff and simplify reveal logic
* feat(web): export and import browser settings from Settings → About
Browser-local settings (theme, display, chat, voice, machine labels, ...)
can now be exported to a JSON file and imported in another browser.
Only an explicit allowlist (SETTINGS_STORAGE_KEYS) moves; credentials,
hub URL, drafts, UI state and trust grants never do. Import replaces the
allowlisted keys and reloads so every hook re-reads its value.
A test scans web/src and shared/src storage code and fails on any hapi*
key that is not classified as a setting or not, so new keys get decided
by whoever adds them.
Closes#2441
via [HAPI](https://hapi.run)
Co-Authored-By: HAPI <noreply@hapi.run>
* fix(web): reject malformed settings files and carry legacy fallback keys
Addresses Swear Review on #2442: reject array settings and unknown
versions before touching storage, and move legacy keys that settings
still fall back to (tool-card display, active-only list filter,
ElevenLabs voice) along with them. The session-list status filter is a
Display setting, so it and unread-only are now settings too.
via [HAPI](https://hapi.run)
Co-Authored-By: HAPI <noreply@hapi.run>
---------
Co-authored-by: HAPI <noreply@hapi.run>
Cursor ACP sessions can fail mid-turn with a transient model error that the
agent reports inline rather than as an RPC rejection. HAPI treated those turns
as successful, so the session went quiet with no banner, no push, and no way to
resume without retyping the prompt.
This adds the full path:
- detect: classify inline/stderr model errors from the Cursor ACP stream,
requiring strong signatures before typing a failure as a model error
- surface: persist `lastModelError` on session metadata; render a chat banner
and a session-list indicator, with the prompt text kept out of list/SSE
summaries so they never ship up to 32 KB of user prompt
- notify: deliver a push for an unacknowledged error, watermarked on the hub
copy so a restart does not re-page the same eventId
- bridge & retry: offer a one-shot recovery prompt that replays the failed
turn, bound to the originating eventId and gated so a real user turn always
supersedes it. Auto-bridge is opt-in and defaults to OFF, persisted in hub
settings and fanned out to live Cursor CLIs.
Re-cut onto current upstream/main. The branch had accumulated 108 iterative
hardening commits against a 289-commit-older base; replaying them individually
would have re-resolved the same conflicts ~100 times. The pre-re-cut tip was
2c28a1365 if the granular history is ever needed.
Absorbing upstream required adapting to three refactors that landed meanwhile:
- `MessageQueue2` grew an `internal?: boolean` control-message flag upstream
while this branch added richer `internal` provenance. Unified on a tagged
`QueueItemInternal` union (`control` | `model-error-bridge`) so one field
carries one concept. `hasPendingNonBridgeTurn()` now treats *any* internal
item as non-user: otherwise a queued `/auto-review` control slash would have
counted as a user turn and wrongly superseded a live bridge.
- `AcpSdkBackend.prompt()` gained a `timing` callback upstream; merged it with
this branch's `shouldSend` gate into a single options object.
- The hub settings route moved to a unified `updateSettings` transaction.
`autoBridgeTransientModelErrors` is applied outside that transaction because
SyncEngine owns its CLI fan-out and rollback under its own lock.
via [HAPI](https://hapi.run)
Co-authored-by: HAPI <noreply@hapi.run>
#2380 moved the disconnected-row fade onto the title text, which also removed a
stacking-context defect I had an open fix for (#2375 / #2373): the fade used to
sit on the title grid, and that grid holds the schedule and attention
HoverTooltips, whose panels render inline as `absolute z-30` rather than through
a portal. An `opacity < 1` ancestor forms a stacking context, so the panel was
both washed out and had its z-index trapped — a later row could paint over a
downward-opening scheduled-send panel.
The code is correct now, so this is only the guard. The natural refactor — hoist
the fade onto the grid so the whole row dims — reintroduces the bug silently, and
only on inactive rows that also have scheduled messages, which is why it survived
review the first time.
Asserted structurally: no element carrying the fade may contain a role="tooltip".
Fails if the fade moves back onto the grid; passes on current main.
via [HAPI](https://hapi.run)
Co-authored-by: HAPI <noreply@hapi.run>
* fix(web): keep the recovery pending until the row sweep succeeds
The recovery consumed pendingGapRecovery at the latest-page upsert,
before the by-ID row sweep ran: a context request that failed there
propagated to the run's catch and surfaced the warning, but the flag
was already gone, so the next ordinary tail sync did cursor catch-up
only, skipped the sweep, and cleared the warning — the enriched cached
call stayed stale with no retry path.
Keep the flag pending until the catch-up, the upsert, and every row
refresh have succeeded: the upsert now consumes only the activation
flag it subsumes, and the recovery completes — clearing
pendingGapRecovery — after the sweep finishes without a failure. The
sweep's failure exits (a thrown request, a row the endpoint no longer
knows, a different-epoch answer) leave the flag set, so the next sync —
ordinary or recovery — retries the whole choreography. The upsert
itself is idempotent, so a retry costs one extra latest-page round.
* fix(android): keep the recovery pending until the row sweep succeeds
Mirror of the web fix: the recovery consumed pendingGapRecovery at the
latest-page upsert, before the by-ID row sweep ran — a context request
that failed there left the enriched cached call stale with no retry
path, because the next ordinary tail sync does cursor catch-up only,
skips the sweep, and clears the warning.
The upsert now consumes only the activation flag it subsumes, and the
recovery completes — clearing pendingGapRecovery — after the sweep
finishes without a failure; the sweep's failure exits leave the flag
set, so the next sync retries the whole choreography. The upsert itself
is idempotent, so a retry costs one extra latest-page round.
* fix(ios): keep the recovery pending until the row sweep succeeds
Mirror of the web/android fix: the recovery consumed pendingGapRecovery
at the latest-page upsert, before the by-ID row sweep ran — a context
request that failed there left the enriched cached call stale with no
retry path, because the next ordinary tail sync does cursor catch-up
only, skips the sweep, and clears the warning.
The upsert now consumes only the activation flag it subsumes, and the
recovery completes — clearing pendingGapRecovery — after the sweep
finishes without a failure; the sweep's failure exits leave the flag
set, so the next sync retries the whole choreography. The upsert itself
is idempotent, so a retry costs one extra latest-page round. Test rides
CI.
* fix(hub): advance the idle-progress clock on merged tool-call ticks
A repeated tick folds into the call's existing row, and the stored row
keeps its first snapshot's createdAt for stable ordering — but
onAgentProgress received that frozen timestamp on every tick, so
repeated snapshots of a live ACP call never advanced the keepalive-idle
clock and a session with thinking=false and no background task could be
marked idle despite fresh updates.
Feed onAgentProgress the merge observation time when the tick updates
an existing row; the stored ordering timestamp is unchanged, and the
derived todo/team version stamp keeps its strictly-advancing gate.
* test(ios): await the actor-isolated failure injection in the sweep-retry test
GatedMessagesProvider is an actor, so failNextContextRequests must be
awaited from the async test body; without it the new test fails to
compile in CI. No production change.
* fix(agy): keep empty strings in edit and write tool card inputs
A deletion edit (empty Replacement) or an empty-file write was mapped
without new_string/content, so the web Edit and Write views rendered
nothing. Keep '' for old_string, new_string and content.
* fix(web): take the question card's free-text flag from the pending request
agy's ask_question tool call is shown before its form arrives, so its input
cannot say whether free text is allowed, and the card kept offering Other on
forms without qN_other. Fill allowFreeText on the tool call input from the
pending request's input for questions that carry none. Inputs and requests
without the flag keep showing Other.
agy streams agent_message_chunk as pure deltas, but the backend used the
default overlap-dedupe mode, which dropped a repeated character at a chunk
boundary (73-8 + 800 was shown as 73-800). Set textChunkMode to delta,
as the OpenCode and Grok backends do.
crypto.randomUUID is undefined outside secure contexts (plain HTTP on a LAN IP), so enqueueing a read threw and no read-state PUT was sent. Use the randomId() helper, which falls back to getRandomValues.
Sort & filter scrolled: four machine radio rows (a rare choice) led the
sheet, every status and sort option was its own 56dp radio row, and Done
sat in a footer. The activity-date dialog was a full-width custom Dialog
that clipped the picker title, and its range band was Material's baseline
purple next to green endpoints.
- The sheet is now single rows under Filter / Sort: Machines, Show and
Sort by show their value and open an anchored menu (checkmark for the
selection, machine session counts trailing); Activity dates opens the
picker; Unread only and Active first stay switches. Reset and Done move
into the header, so the whole sheet fits without scrolling (as on iOS,
where machines moved into a submenu).
- The date range picker sits in Material's DatePickerDialog (standard
width and margins), drops the title row, aligns the range headline with
the 24dp content edge instead of M3's 64dp full-screen indent, keeps the
recent-activity legend under the calendar, and omits the current year
from legend days.
- The static light/dark schemes now define every accent role (primary,
secondary, tertiary containers and their on-colors) from the green
seed; unset roles were falling back to Material's purple.
- A window-level specimen covers the sheet, the machine menu and the
picker; instrumentation tests open the Machines / Show menus first.
Both cost transcript lines on every screen: the "Session inactive — send
to resume, or Reopen" card and the "ctx 190k · 0% left / Auto" strip.
- Inactive sessions still resume by sending (unchanged), and Reopen stays
in the chat overflow menu.
- Context remaining moves into the session config sheet (gear) under a
new "Context" section, keeping its warning color bands.
- The permission-mode label above the composer goes away; the mode is
shown and switched in the same sheet.
The usage-info button sat under whichever block carried metadata — often
a reasoning or tool card at the start of a response, sometimes several
per response — inside a padded TextButton that pushed it off the prose's
leading edge.
Close each agent response with one action row instead, like the web
MessageActions on an assistant-ui card: under the last block of each run
of assistant-role blocks (bounded by user text, agent events and
user-source CLI output), show copy (the run's prose joined by blank
lines; reasoning and tools excluded, Codex reviews via a port of
formatCodexReviewText), details (the run's first block with usage
labels) and the latest activity time (same day HH:mm, same year
MMM d HH:mm, otherwise with year; locale-ordered, 24-hour). Glyph
artwork aligns with the text edge; copy reuses FullTextAction's
clipboard-or-export logic with a transient checkmark.
Material elevation is lit from above the screen, so at the bottom edge it
fell heavily under the hairline-bordered card and read as a smudge, and
the composer strip (a clipping Surface) cut the blur into a hard top edge.
Draw an even iOS-style shadow instead (black 8%, 8dp blur, 2dp down; 6%
and 6dp for suggestion popups) via a paint shadow layer, and make the
strip an unclipped Box so the blur fades out naturally. Dark mode keeps
relying on the lighter fill. The helper is a CacheDrawScope function, not
a Modifier factory: Compose lint's ModifierDeclarationDetector crashes on
app-module factories with this AGP.
The chat polish shrank the code-block copy IconButton to iOS's 44pt,
breaking Android's 48dp minimum (CodeBlockLayoutTest on API 29/36).
Restore the 48dp slot; the quieter 16dp symbol stays, so the test now
pins 16dp artwork.
- versionCode is now `git rev-list --count HEAD`; the hapiVersionCode
property is gone. Builds without git fall back to 1.
- Official builds fail fast when git is unavailable or the clone is
shallow, since a shallow history undercounts.
- The official build workflow drops the version_code input, checks out
full history and names the artifact hapi-android-<versionCode>.
- Android and CLI READMEs describe the new rule.
ArchiveCleanupError no longer maps a cleanup timeout to 504 (tiann/hapi#2423), but the archive singleflight test added in tiann/hapi#2424 still expected 504, so syncEngineArchiveSession.test.ts fails on main. Expect 503, matching the new status mapping.
- Collapse the empty, unfocused composer to one row (+ / field / primary
action); anything in flight expands it, keeping one field instance so
focus survives.
- Bare 22dp tool symbols with tint-only states; send/stop is the only
filled 34dp circle, and stop uses the accent instead of error red.
- Composer card lifts off the canvas (composerSurface, hairline, light
shadow); context usage and permission mode share one compact row.
- Scheduled sends show a "Scheduled · …" capsule with a clear action;
tapping the clock no longer silently clears a pick.
- Queued messages become one inset card with one-line rows and icon
actions; slash/mention popups get 48dp rows, icons and mono commands;
attachment chips use vector symbols.
- Ctrl/Meta+Enter sends, gated exactly like the Send button.
- Tool summaries use monochrome symbols, a 15sp medium middle-truncated
title and a one-line secondary subtitle; success is quiet, running is a
neutral spinner, errors are a tinted chip.
- Groups lead with activity and total calls and count calls by kind
("2 reads · 1 search"), with running and error counts side by side.
- Pending approvals become a neutral card: hourglass status line with the
full-input link, filled Allow / outlined Deny via ChatActionButton, and
the submit spinner in the status slot; the duplicate "pending" chip is
hidden. Settled verdicts are symbol + label (glyphs dropped from strings).
- Codex plan actions share ChatActionButton.
- The inspector header shows symbol, friendly title, raw name, labelled
status and a selectable workspace path; empty results read "Waiting for
output…" / "No output"; Source has a disclosure chevron; group browser
rows form one card with inset hairlines and a category summary.
- Terminal output is selectable.
- Headings follow iOS sizes (24/20/18/17sp semibold) instead of collapsing
into body size; blocks are 12dp apart, 24dp before a heading and 8dp
after one; list items 8dp with first-baseline-aligned markers.
- Inline code is 14sp JetBrains Mono on a glyph-hugging rounded chip drawn
behind the text, instead of a span background filling the 24sp line box.
- Code block headers show the lowercase language in secondary mono caption
with a quiet 16dp copy symbol.
- Reasoning uses a rotating chevron + "Reasoning…" label (no emoji or
text arrows), a 32dp row with expanded/collapsed state semantics, and a
subdued body behind a hairline rule.
Lay the shared foundation for iOS-level chat polish:
- Typography tokens mirror iOS HapiTypography: zero tracking on body
slots, trimmed leading, strict CJK line breaking, row title/subtitle and
heading tokens; code uses bundled JetBrains Mono NL (OFL, no ligatures).
- Static schemes get hue-free surface ladders (Material's baseline tinted
every surface lavender) and the dark scheme sets onPrimary instead of
inheriting Material purple. NeutralChatSurfaces keeps conversation
surfaces gray under Material You; presets and OLED pass through.
- Extended colors add textSecondary, cardSurface and composerSurface.
- Material Symbols Rounded vector drawables (ic_sym_*) replace emoji and
text glyphs in later commits; ChatActionButton is the one inline action
style (48dp minimum, 10dp corners, one filled primary).
- Transcript rows use iOS TranscriptRowRole gaps instead of a flat 10dp.
- Roborazzi + Robolectric visual specimens (record on demand; Roborazzi
pinned to 1.60.0 because 1.61+ ships Kotlin 2.3 metadata).
* feat(usage): display CLI account quotas and rate limits across Codex, Antigravity, and Claude
* fix(usage): persist live quota state across processes and normalize agy usage
* fix(cli): isolate Claude quota observations by account and bound probe deadlines
* fix(usage): bind Claude quota events to producing session account and surface quota fetch errors
* fix(usage): preserve OAuth token isolation without email and surface Codex read failures
* fix(usage): skip host claude path lookup when test probe override is active