#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
* refactor(web): share the AskUserQuestion option row and pill button styles
Move the interactive option row and the footer pill button class into
askUserQuestionOptionCard so another footer can reuse the exact presentation.
Pure move, no behavior change.
* fix(web): show Waiting for your reply on pending question cards
A pending question keeps the 'running' tool state until its reply lands in
the transcript, so the card header counted an ever-growing Duration and the
detail dialog showed a 'Running…' result pill. Neither is true: the agent is
not working on the question, it is waiting for an answer.
For question tools with a pending permission (AskUserQuestion and
request_user_input, covering Claude, OpenCode, agy, Cursor and Codex), the
card header now reads 'Waiting for your reply' instead of the timing rows,
and the result pill follows suit. The tool state and fixtures are unchanged.
* fix(web): title Codex question cards with the question text
request_user_input questions carry no header field, so the card title was
always the generic 'Question' while the actual question hid in the subtitle.
When no header is present, use the question text as the title and drop the
now-redundant subtitle; a header (Claude-style payloads) keeps the previous
title/subtitle split, and multi-question batches keep the counted title.
* fix(web): drop the redundant header chip on single-question cards
The card title already shows the question header for a single-question
AskUserQuestion, and the footer repeated it as a badge ('Database' twice).
Render the header chip only for multi-question steps, where it labels the
current step and adds information.
* fix(web): request_user_input footer adopts the shared question option rows
Codex question footers rendered their own flat option rows (dot glyphs,
aria-pressed buttons) and default-variant nav buttons, visually diverging
from the AskUserQuestion card. Reuse the shared option row and pill button
styles so both question surfaces present identically; rows now expose the
same radio/checkbox roles and aria-checked state. Behavior (selection
rules, notes, dismissal) is unchanged.
* fix(web): render request_user_input option labels as Markdown
The shared option row renders titles and descriptions as plain text, but
request_user_input option labels and descriptions are authored as Markdown
(bold targets, code commands) and the footer's own rows used to render them
through MarkdownRenderer. Give the shared row an opt-in markdown mode that
keeps the compact spacing, and enable it for the request_user_input footer.
* fix(web): title CursorAskQuestion cards from the parsed question header
CursorAskQuestion renders through the AskUserQuestion footer but had no
knownTools entry, so its card title stayed the raw tool name. Now that the
single-question header chip is deduped against the title, a Cursor question
lost its header entirely. Share the question-tool presentation (header as
title, question as subtitle, minimal pending header) with Cursor payloads,
reading their title/prompt field names the same way the parser does.
* fix(web): translate tool.waitingForReply for zh-CN and ru
Both locales shipped the English copy. Use the same register as the
neighbouring strings: zh-CN '等待你的回复' (matches the 等待+object pattern of
the ready toast and the approval key) and ru 'Ожидание вашего ответа'
(noun form of 'Ожидание одобрения').
* fix(web): fall back to the Cursor request title for question card headers
A Cursor question whose descriptive title lives only on the request
(input.title) produced an empty header in the card presentation, so the
single-question card fell back to the generic 'Question' title while the
footer's header chip is deduped away — the request lost its descriptive
title everywhere. Route the CursorAskQuestion presentation through
parseCursorAskQuestionInput, which already applies the request-level title
fallback, keeping that fallback the single source of truth.
The job label, stale marker and progress/elapsed text shared one truncating
span, so a long label hid the parts that change. The label now grows only
into the space the status leaves, down to a small minimum, and the status
truncates only after that.
Closes#2391
via [HAPI](https://hapi.run)
Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: keep one stable HAPI session id per Claude conversation
Every terminal `hapi claude -r` minted a new HAPI session id for the same
Claude conversation; the hub then merged the duplicates after the fact and
deleted the older row, so links and peer references to it broke, and two
live duplicates hid one row in the web sidebar.
CLI: resolve identity before Claude starts (HAPI_SESSION_ID is fixed at
bootstrap). `--resume <id>` / `--continue` look up the owning HAPI session
and reopen it with the same id, handing an active remote session over and
refusing one controlled by another terminal; bare `--resume` uses the
`hapi resume` picker filtered to Claude. Rotated Claude ids are kept in
`claudeSessionIdHistory` so older ids still match.
Hub: schema v35 adds `session_redirects`; every merge that deletes a row
records old -> survivor, and client-facing lookups follow it (sockets and
job ownership stay strict). New `GET /cli/sessions/resume-target-by-agent`.
Web: a merged-away URL moves to the survivor instead of bouncing home, and
live Claude duplicates stay visible in the sidebar.
* fix: keep job-key remaps and hub-archived resumes working after redirects
Review follow-up for the stable session identity change.
- Job routes: the session lookup now follows a merged-away id to the
survivor, so `requestedSessionId` must stay the raw URL id. Otherwise a
colliding `<old id>/<key>` remap was bypassed and PATCH/DELETE/late PUT
through the old id hit the survivor's own job.
- Terminal resume of an inactive session now asks the hub to clear a
hub-authored archive first (`POST /cli/sessions/:id/prepare-local-resume`,
same clear as hub reopen), so `hapi claude --resume/--continue` (and
`hapi resume`) no longer exit on the #1911 existing-session guard.
* fix(cli): refuse an explicit Claude resume whose transcript is gone
Reopening the owning HAPI session drops --resume and hands the id to the
local launcher, which silently starts a fresh conversation when the
transcript is missing — under the existing HAPI id, title and history.
Check the transcript before any handoff or archive change and fail
explicitly instead.
* fix: follow merged-session redirects on /api only for clients that rebind
Native clients store a session detail under the requested id and drop SSE
events for any other id, so a merged-away id that resolved to the survivor
loaded history but never showed live messages.
`SyncEngine.resolveSessionAccess` is strict again by default; `/api` routes
follow redirects only with `x-hapi-follow-session-redirects: 1`, which the
web client (that rebinds to the returned id) sends. Native clients keep the
previous 404. CLI REST always follows. Job routes still keep the raw URL id
for key remaps under both modes.
* feat(codex): fill the round footer tok/s from app-server timing
Measure each Codex round's generation window the way agy rounds do: the
live turn span minus tool-execution and wait-for-the-user windows, over
the thread-cumulative output-token delta, emitted on the turn's
turn_duration so the round footer shows tok/s. Tool windows prefer the
app-server's own item timing (startedAtMs/completedAtMs/durationMs).
The token baseline is the last reported cumulative total: the CLI seeds
a thread it created in this process (thread/start) to zero, while
resumed and forked threads receive the app-server's attach-time usage
replay and stay unseeded, so inherited history is never counted as a
turn's output. Only the live root-turn feed reaches the ledger: history
replays re-project old items and must not settle a round. Permission
hooks keep timing waits for the user.
* fix(codex): seed gateway-created threads for the first-turn tok/s baseline
Native /new and /clear create threads through the gateway before/after
hooks, whose after() binds the fresh root without the zero usage seed
the runtime create path applies - so the new thread's first turn
captured a null baseline and never showed tok/s. Seed it there too,
same as create(): thread/start only, since forked threads receive the
app-server's attach-time usage replay instead (tiann/hapi#2379).
* fix(codex): keep the active generation ledger across a hub-only reconnect
SharedCodexRoot's session.onReconnect reset the whole projection, but a
hub reconnect only replays final history: the native turn keeps running
without a new turn/started, so dropping the ledger identity, baseline
and windows made generation.settle() return null at completion and the
round permanently lost its tok/s. Add projection.resetAfterHubReconnect
which replays without touching the ledger; the app-server reconnect
path keeps the full reset, because the resumed turn re-announces itself
and must re-measure from its own start (tiann/hapi#2379).
* fix(codex): seed fresh usage before session-ready releases queued input
The gateway thread/start seed ran in the after() hook, after the bind
wrapper had already activated the root: registerControls and
emitSessionReady open the input gates, so a queued Web prompt (or one
submitted on session-ready while the runner notification is delayed)
could start the thread's first turn before the zero baseline existed,
and seeding afterward could not repair that captured-null turn. Move
the seed into the bind wrapper right after root.bind, guarded by a
freshThread flag the create and gateway paths set for thread/start
only - forks keep their app-server attach-time replay baseline
(tiann/hapi#2379).
Self-hosted hubs are commonly reachable through several origins (an
edge-proxied domain and a direct one); cross-border interference can
randomly break TLS on either for hours. A runner pinned to a single
HAPI_API_URL sat dead through those windows.
When HAPI_API_FALLBACK_URLS is set, the machine client keeps a rotation
ring (primary + fallbacks) and, after HAPI_API_FAILOVER_AFTER (default 5)
consecutive connect failures, tears the socket down and reconnects
through the next entry. A successful connection on a fallback schedules
a return-to-primary attempt after 30 minutes. Without the env, behavior
is byte-for-byte unchanged.
The menu mixed three selection markers (hand-drawn checkmark images,
Toggle checkmarks plus icons, and a radio-like filled circle), so row
text started at different offsets, and the machine roster made the menu
scroll.
- Sort By and Show use inline Pickers; Active First and Unread Only are
plain Toggles. Selection now always uses the system checkmark column
and every row's text lines up.
- Machines move into a "Machine" submenu whose subtitle names the
current choice; each machine keeps its session count as a subtitle.