Commit Graph
1911 Commits
Author SHA1 Message Date
Haoyuan WangandGitHub d01acf994b feat(cli): read Claude plan quota on demand via get_usage (#2451) 2026-11-17 07:37:06 +08:00
Haoyuan WangandGitHub 02d1bf15b8 feat(web): show plan quota next to the composer context meter (#2452) 2026-11-17 07:27:31 +08:00
Junmo KimandGitHub 47b3fb6b7d perf(web): drive session-list activity indicators from one low-rate ticker (#2447)
* perf(web): drive session-list activity indicators from one low-rate ticker

* fix(web): keep one reduced-motion query for the ticker's lifetime

* fix(web): keep the model-error halo pulsing on the low-rate ticker

* fix(web): start each ping subscription at its own first frame
2026-11-16 19:51:31 +08:00
Ethan WangandGitHub 21e3dae860 fix(web): prevent translated confirmation submit buttons from crashing (#2448) 2026-11-16 19:51:01 +08:00
weishu 096563c584 Release version 0.36.1 2026-11-16 19:06:39 +08:00
weishuandHAPI 6cd6d375c0 fix(jobs): stop waking busy agents and gate session jobs to long work
Job wakes interrupted running turns: `deliverJobTerminalWake` only
special-cased inactive sessions, so an opted-in terminal job posted a
user message into whatever the agent was doing. Drop the wake when a
turn is running and settle the claim so a later idle flip cannot re-fire.

Those wakes also impersonated operator input — `sentFrom: 'webapp'`, a
bare user message with a "Verify the outcome and continue" imperative.
Tag them `hapi-system` and render them as a quiet status line in the web
chat instead of a user bubble with fork/retry actions. Drop the default
imperative; a prescription now has to come from `--wake-prompt`.

Agents attached jobs to short work (tests, builds, typechecks) because
the injected prompt was 2.1k chars of REQUIRED / MUST / FORBIDDEN. Replace
it with a decision rule: default is not to attach, never for work that
finishes in this turn, and run `hapi job --help` for the mechanics.

Co-Authored-By: HAPI <noreply@hapi.run>
2026-11-16 19:05:38 +08:00
weishu 8735877f24 fix(hub): initialize reflect metadata before passkey dependencies 2026-11-16 18:16:57 +08:00
weishu 8ff6bd12fa Release version 0.36.0 2026-11-16 17:36:27 +08:00
weishu b0b88780b1 chore(passkey): add the Play App Signing certificate for Android passkeys
Publish the app signing SHA-256 in assetlinks.json and accept its
android:apk-key-hash origin on every hub.
2026-11-16 17:31:09 +08:00
weishu 59a486ba88 feat: passkey sign-in for the iOS and Android apps
Native apps cannot follow a self-hosted hub's domain (entitlements and
asset links are fixed at build time), so they use one shared RP ID,
hapi.run, and every hub accepts it only from exact app origins.

- hub: `{"client":"native"}` on the passkey option routes selects the
  native RP; origins are https://hapi.run (iOS/macOS) and the official
  android:apk-key-hash values, extendable via HAPI_PASSKEY_NATIVE_ORIGINS
  (HAPI_PASSKEY_NATIVE_RP_ID for forks). Native login options restrict
  allowCredentials to this hub's passkeys. Accept a null
  authenticatorAttachment.
- website: publish apple-app-site-association (webcredentials for
  XJB862F92W.run.hapi.app) and assetlinks.json (get_login_creds for
  run.hapi.companion; signing fingerprint still a TODO placeholder).
- iOS: webcredentials:hapi.run, AuthenticationServices ceremonies,
  passkey-only sign-in on the pairing screen, Settings → Passkeys, and a
  passkey-session credential kind used by silent re-auth.
- Android: Credential Manager 1.6.0, the same flows and credential kind,
  and README notes on computing the apk-key-hash origin.
- docs: native passkey contract and user guide.
2026-11-16 17:24:04 +08:00
weishu 809967b7c6 feat: sign in to the web app with passkeys
Add WebAuthn passkeys as another way to obtain a web JWT, so the browser
no longer has to keep CLI_API_TOKEN after the first sign-in.

- hub: passkey_credentials table (schema v36), register/list/delete
  routes behind the JWT, unauthenticated login routes with one-time
  challenges, and a 30-day passkey session exchanged via POST /api/auth.
  Passkeys are bound to the registering namespace, the browser origin
  (same host or an explicit CORS origin; HTTPS or localhost), and an
  HMAC fingerprint of CLI_API_TOKEN, so rotating the token revokes them.
- web: "Sign in with a passkey" on the login screen, Settings → Passkeys,
  passkey auth source with silent JWT refresh, en/zh-CN/ru strings.
- docs: client contract, hub README, PWA guide.
2026-11-16 16:48:05 +08:00
weishu 8aebb908bf feat(codex): attach HAPI to external desktop runtimes
Add explicit macOS attach/detach workers independent of owned runtimes. Preserve external engine lifetime, native queues and settings, and fence history rewrites with durable projection checkpoints.

Guard owned resume and deduplication paths, add protocol and CLI-to-Hub regression coverage, and document the isolated ChatGPT desktop GUI acceptance results.

Refs #2427
2026-11-16 16:24:33 +08:00
Junmo KimandGitHub b9a2869f4e fix(web): collapse the Codex question note field until it is needed (#2446) 2026-11-16 06:57:36 +08:00
Junmo KimandGitHub 020b74bc95 test(web): locate the unread row the way collapsed groups now render it (#2445) 2026-11-15 20:57:37 +08:00
SSU-WEI HUANGandGitHub 6c38c50f1b fix(web): keep unread rows mounted when a collapsed project group is toggled (#2434)
* fix(web): keep unread rows mounted when a collapsed project group is toggled

A collapsed group drew its unread rows in a separate peek list and the
expanded group drew every row inside its CollapsiblePanel, so toggling the
group remounted those rows: on expand they faded in from opacity 0 and their
icon and spinner restarted; on collapse they showed twice while the panel
closed.

Render each group's rows once, each in its own CollapsiblePanel that is open
while the group is expanded or the row is a kept unread row. Toggling the
group now only folds the other rows. Spacing moves inside the panels so
folded rows take no room.

Fixes #2433

* test(e2e): count expanded project groups by header, not by open panels

Rows now have their own collapsible panels, so open panels no longer map
one-to-one to expanded groups.
2026-11-15 17:32:40 +08:00
Junmo KimandGitHub 6237e90b37 feat: import local sessions through one registry (Pi, OpenCode, Codex, Claude) (#2435) 2026-11-15 17:06:21 +08:00
Junmo KimandGitHub ef20ef8cc2 fix(web): keep keyboard unpin focus when the row reappears as an unread preview (#2443) 2026-11-15 17:05:44 +08:00
weishu 6e40a80235 fix(ios): make the chat keyboard easier to dismiss
`.interactive` keyboard dismissal only reacts once the finger reaches the
keyboard's top edge. The composer is a regular SwiftUI view above the
keyboard, not an input accessory, so the finger first had to travel past
the whole composer: a long drag before anything happened.

- Dismiss the keyboard after 32pt of downward finger travel on the
  transcript (once per drag; momentum and programmatic scrolls never
  dismiss). `.interactive` stays for drags into the keyboard.
- Tap anywhere in the transcript to dismiss. The tap does not cancel
  touches, so links, buttons and cards still respond; long press and
  text selection are unaffected.
2026-11-15 10:35:48 +08:00
Junmo KimandGitHub 2d0c8a7695 fix(opencode): show each OpenCode v2 model's real effort options, with one Default (#2439)
* fix(web): drop provider-default entry from dynamic reasoning effort options

* fix(cli): support OpenCode v2 /api/model variant lookup and Basic auth
2026-11-15 08:00:10 +08:00
9e85428913 test(web): use jsdom Web Storage under Node 25+ (#2438)
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>
2026-11-15 07:59:57 +08:00
Junmo KimandGitHub c180dd2544 feat(web): unpin a session from the list on hover (#2440)
* 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
2026-11-15 07:59:43 +08:00
9435b9aac2 feat(web): export and import browser settings (#2442)
* 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>
2026-11-15 07:59:17 +08:00
AnanovoandGitHub d27e276a65 fix(web): show background-only work as a static blue dot (#2412) 2026-11-14 20:13:42 +08:00
weishu abe1038cf7 Release version 0.35.1 2026-11-14 08:06:57 +08:00
OverbakerandGitHub 30835911fb feat(uploads): stream large session attachments via chunked uploads (#2429) 2026-11-14 07:48:04 +08:00
SSU-WEI HUANGandGitHub 6a19189cd8 fix(claude): deny pending permission requests when steering (#2432) 2026-11-14 07:47:48 +08:00
AnanovoandGitHub 58c9e80d85 feat(web): add include and exclude session search modes (#1801)
* feat(web): add include and exclude session search modes

* fix(web): restore focus after session search mode changes

* fix(web): keep session search popovers exclusive

* refactor(web): share session search mode matching

* fix(web): keep session search date-free
2026-11-13 18:51:15 +08:00
AnanovoandGitHub 80a5b94f8f feat(runner): add safe agent quota query infrastructure (#1787)
* feat: add runner-side quota query infrastructure

* test: cover usage query protocol contract

* fix: close quota query redirect and in-flight races

* fix: harden quota query cache and timestamps

* fix: restrict quota templates to read-only requests

* fix: harden quota credential and request boundaries

* fix: bind quota cache to credentials

* fix: retry quota failures after cooldown

* fix: require an active Codex provider

* fix: harden quota value parsing and redaction

* fix: close quota provider selection boundaries

* fix: resolve qualified Kimi provider defaults

* fix: continue Kimi config fallback when current is incomplete

* fix: isolate explicit Kimi profile fallback

* fix: bind provider credentials and URL safety

* fix: isolate Codex profiles and abort quota responses

* fix(usage-query): preserve case-sensitive Codex providers
2026-11-13 18:50:59 +08:00
f0ab4ba79d feat(cursor): detect inline model errors, surface, notify, and bridge (#878) (#987)
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>
2026-11-13 18:50:09 +08:00
JeeandGitHub a7e472bb39 refactor(cli): move media guidance into tools and infer job countdowns (#2416)
* feat(cli): render local Markdown links as attachments

* fix(prompt): auto-infer sleep durations and deduplicate MCP media guidance

* fix(prompt): rely on tools and attachment fallback instead of injecting media guidance into system prompt

* fix(attachments): gate fallback by session permission mode and track denied paths

* fix(pr-review): track permission denials, exclude sidechains, and support multi-arg sleep

* fix(attachments): canonicalize denied paths, track local Claude & Codex approvals, exclude sidechain

* fix(attachments): canonicalize symlinks, hook Cursor PermissionAdapter, process Pi/ACP terminal snapshots

* fix(attachments): recognize ACP display titles, block file-read denials, document relative countdowns

* fix(attachments): normalize ACP read permissions, track native Claude denials, align sleep instruction

* fix(attachments): normalize AcpPermissionHandler read denials without rawInput

* fix(attachments): preserve SharedCodexPermissions file read/display denials

* fix(attachments): recognize qualified MCP read tools and preserve terminal-resolved Codex denials

* fix(attachments): support multi-file path extraction, avoid duplicate web markdown images, guard terminal resolution

* fix(attachments): multi-file denial tracking, guard terminal Codex approvals, conditionally suppress web cards

* fix(attachments): nested multi-file denial extraction, resolve terminal Codex approvals, parent-relative image card retention

* fix(attachments): recursive multi-file path extraction, native Codex approval reconciliation, decode percent-encoded targets

* fix(codex): reconcile native execution in root.ts, track webApproval vs terminal denial

* fix(codex): verify thread ownership and successful execution before clearing denials in root.ts

* fix(codex): validate MCP result error envelopes and retain web cards for non-image targets

* fix(cli): support underscored MCP server names, accept null error on Codex success, and deduplicate across cold resumes

* refactor(cli): keep media delivery in tool contracts and remove link fallback

* test(cli): avoid assuming a typed MCP config description

* fix(cli): anchor inferred sleep countdowns to child launch
2026-11-13 18:49:36 +08:00
AnanovoandGitHub 6f959bbb00 fix(web): hide redundant machine labels on single-machine pinned rows (#1414)
* fix(web): hide redundant machine label on pinned rows

* fix(web): hide machine labels for filtered pinned rows

* fix(web): hide redundant machine label on pinned rows

* fix(web): hide machine labels for filtered pinned rows

* fix(web): hide machine labels on global pinned sessions
2026-11-13 18:49:20 +08:00
AnanovoandGitHub d832165073 fix(web): reuse existing PWA window for notification clicks (#1616)
* fix(web): reuse existing PWA window for notifications

* fix(web): restrict notification reuse to PWA scope

* fix(web): resolve notification routes within PWA scope

* fix(web): respect PWA subpath in router

* fix(web): always deliver notification routes to SPA
2026-11-13 18:48:57 +08:00
AnanovoandGitHub decbd58bb4 feat(web): add Alt+S shortcut to send messages (#1658)
* feat(web): add Alt+S send shortcut

* chore: retrigger PR checks

* fix(web): preserve printable Option characters for Alt+S

* fix(web): support logical Alt+S across layouts

* test(web): cover Alt+S during IME composition
2026-11-13 18:48:42 +08:00
1d6bc769c9 test(web): pin the residency fade off tooltip-bearing containers (#2375)
#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>
2026-11-13 18:48:21 +08:00
SSU-WEI HUANGandGitHub bb97a6512f fix(runner): verified exit must confirm stop despite unrelated protected wrapper (#2346)
* fix(runner): let verified exit confirm stop when only unrelated wrappers are protected

* test(runner): verified exit confirms stop despite unrelated protected wrapper
2026-11-13 18:48:00 +08:00
Junmo KimandGitHub 0684c77866 fix: retry the gap-recovery row refresh after a failure and advance idle progress on merged tool-call ticks (#2372)
* 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.
2026-11-13 18:47:27 +08:00
Junmo KimandGitHub acddadf194 fix(agy): keep empty edit/write strings and the question card's free-text limit (#2331)
* 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.
2026-11-13 18:47:11 +08:00
Junmo KimandGitHub 90fbb417ca fix(agy): concatenate ACP text chunks as deltas (#2332)
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.
2026-11-13 18:46:55 +08:00
Junmo KimandGitHub 3aac283bff fix(web): generate read-state operation ids without crypto.randomUUID (#2333)
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.
2026-11-13 18:46:37 +08:00
weishu a7fe2cdaf2 fix(android): compact sort & filter sheet and a clean date-range dialog
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.
2026-11-13 18:00:58 +08:00
weishu 35e4578245 feat(android): drop the inactive bar and status strip above the composer
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.
2026-11-13 17:49:03 +08:00
weishu 662b4739d1 feat(android): web-style copy / details / time row under agent responses
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.
2026-11-13 17:40:33 +08:00
weishu ac13d622b9 fix(android): soften the composer shadow
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.
2026-11-13 17:30:14 +08:00
weishu 893027c9e2 fix(android): keep the code copy action's 48dp touch target
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.
2026-11-13 17:06:43 +08:00
weishu 5f1516489b build(android): derive versionCode from the git commit count
- 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.
2026-11-13 17:03:06 +08:00
Junmo KimandGitHub c9686af735 test(hub): align archive cleanup timeout status with the 503 semantics (#2426)
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.
2026-11-13 16:51:44 +08:00
weishu 09f05a9e84 feat(android): refine the chat composer
- 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.
2026-11-13 16:43:14 +08:00
weishu b2f50a0f83 feat(android): redesign tool cards, approvals and the tool inspector
- 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.
2026-11-13 16:43:14 +08:00
weishu ab96d78861 feat(android): iOS-parity Markdown rhythm and reasoning disclosure
- 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.
2026-11-13 16:43:14 +08:00
weishu 0a8bb2ffc7 feat(android): neutral chat surfaces, symbol icons and reading tokens
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).
2026-11-13 16:42:32 +08:00