Commit Graph
1636 Commits
Author SHA1 Message Date
Junmo KimandGitHub ae147e85db feat(opencode): import local session history (#1677)
* feat(cli): list local OpenCode sessions over machine RPC

* feat(hub): import OpenCode sessions into HAPI

* feat(web): import OpenCode history from new-session picker

* fix(cli): derive OpenCode imported message ids from part ids

Random ids made every scan differ, so delta classification flagged
unchanged transcripts as diverged on re-import.

* fix(cli): surface unreadable OpenCode db as rpc error

A locked or unopenable opencode.db now fails the listing instead of
reporting an empty success; summaries normalize timestamps and the web
import toast counts only created or actually-appended sessions.

* fix(hub): fail closed on opencode re-import past live HAPI continuation

Imported entries must remain a strict prefix of the native transcript.
Insertions ahead of the imported boundary or new native messages after
the session continued in HAPI now fail closed instead of appending
duplicated or reordered history.

* fix(web,hub): apply selected launch config when importing OpenCode history

Pass the model, reasoning effort, and permission mode chosen in the
new-session picker through the import request and persist them on the
imported HAPI session via applySessionConfig, so reopen launches with
the visible selection instead of stale or default values.

* fix(hub,cli): preserve explicit launch resets and skip streaming parts on import

- Launch config keys are applied by presence, so explicit null/default
  selections from the picker must reach applySessionConfig to clear
  stale model, effort, or permission values on re-import. Requests that
  omit the fields entirely still leave persisted config untouched.
- Assistant text parts are mutable while a response streams. Mirror the
  live scanner gate and import only finished (time.end set), synthetic,
  or user text so an in-progress row can never be stored and later
  finalized as transcript_diverged.

* test(hub): fix launch-config reset assertions to satisfy strict types

* fix(cli): fail opencode transcript reads on query errors instead of partial snapshots

Swallowed SQLite errors could return a truncated message list that the
hub later rejects as transcript_diverged with no repair path. Full
transcript reads now propagate query failures; summary lastUserMessage
extraction stays resilient per message.

* test(cli): cover unreadable-part-table transcript read stays non-partial

* fix(hub): scope launch-config failures to the per-session import result

A thrown applySessionConfig call used to escape the bulk handler as an
unstructured 500 even though transcripts were already persisted. Catch
it per session and report it as a config_failed result so remaining
sessions in a bulk request still import.

Also cover the mid-transcript part-query failure with an injected
opener that rejects instead of returning a holey transcript.

* fix(cli): read opencode transcripts inside a deferred snapshot transaction

Messages and their parts were read in separate statements, so a
concurrent OpenCode write could leave a hole in the imported sequence
that positional re-import checks then reject forever. Wrap each full
transcript read in BEGIN DEFERRED/COMMIT with rollback on failure.

* fix(cli): follow machine path policy for OpenCode imports

* fix(web): use unified permission mode for OpenCode imports

* fix(opencode): harden session import consistency

* fix(hub): preserve metadata on rejected OpenCode imports

* fix(hub): refresh OpenCode import state under lock

* fix(hub): resolve OpenCode imports after locking

* fix(opencode): bind imported resume to source machine
2026-10-28 12:14:18 +08:00
SSU-WEI HUANGandGitHub 3f4bd9afea feat(web): show project in session header (#1635)
* feat(web): show project in session header

* fix(web): hide unknown worktree project paths
2026-10-28 12:14:04 +08:00
8b5cde7e44 feat(web): persist and send voice input message across session navigation (#1435) (#1436)
* feat(web): persist and send voice input message across session navigation (#1435)

* fix(web): address bot review findings for voice send across session switch (#1435)

* fix(web): resolve teardown, inactive session, send error recovery and mention serialization findings (#1435)

* fix(web): preserve draft initialText on error and handle async cross-session permission lookup (#1435)

* fix(web): preserve session draft on background failure and send via composer delivery policy (#1435)

* fix(web): send dictation directly via API and fix standard dictation language and recording support (#1435)

* trigger CI rerun for voice dictation session switch fixes (#1435)

* fix(web): prevent failed voice sends from clobbering replacement composer text (#1435)

* fix(web): prevent zero-byte recording failure from clobbering replacement composer draft (#1435)

* fix(web): prevent unmount voice transcription, clear draft on send success, and clear partial transcript (#1435)

* fix(web): stop button transcribes into composer without auto-sending; only send button triggers stopAndSend (#1435)

* ci: rerun CI for flaky claudeRemote test timeout (#1435)

* ci: retry flaky claudeRemote test (#1435)

* fix(web): guard dictation send path against attachments/schedule/connecting and protect newer drafts from late overwrite (#1435)

* fix(web): preserve Pi steer delivery mode for background dictation sends (#1435)

* fix(web): include active state in handleSend dependency array (#1435)

* fix(voice): surface MediaRecorder failures instead of transcribing partial audio

A MediaRecorder error can still be followed by dataavailable and stop
with partial bytes, so the previous onstop-only flow could transcribe
and auto-send corrupt audio. Track recorder.onerror and short-circuit
the stop handler: restore the draft and surface an error instead of
transcribing. Add a regression test for error -> dataavailable -> stop.

* fix(web): resume inactive sessions for voice dictation direct-sends

A voice dictation direct-send (mic -> send) posts the transcribed message
straight to the session, bypassing the text pipeline's inactive-session
resume. The hub rejects message POSTs to inactive sessions with 409
session_inactive, so sending to an archived session always failed (while
reopening it first made the same send succeed).

- stopAndSend now accepts { resolveSessionId, onSessionResolved } and
  resolves the target session after transcription, before the POST
- HappyComposer allows direct voice sends on inactive sessions when a
  resolver is provided (instead of downgrading to a plain stop), and
  threads SessionPage's canonical resolveSessionId + handleSessionResolved
  (the same ones the text send path uses) into the dictation hooks
- after the message is delivered to the resumed session, the UI
  navigates/seeds the live session; failed sends keep the existing
  draft-restore + error surfacing
- realtime dictation sends apply the same resolution

* fix(web): satisfy HappyChatContextValue in markdown-a test helper

Upstream 51ae260a added the required showSessionSummaryInChat field to
HappyChatContextValue but missed the markdown-a test helper, so web
typecheck (part of CI) fails at the upstream tip. Provide the field like
the sibling test helpers do.

* fix(web): expose a Send action during connected dictation

The visible composer button becomes Stop-only while dictation is
connected, so mouse/touch users could never reach the session-bound
stopAndSend path in handleSend (keyboard Enter was the only entry
point). Add an explicit Send button next to Stop when dictation is
connected; it routes through onSend('default') so the transcript is
captured to the target session and survives navigation (per #1435),
while Stop keeps its stop-without-sending semantics.

Addresses HAPI bot review on #1436.

* fix(web): hide dictation Send button when direct send is not eligible

The Send button shown during connected dictation only performs a real
send when handleSend's direct-send path runs; with attachments, a
pending schedule, or scratchlist mode it silently falls back to
dictation.toggle() (stop + transcribe). Gate the button on the same
eligibility conditions as handleSend so a visible Send control always
actually submits.

Addresses HAPI bot review (Minor) on #1436.

* fix(web): drop superseded markdown-a test context fix

Upstream merged its own showSessionSummaryInChat fix for the markdown-a
test helper; the duplicate property added for the pre-merge CI break is
no longer needed.

* fix(web): gate dictation direct-send on full attachment state and guard late navigation

- dictationDirectSendEligible now uses blocksScheduling (visible + hidden
  persisted + still-hydrating attachment drafts) instead of only the
  visible attachments array. An inactive composer keeps persisted
  attachment blobs out of the visible array, so the previous check could
  expose direct Send, resume the session, and POST only the voice text,
  stranding the blobs on the obsolete source session. handleSend's
  canDirectSend and the Send-button gate share one helper so they can
  never disagree.
- The voice send survives unmount by design (#1435); a send that finishes
  after the operator left the source session no longer navigates them
  back. handleVoiceSessionResolved only navigates when still on the
  source session's page.

Addresses HAPI bot review (Major + Minor) on #1436.

* fix(web): read live route state when a background voice send completes

The previous guard captured the render-time pathname; once the source
SessionPage unmounts, that captured value still points at the source
route, so a voice send that finishes after the operator left would still
navigate them back. Read router.state.location.pathname at callback time
instead (the router instance is stable; its state is always current).

Addresses HAPI bot review (Minor) on #1436.

* fix(web): recover post-resume send failures under the resumed session id

When a voice dictation send fails after the inactive session was already
resumed, the catch path persisted the retryable transcript under the
archived source session id — which the hub has superseded — so the
recovery was invisible on the live session. Save the draft under the
resumed id, and fire onSessionResolved so the operator is taken to the
live session where the retryable text lives. Applies to both standard
and realtime dictation.

Addresses HAPI bot review (Major) on #1436.

* fix(web): snapshot resumed-session draft before the post-resume send

The previous recovery guard read getDraft(targetSessionId) inside the
catch — after the send already rejected — so it compared the current
draft to itself and always overwrote text the operator typed into the
resumed composer while the request was in flight. Snapshot the resumed
session's draft at resolve time instead, so a newer draft is never
clobbered. Applies to both standard and realtime dictation.

Addresses HAPI bot review (Major) on #1436.

* fix(web): preserve both drafts when a post-resume send fails

When the operator typed a newer draft into the resumed composer while
the voice send was in flight and the send then failed, the recovery
guard correctly refused to overwrite the newer draft — but that dropped
the failed voice text entirely. Merge instead: append the failed message
after the newer draft so both remain recoverable. Applies to both
standard and realtime dictation.

Addresses HAPI bot review (Major) on #1436.

* fix(web): merge live composer text into failed voice-send recovery

Failure recovery previously read only the persisted draft store, but
while the composer is mounted its edits live in memory (session storage
is written only on unmount). If the operator typed replacement text
while transcription or delivery was pending, recovery either skipped the
composer restore (persisting only the voice text, which the later unmount
then overwrote) or clobbered the replacement. Recovery now reads the live
composer text when mounted and appends the failed voice text after it,
reseating the composer to the merged draft; the unmounted case merges a
persisted draft written since the snapshot. Applies to recording,
zero-byte, transcription, send, and realtime failure paths in both
dictation implementations.

Addresses HAPI bot review (Major) on #1436.

* fix(web): preserve dictation audio constraints

* fix(web): transfer follow-up drafts after voice resume

* fix(web): merge source drafts on failed voice resume

* Preserve resumed voice drafts and replace recovered composer text

Sample destination/source draft merges at persistence time; use a replacement callback for realtime recovery. Six regressions fail before the fix; 66 focused tests, all five package suites, typecheck and 16 Playwright checks pass.

* Recover delayed voice failures into the current composer mount

Resolve live recovery targets by session identity and update the draft ref synchronously before later unmount. Both standard/realtime remount regressions fail before the fix. 85 focused tests, full package suites, typecheck and 16 Playwright checks pass.

* fix: preserve live composer drafts after background voice success

Use shared transfer sampling for standard and realtime sends; update the mounted destination before navigation and unmount. Verified focused voice/transfer tests, typecheck, all five full package suites (CLI rerun serially), and 16 browser checks.

* fix: retain resumed voice follow-ups and destination attachments

Verified focused regressions, root typecheck, all five complete package suites (environment-sensitive failures rerun serially), and 16 browser checks.

* fix: preserve independent destination drafts during voice recovery

Cross-session recovery always retains destination text and independently merges source follow-ups. Remove destination baseline replacement from both hooks. Verified 72 focused regressions, root typecheck, all five full package suites (Hub rerun serially), and 16 browser checks.

* fix: preserve voice recovery drafts before composer hydration

Expose persisted draft text until hydration and update the text ref synchronously when restoring. Cover both voice modes with a held animation frame and intentional empty text after hydration. Verified 94 focused checks, full package suites, root typecheck, and 16 browser checks.

* fix(web): retain ElevenLabs finalization across navigation

* fix(web): preserve new same-text drafts across pending voice sends

* fix(web): refresh voice send callback after draft hydration

* fix(web): resolve voice destinations from current session activity

* fix(web): give voice direct-sends a localId so agent echoes dedupe

Voice dictation, realtime dictation and the cross-session voice tool sent
through api.sendMessage with localId null. Shared Codex then minted a
random clientUserMessageId for the turn and echoed the user message back
with it; the hub dedupes only on (session, localId), so every voice
message was stored and shown twice.

Route all voice sends through sendVoiceMessage, which mints the same
local-* id useSendMessage uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:13:53 +08:00
Junmo KimandGitHub 9e5d848796 fix(claude): announce automatic compaction when it starts (#2190) 2026-10-28 12:13:27 +08:00
261cb3bb6b test(android): pin composer attachment encode hop to the test scheduler (#2189)
The ComposerAttachments harness left the constructor default
encodeDispatcher (Dispatchers.Default, a real thread pool) in place.
With two uploads in flight the second-launched one can finish encoding
first, reach FakeUploadApi.uploadFile first, and consume the scripted
results deque out of launch order — the queued failure gets stolen by
the upload meant to succeed, so the robbed chip never settles to its
scripted state and items.first {} hangs until runTest's dispatch
timeout (UncompletedCoroutinesError, intermittent under suite load).

Pin the encode hop to the scope's own dispatcher (the runTest scheduler
in every test), making upload arrival order equal launch order
deterministically; upload still hops dispatchers as in production. Add
a regression-lock test scripting two results over two concurrent adds.

Product code is untouched: upload() keys results by attachment id and
is arrival-order independent — the ordering dependency lives purely in
the test fake's deque.


via [HAPI](https://hapi.run)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: HAPI <noreply@hapi.run>
2026-10-28 12:13:08 +08:00
ffd950a220 fix(codex): drop safe-yolo from Codex permission modes (#2183)
* fix(codex): drop safe-yolo from Codex permission modes

Every Codex session runs on the native shared runtime (runCodex is
runSharedCodex), which rejects safe-yolo. The mode stayed in
CODEX_PERMISSION_MODES and six filters hid it again in the web picker,
composer, hub permission-mode route, hapi set-mode and both native
apps. API callers that validate against the flavor catalog (e.g. a
spawn with permissionMode: 'safe-yolo') still passed it through and
only failed inside the runner.

Remove it from the Codex catalog (shared, iOS, Android, fixture) and
delete the filters. autoReview is the native replacement. Safe Yolo
stays for Gemini, Kimi and Copilot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ios): Codex option list now has four modes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:12:55 +08:00
fe2fbb881d fix: list Claude background tasks from the snapshot instead of guessing (#2177)
* fix: list Claude background tasks from the snapshot instead of guessing

The status panel only had a count from `background_tasks_changed` and
reconstructed commands by regex-matching Bash results in loaded chat
history, so tasks whose start message was unloaded, auto-backgrounded
("moved to the background (ID: …)"), or non-Bash showed
"N running · exact command unavailable".

The hub now keeps the snapshot's tasks (id, type, description) on the
session alongside the count. The web panel lists them directly, using
the exact task ID to look up the Bash command when loaded and the
snapshot description otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): only attribute a Bash command from its background launch result

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(native): accept backgroundTasks in strict session patch decoders

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:12:41 +08:00
40070a56db fix(claude): apply mid-turn permission mode switches and surface refused modes (#2173)
* fix(claude): apply mid-turn switches to auto/plan in the running process

Claude enforces auto and plan natively, so switching a remote session from
Manual to Auto during a turn only took effect after the next message
restarted Claude; the running turn kept asking for approval. Send
set_permission_mode to the live process whenever the native mode changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(claude): surface refused or fallen-back permission modes

Claude rejects set_permission_mode when auto is unavailable (e.g. disabled
by settings) and silently starts in default when launched with an
unavailable auto/plan. Both left the UI showing a mode that was not in
effect. Revert the session to the mode Claude actually runs and post the
reason in the chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(claude): ignore permission mode rejections superseded by later switches

A delayed rejection of auto could restore an older mode after the user had
switched away and back again, because staleness was checked by mode value.
Track each transition with a sequence number instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:12:21 +08:00
Junmo KimandGitHub 01f80e186a fix(peer-delivery): truthful accepted vs consumer-confirmed receipt (#2071)
ping-peer now sends a ping-peer- localId and reports hub-accepted instead
of delivered; the hub exempts those rows from the session-end synthetic
sweep so only a real runtime ACK confirms them; web shows pending vs
delivered badges only on peer rows, excluding failed, indeterminate and
scheduled states.
2026-10-28 12:12:04 +08:00
AnanovoandGitHub 116756e833 fix(web,cli): clarify archive cleanup progress and bound shutdown waits (#2061)
* fix(web,cli): clarify archive cleanup progress and bound shutdown waits

* fix(web): keep archive dismissal and delete waiting states consistent

* fix(web): scope archive subscriptions to active consumers
2026-10-28 12:11:52 +08:00
AnanovoandGitHub 2a612c5c72 perf(cli): reduce Windows process probes during session shutdown (#2046)
* fix(runner): prevent Windows process probes from blocking session lifecycle

* perf(cli): reduce Windows process probes during session shutdown

* test(cli): update PowerShell fixtures for complete process snapshots
2026-10-28 12:11:40 +08:00
AnanovoandGitHub 78472e1c78 docs(web): document session list and search behavior (#1984)
* docs(web): document session list and search behavior

* chore: retrigger PR checks

* docs(web): clarify searched group pagination
2026-10-28 12:11:27 +08:00
AnanovoandGitHub 4b3c5a4baf docs(api): clarify session ordering and client parity (#1983)
* docs(api): clarify session ordering and client parity

* chore: retrigger PR checks
2026-10-28 12:11:16 +08:00
Matvey RudoyandGitHub 2f72043c5e fix(web): keep tail following through layout-driven scroll (#1960)
Content growth and mobile-keyboard resizes increase the distance from the
bottom without any user gesture. handleScroll treated that as the user
leaving the tail and disabled auto-follow, so the session feed stopped
following new messages until it was scrolled down manually.

While tail-follow is active, treat a non-upward scroll as layout churn
and re-pin to the newest message instead of dropping out of tail mode.
Add regression tests for transcript growth and viewport shrink.
2026-10-28 12:11:06 +08:00
4d137acdcb perf(hub): index session-list future-scheduled lookups (schema v27) (#1949)
GET /api/sessions runs countFutureScheduledBySessionIds and
minFutureScheduledAtBySessionIds over every session id in the
namespace. No existing index matches the full predicate set
(invoked_at IS NULL AND local_id IS NOT NULL AND scheduled_at IS
NOT NULL AND scheduled_at > ? AND delivery_state = 'queued'), so
SQLite probes idx_messages_local_id — one pass over every local
message, twice per session-list refresh, even though the matching
set is almost always empty.

Add a partial index on (session_id, scheduled_at) covering every
constant predicate (schema v26→v27, base schema + step migration),
turning both lookups into a near-empty index range scan that also
serves the single-session variant. Measured on a long-lived hub
DB (~20k messages, 37 sessions): ~8-10ms per query → ~0.04ms.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-10-28 12:10:48 +08:00
Junmo KimandGitHub cd0b8e3589 fix(claude): stop locking Claude sessions to three hard-coded model aliases (#1948)
* feat(shared): derive Claude model choices from the CLI catalog

The choices are the rows of the claude CLI's own /model picker, in its
order and with its display names. The stored value is what
claude --model receives: an alias is resolved again each time the
session's claude process starts, a full id stays on its model, so
following and staying need no new field.

Effort support is read per model so a model switch can drop an effort
level the next model does not offer.

* feat(cli): discover Claude models from the CLI's initialize response

A machine RPC starts claude in stream-json mode, sends only an
initialize control request and reads the models it reports, so no turn
runs and no transcript is written.

claude --print runs a directory's project hooks and .mcp.json servers
without a trust prompt, so the probe starts from the home directory
with user settings only, no MCP servers and hooks disabled.

Successful catalogs are cached per claude executable for five minutes
and concurrent requests share one probe; failures are not cached.

* feat(hub): expose the Claude model catalog per machine

GET /machines/:id/claude-models forwards to the runner's
listClaudeModels RPC. A runner that predates the handler answers with
the stable rpc_target_missing code so clients can keep their built-in
list.

* feat(web): offer the machine's Claude models in the model pickers

The composer and the create-session form list the rows the machine's
claude CLI shows in its own /model picker, as it shows them. Built-in
presets the catalog does not list remain selectable after it.

Until the catalog arrives, or on a runner without discovery, the
built-in presets are shown as before. A saved Claude model is no longer
reset to Default when the built-in list lacks it; the create-session
form keeps it and marks it as no longer listed when the catalog
dropped it.

* feat(hub,web): keep Claude effort within what the selected model offers

For Claude sessions the model endpoint accepts an optional effort, so a
model switch and the effort it keeps reach the session as one config
change. Other flavors are refused: Pi, for one, commits the model
before its thinking level. When the machine's catalog says the next
Claude model does not offer the current effort, the composer clears it
in that same request. The create-session form drops such an effort
however the model was set, including a restored preference or draft.

Effort choices in both places narrow to the selected model's levels;
without a catalog every level stays available as before.

* fix(web): retry Claude model discovery after a failed probe

The machine answers a failed probe with success:false over HTTP 200.
The query cached that as an answer for its stale time, so a user who
signed in and reopened a picker within a minute still saw only the
built-in models. A failed probe is now a query error, which is not
kept, and the next picker to mount asks the machine again.

* fix(web): list only the Claude CLI's models once its catalog is known

The built-in presets were kept after the catalog so that a partial list
could not hide Opus. The catalog is the CLI's own /model list, though,
not a partial one, and the presets added entries the CLI does not show
(Sonnet 1M, Opus 1M, Fable 1M). With a catalog the list is now exactly
its rows; a saved model it does not list stays as the current model,
and New Session marks it as no longer listed. Without a catalog the
built-in presets are shown as before.

* fix(shared,web): list earlier Claude versions under Other models

Claude Code's model sheet shows each family's newest model first and
every earlier version under an "Other models" heading. The CLI's
catalog lists models in that order but does not say where the split
is, so the first row of each family is taken as its newest and later
rows of the same family as earlier versions.

The composer's model list and New Session's model select now show the
same two groups, keeping the CLI order within each. Nothing is folded:
every row stays one click away, as it does in Claude Code.

* test(web): pin that Claude 1M variants come from the CLI catalog

Claude Code 2.1.105, 2.1.200, 2.1.240 and 2.1.274 list a 1M choice as
its own catalog row (opus[1m], claude-fable-5[1m]); 2.1.303 and 2.1.310
list none, and on 2.1.310 opus and sonnet run with a 1M context window.
The catalog-only list therefore offers a 1M variant exactly when the CLI
does. Pin that and record why the built-in [1m] presets are not appended.
2026-10-28 12:10:36 +08:00
2b63091421 fix(runner): adopt untracked runner webhooks only from the reporting process generation (#1943)
* feat(cli): report the CLI process start marker in session metadata

The session webhook only names hostPid. A PID alone does not tell the
runner which process generation reported it: once the CLI exits, the OS
can hand the same PID to any other process, including another
runner-spawned CLI.

Add metadata.hostStartMarker, the reporting process's own start marker
(getProcessStartMarker(process.pid), the same probe the runner uses for
its resume records and the stop-session generation check).
buildSessionMetadata is the only place that sets hostPid, so every
bootstrap path (fresh, existing, lazy, shared Codex) reports it. The
runner uses it to decide whether an untracked runner webhook may be
adopted (decideUntrackedRunnerWebhook).

* fix(runner): adopt untracked runner webhooks only from the reporting process generation

Since #1911 the runner adopts an untracked `startedBy: 'runner'` webhook
(runner restart before the webhook; Claude has no HAPI id on argv) and
persists getProcessStartMarker(pid) of whatever currently owns hostPid,
so that a later stopSession can tree-kill that generation.

If the webhook is late - the reporting CLI has exited and the OS has
already reused its PID - the persisted marker belongs to a foreign
process, possibly another runner-spawned CLI. The generation check in
stopSession then passes and the foreign process tree is killed.

The webhook now has to prove the generation itself: the CLI reports its
own marker as metadata.hostStartMarker and decideUntrackedRunnerWebhook
adopts only when it matches the live PID. A marker that names another
generation, or a failed probe, is ignored without killing anything,
also on the webhook-timeout path: a proven mismatch means the PID is not
the ghost. A webhook without a marker (older CLI) is left untracked
instead of adopted blindly; the timeout kill for those CLIs is unchanged.

The integration test drives a real runner over its control server: a
webhook carrying the live marker is adopted, listed and stoppable; a
webhook with a stale or missing marker leaves the PID untracked and
alive, and stop-session reports unknown.

Follow-up to #1911 (#1910).

* fix(cli): probe the process start marker only for runner-started sessions

buildSessionMetadata probed getProcessStartMarker(process.pid) on every
bootstrap, terminal starts included. The runner reads
metadata.hostStartMarker only in the untracked `startedBy: 'runner'`
path (decideUntrackedRunnerWebhook); a terminal webhook never consumes
it, and neither do hub or web.

The probe is a synchronous spawn: `ps` on POSIX, `tasklist` plus a
PowerShell Get-CimInstance call on Windows, each with a 10 s timeout.
A terminal `hapi` start on Windows therefore blocked on a PowerShell
cold start before the session row existed, for a value nobody reads.
With shared Codex the probe also ran per /new and /fork on the event
loop shared by all sibling roots.

Set hostStartMarker only when startedBy is 'runner'; that is the one
case the runner evaluates. This narrows the earlier commit: every
bootstrap path reports the marker for runner-started sessions, not for
terminal ones.

* fix(codex): keep hostStartMarker in the shared runtime's runner webhook

The shared Codex runtime bootstraps its roots with reportStarted: false
and reports them to the runner itself, from root.session.getMetadata().
That is the hub's view of the metadata: the hub parses stored metadata
through MetadataSchema, so a hub that predates hostStartMarker strips
the field and the webhook arrives without it. The hub's update-metadata
merge never returns it either, so the loss lasts for the root's
lifetime.

With the generation check, an untracked runner-started webhook without
a marker is ignored instead of adopted. A runner restart (for example
the version handoff of a single-host upgrade, where the hub process
keeps running the old code) followed by /new or /fork in a long-lived
shared root therefore left the root unlisted and untracked, the very
situation the adoption from #1911 addresses. The Claude and lazy
bootstrap paths are unaffected: they report the local metadata.

Take the marker from the local bootstrap metadata instead. The opt-in
runtime integration test models the stripped hub view in its session
mock and asserts the reported payload still carries the marker. The
mock also gains the `on` subscription that SharedCodexRoot requires
since #1911, without which the suite's bind test could not run.

* test(runner): run the late-webhook suite in the serial integration project

lateRunnerWebhook.integration.test.ts starts a real runner and a
detached child process per case, but the default vitest project picked
it up and `bun run test` ran it in a parallel worker. Tests that spawn
runner process trees belong to the serial integration project
(vitest.integration.config.ts, CI job `integration`), as the config
comments and .github/workflows/test.yml require.

Include the file in the integration project, exclude it from the
default one, and remove the temporary HAPI_HOME of each case, which
was left behind in the temp directory.

---------

Co-authored-by: Benedict Groppe <195190800+BGGBTAC@users.noreply.github.com>
2026-10-28 12:10:21 +08:00
SSU-WEI HUANGandGitHub 3e68e29110 fix(codex): reuse live model catalogs and extend discovery cache (#1938)
* fix(codex): reuse live model catalogs and extend discovery cache

Closes #1937

* fix(codex): track relative model catalog changes

* fix(hub): expose missing Codex session model RPC code
2026-10-28 12:10:08 +08:00
db4ee82c80 fix(cli): release stdin before handing terminal to local-mode child (#1932)
* fix(cli): release stdin before handing terminal to local-mode child

hapi ships as a Bun-compiled executable, and Bun's tty.ReadStream keeps
an in-flight read on fd 0 even after process.stdin.pause()
(https://github.com/oven-sh/bun/issues/29126).

Remote mode reads stdin (Ink UI in raw mode, for the double-space
switch-to-local gesture). When switching back to local mode,
spawnWithTerminalGuard only paused stdin before spawning the agent TUI
with stdio:'inherit'. The parent's stale pending read kept racing the
child for console input and won: after a remote -> local switch the
agent TUI rendered but received no keystrokes at all — the input box
was dead and even Ctrl-C never reached it. Instrumented at local spawn
time: dataListeners=0, isPaused=true, but _readableState.reading=true.

Fix: destroy stdin outright before spawning the local child
(releaseStdinForChild) — destroy reliably stops the pending read where
pause() does not — and re-create process.stdin via
`new tty.ReadStream(0)` when remote mode starts again
(ensureLiveStdin, called from RemoteLauncherBase.setupTerminal).
hasTTY is now computed lazily since stdin may legitimately be
destroyed at launcher construction time.

Verified end-to-end on Windows with `hapi kimi` by injecting console
input via WriteConsoleInput and checking the agent session wire log:
remote -> double-space -> local -> typed message reaches the agent;
switch to remote again (double-space detection works on the
re-created stdin) -> local -> input works again. Direct local launch
unaffected. `bun run typecheck:cli` and the cli vitest suite pass.

* fix(cli): preserve piped stdin when releasing terminal for local child

Addresses review feedback on #1932: releaseStdinForChild() destroyed
stdin unconditionally, but destroying a piped stdin closes fd 0 and
starves the child spawned with stdio:'inherit'. The Bun stale-read
workaround is only needed for a TTY, so skip destroy() when stdin is
not a terminal; pause() suffices for pipes. Adds regression coverage
for the piped case.

---------

Co-authored-by: Naitian LIU <Liunaitian@users.noreply.github.com>
2026-10-28 12:09:49 +08:00
SSU-WEI HUANGandGitHub ebca96e575 fix(runner): confirm archived Codex root after tracking loss (#1930) 2026-10-28 12:09:26 +08:00
b450aa8236 fix(cli): discover DSH skills from the DeepSeek Harness home (#1916)
For the `dsh` flavor HAPI's `$` skill menu only scanned `~/.agents/skills`
and `<dir>/.agents/skills`, so skills installed under the DeepSeek Harness
home (for example `~/.dsh/skills/<skill>`, where the clawhub CLI installs
them) never appeared in the completion list even though DSH's own
skill-filesystem provider loads them.

Add the roots that provider uses, plus the `$DSH_HOME` override the other
supported agents already have: `$DSH_HOME/skills` for user skills and
`<project>/.dsh/skills` for project skills. The DSH integration (#1632) did
not extend the per-flavor skill roots, unlike the earlier per-agent
additions (#288/#482/#487 Claude and Codex, #1030 Grok, #1245 Copilot).

Verified with a temporary-home Red/Green check, three new unit tests, a real
DSH session in a Full test environment (its skills endpoint now returns the
previously missing skill), typecheck, build, and the Root
terminal-wrap-fidelity Playwright suite.

via [HAPI](https://hapi.run)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: HAPI <noreply@hapi.run>
2026-10-28 12:09:15 +08:00
8ae7f0aa7b fix(cursor): in-place relaunch when switching live session to Auto (#1909)
* fix(cursor): in-place relaunch when switching live session to Auto

When ACP does not advertise literal auto, switch to Auto by respawning
the same hub session under --model auto + session/load instead of
rejecting. Keeps #1819 CLI Auto pin semantics. Fixes #1908.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): widen in-place relaunch spawn model typing

Allow null/undefined rollback spawn models from resolveCursorSpawnModel.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): re-pin ACP session id after in-place relaunch load

If session/load returns a different agent id, update hub metadata the
same way as a fresh session so resume stays recoverable.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): coordinate message loop with in-place Auto relaunch

Await relaunch completion before prompting, re-read the live backend
after model apply, and publish this.backend only after session/load.
Addresses tip bot Majors on #1909.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): harden Auto relaunch against prompt races and cleanup

Hold promptInFlight before mode apply, end the loop if backend restore
fails instead of requeue-spinning, and discard late replacement backends
when session teardown has started. Addresses tip bot Majors on #1909.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): avoid continue-in-try circular typing; finish relaunch harden

Refactor mismatch requeue off continue-inside-try so typecheck passes,
keeping promptInFlight hold and teardown discard for #1909 tip bot Majors.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): preserve queued turns and Auto-review across relaunch failure

Requeue dequeued batches before ending when restore fails, and still
record Auto-review (slash after publish) when mode flips while backend
is null mid-relaunch. Addresses tip bot Majors on #1909 @ 9e5f241f1.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): defer hub ack until Auto relaunch has a live backend

Avoid acknowledging queued turns before a usable ACP process exists, and
reset Auto-review slash bookkeeping on in-place process replacement.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): recompute Auto-review spawn flag for replacement ACP

Slash bookkeeping after in-place relaunch must use the replacement
process's --auto-review arg, not the prior process's sticky flag.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): drop queued Auto-review slash when replacement has --auto-review

Cursor treats /auto-review as a toggle; leave no leftover slash for a
spawn that already enabled Auto-review via the CLI flag.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cursor): discard held Auto-review toggle after --auto-review relaunch

Mark internal toggles so queue reconcile and post-relaunch dispatch drop
only HAPI-generated /auto-review slashes, preserving user-sent commands.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-28 12:09:00 +08:00
2fb408e60b fix(web): synthesize answerable card for pending permissions dropped by the tracer (#1903)
A pending permission whose sidechain tool_use never makes it into the
rendered block tree leaves the session blocked with no answerable UI: the
attention indicator shows a pending request, but no card renders anywhere.

Root cause: the tracer drops sidechain messages it cannot attribute to a
parent Task/Agent call — no parentToolUseId on the message and no
prompt-holding sidechain root in the window (observed with background
subagents whose transcripts live in separate subagents/*.jsonl files and
whose initial prompt message never reaches the hub). The orphan-card
fallback in reduceChatBlocks then checked *raw transcript* tool ids, so
the dropped message still suppressed synthesis.

Check the final rendered tree instead (recursively, including blocks
nested under Task/Agent cards): any pending permission that is not
rendered anywhere gets exactly one synthesized, answerable card. This is
the approach suggested in #1073 itself.

Verified against a live session where 48 of 69 messages were dropped by
the tracer, including the pending WebFetch tool_use; with this change the
request renders as an orphan card and can be approved from the chat.

Refs #1073, refs #587.

Co-authored-by: zx-shi <shi@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-10-28 12:08:42 +08:00
MaizandGitHub b49c5d1dcb fix(cli): flush buffered ACP assistant text after an idle gap (#1898)
* fix(cli): flush buffered ACP assistant text after an idle gap

ACP gives no "text segment finished" signal for a turn's last text segment and AcpMessageHandler only emits buffered text at explicit boundaries or through the prompt-lifecycle drains. When neither arrives - a text-only turn whose prompt() never returns - the answer is held until the next user prompt.

Emit buffered text once the stream has been silent for TEXT_IDLE_FLUSH_INTERVAL_MS (1000ms). The idle flush defers while a reasoning block is open (keeps Reasoning above the answer) and while the buffer may be an unfinished control envelope (keeps the internal-event filter complete). A later boundary emits only the remainder, so no character is emitted twice.

* fix(cli): stream idle ACP text as snapshots under one stream id

An id-less idle emission could render a reordered or duplicated answer when a dedupe agent rewrites its buffer with a prefix, and a pause inside an open Markdown fence split the rendered answer into separate blocks.

Stream idle emissions as full-text snapshots under a stable stream id and finalize with the same id at the boundary, mirroring flushReasoning; the partial-watermark computation is removed. The control-envelope guard no longer assumes type is the first JSON key.

* fix(cli): skip interim idle text snapshots in local launcher displays
2026-10-28 12:08:26 +08:00
Sharad.andGitHub 7a29b60353 fix(test): use portable ps axeww in test-process audit (#1869)
* fix(test): use portable `ps axeww` in test-process audit

The audit ran `ps eww` which is terminal-scoped on macOS (and exits 1
without a controlling terminal, failing the whole CLI suite via the
global-teardown audit). The previously suggested `-eww` also breaks the
scan: macOS treats `-e` in SysV form as "all processes" and silently
omits the environment dump, so a marked test child is never detected.
Use the BSD full-dump form `ps axeww` (all users + tty-less + env +
unlimited width), which ports across darwin and procps-ng. Add a
regression test that spawns a real marked child and asserts the audit
finds it.

* test(audit): skip live-process detection test on Windows

The scan function short-circuits to an empty list on win32 where ps
axeww is unavailable, so the assertion that finds a live child can
never pass on that platform.  Skip it conditionally.
2026-10-28 12:08:09 +08:00
6ff9c35d58 fix(hub): advance the notify-cause resume watermark so ingest stays bounded (#1844)
Every assistant message that ends with an AGENT_NOTIFY_SUMMARY footer
re-ingests the work_ad cause from the session message store. When a
session runs many turns without a new invoked inbound (automation-style
runners), the sticky path copied the previous cause verbatim, which also
froze the resume point (causeSeq + causeCursorMessageId) at the original
inbound. Each subsequent notify then re-loaded and re-parsed the entire
session tail since that inbound — content decode is zstd + JSON.parse
per row, so the cost grows without bound as the session grows and
blocks the hub event loop for seconds per notify.

Measured on a self-hosted hub with a ~10k-message session whose last
consumed inbound sat at seq 891 (v0.29.1): every notify footer stalled
/health for ~4.7s and cost ~5000 page reads, repeating per notify. With
this change the first notify pays a one-time catch-up scan; the resume
point then advances past each assistant turn and subsequent notifies
complete in the low milliseconds.

- resolveWorkAdCause: on the sticky path, advance causeSeq and
  causeCursorMessageId to the current assistant message while keeping
  the cause identity (messageId/text/kind). The advance is skipped
  while unconsumed queued or unmatured-scheduled inbounds still sit
  below the watermark — those can mature into a later cause and must
  stay inside the scan window.
- loadMessagesForCause: when the cursor row was trimmed away by
  retention, resume after the numeric causeSeq watermark (validated
  against the session's current minimum seq) instead of degrading to a
  full session read on every later notify. A history move
  (mergeSessionHistory) empties the session and restarts its seq
  space, so a stale low watermark still selects the full read there.
- ingestNotifySummaryFromMessage: resolve the assistant seq by message
  id instead of scanning the loaded window, which after the watermark
  advance no longer contains the notify-bearing row.
- store: add getMinSeq helper for the watermark validation.

Co-authored-by: HAPI <noreply@hapi.run>
2026-10-28 12:07:54 +08:00
e5678f9761 docs(agents): add a bounded PR review-wait and auto-fix loop (#1816)
* docs(agents): add a bounded PR review-wait and auto-fix loop

Document how an agent should behave after opening or updating a PR:
wait on a per-HEAD window (30 min, 60s poll) for checks, reviews and
comments; auto-fix clear local feedback and push to the same branch;
stop and ask before product/scope/security/force-push changes; and
report honestly when a wait times out instead of burning context.

* docs(agents): clarify loop entry condition and unresolved-feedback carryover

---------

Co-authored-by: HongChenGG <HongChenGG@users.noreply.github.com>
2026-10-28 12:07:36 +08:00
AnanovoandGitHub 5d7e13fc5d fix(hub,cli): keep inactive file previews available through runner (#1727)
* fix(hub,cli): keep inactive file previews available through runner

* fix(cli): bound runner workspace file reads

* fix(cli): constrain runner git fallback pathspecs

* fix(cli): allow dot-prefixed workspace paths
2026-10-28 12:07:18 +08:00
AnanovoandGitHub ea12ff98c6 fix(web): align file preview content around scrollbars (#1726)
* fix(web): align file preview around scrollbars

* fix(web): smooth file preview gutter compensation

* fix(web): preserve file preview image viewer positioning
2026-10-28 12:07:02 +08:00
AnanovoandGitHub 35205ddb53 fix(web): keep mobile code gutters clear across renderers (#1720) 2026-10-28 12:06:50 +08:00
AnanovoandGitHub 1436c9d6a7 fix(web): improve fullscreen image preview toolbar layout (#1665)
* fix(web): improve fullscreen image preview toolbar layout

* chore: retrigger PR review

* fix(web): keep mobile fullscreen images within viewport

* fix(web): keep mobile fullscreen images within viewport
2026-10-28 12:06:37 +08:00
34c6832119 fix(web): keep machine health visible for single-machine layouts (#1664)
* fix(web): keep machine health visible for single-machine layouts

The sidebar redesign gated the machine filter bar behind >= 2 machines,
so a single-machine setup lost its only surface for machine CPU/RAM
health and session counts (#1259).

With exactly one machine there is nothing to filter, so render a compact
non-interactive summary row in the bar's slot instead: machine label,
session count, and inline CPU/RAM metrics — visible on touch layouts too,
since no hover is needed. Pointer users additionally get the same
capacity popup as the filter chips.

Fixes #1259

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>

* fix(web): show machine summary when the sole machine has no sessions

Address the review finding on #1664: the summary row was derived solely
from session groups, so a single-machine setup with zero visible
sessions (fresh install, or "active only" filtering) still hid machine
health — the exact regression #1259 reports.

Fall back to the sole machine from the machines list in that case; the
row then shows its label, a zero count, and inline CPU/RAM metrics.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>

---------

Co-authored-by: yellowdog01 <yellowdog01@users.noreply.github.com>
Co-authored-by: HAPI <noreply@hapi.run>
2026-10-28 12:06:22 +08:00
AnanovoandGitHub 0aec975434 fix(codex): gate history actions until native thread is ready (#1604)
* fix(codex): gate history actions until native thread is ready

* fix(codex): clear history capabilities during bootstrap

* style(codex): normalize CLI file line endings

* fix(codex): await history capability persistence

* fix(codex): restore goal status coverage

* fix(codex): await bootstrap metadata persistence

* chore: retrigger PR review

* fix(codex): scope metadata readiness flush

* fix(codex): gate metadata flush by stale history
2026-10-28 12:06:08 +08:00
AnanovoandGitHub 7a320d793a fix(web): consolidate tool card display settings (#1599)
* feat(web): add configurable tool grouping mode

* fix(web): default tool grouping to grouped

* fix(web): sync tool grouping mode in the same window

* fix(web): reset tool group ids when mode changes

* fix(web): consolidate tool card display settings

* fix(web): preserve tool chronology in grouped mode

* fix(web): preserve permission details across tool grouping

* fix(web): honor command aliases in detailed tool cards

* fix(web): preserve tool mode details and unseen state

* fix(web): refresh fixtures after tool group merge

* fix(web): keep protocol fixtures in grouped mode

* fix(web): preserve grouped tool defaults

* fix(web): prioritize ACP tool kinds

* chore: retrigger PR checks
2026-10-28 12:05:49 +08:00
AnanovoandGitHub b4f46f58bb fix(web): preserve shared turn layout and generated file downloads (#1543)
* fix(web): preserve wrapped inline code in shared images

* test(web): snapshot wrapped inline code export

* ci: cover shared turn export on Linux

* ci: cover shared turn export on Linux

* fix(web): preserve generated file controls in shared previews

* fix(web): ignore late shared file responses

* fix(web): keep shared file links keyboard accessible

* chore: retrigger PR checks

* chore: retrigger PR checks

* fix(ci): correct E2E workflow indentation

* fix(web): hide table scrollbars in shared image exports
2026-10-28 12:05:20 +08:00
AnanovoandGitHub e32eac84f5 fix(web): exclude in-progress sessions from unread counts (#2203) 2026-10-28 11:02:19 +08:00
xxfadandGitHub fe5950973f perf(codex): optimize session history import (#2206) 2026-10-28 11:02:06 +08:00
01da312458 fix(claude): use native ai-title for remote session titles (#2207)
* fix(claude): use native ai-title for remote session titles

Remote mode talks to Claude over the SDK stream, which never carries the
ai-title Claude Code writes to its transcript, so the first-result fallback
titled the session from the formatted prompt. With an attachment that prompt
starts with "@/tmp/hapi-blobs/..." and the 80-char cut left only the path.

On the first result, read the latest ai-title from the transcript; fall back
to the first prompt as typed, without attachment @paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(claude): derive fallback title from the delivered prompt

Recording the first enqueued text could title the session from a prompt
that was cancelled or edited before delivery. Strip the upload @path
references from the prompt actually delivered instead; upload filenames
have whitespace replaced, so each reference is a single token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:01:57 +08:00
f069eda79e fix(cli): follow Claude transcript relocated into a git worktree (#2208)
Claude Code moves the session transcript to the new cwd's project dir
when the session enters or leaves a git worktree. The local-mode scanner
pinned the launch project dir, so nothing reached the web until the
session left the worktree. Look the transcript up by session id across
project dirs when the known path is gone.

Fixes #1950

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:01:45 +08:00
57d09c9796 fix(hub): stop routine agent-state updates from bumping session updatedAt (#2210)
Accepted agent-state writes (Codex usage snapshots, controlledByUser,
request completion) set updated_at = now, so idle sessions showed
"just now" and reordered the web active-session list. Only advance
updated_at when the update adds a new permission request.

Fixes #1855

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:01:37 +08:00
weishu c6fae86c42 feat(ios): adapt layout for iPhone Duo
- Use the split navigation on foldable iPhones once UIHingeInteraction
  (iOS 27.1+) reports a hinge: unfolded shows sidebar + chat, folded
  collapses to the phone stack without recreating the chat.
- Side-by-side sidebar: drop the truncated inline "Sessions" title and
  move the filter beside the hub menu (also fixes iPad).
- Folded outer screen: drop the home title so the empty bar disappears,
  use the leading-aligned system title/subtitle in chat, minimize the
  chat title on scroll, and let the composer sit 16pt closer to the home
  indicator while the text field is unfocused.
- Qualify Markdown.Document, which is ambiguous with the iOS 27.1 SDK.
- test-transcript.sh picks the newest runtime that supports the device
  type (iOS 27.1 only ships iPhone Duo); split tests run on iPhone Duo.
2026-10-28 10:32:21 +08:00
weishu 3a9b5eefd1 docs: point users to the App Store and Google Play apps
The native iOS and Android apps are now published. Replace the
build-from-source install path with store links, mark the native apps as
paid and the Web/PWA as the free client, and add store buttons to the
website hero. Source builds remain documented for developers.
2026-10-28 10:32:21 +08:00
00bbbfa780 fix(claude): report thinking for local-mode sessions (#2209)
* fix(claude): report thinking for local-mode sessions

Local Claude sessions have no SDK stream, so nothing ever set the
session's thinking flag and the web UI showed them idle mid-turn.
Derive it from the local hooks instead: UserPromptSubmit/PreToolUse
turn it on, Stop/StopFailure/SessionEnd turn it off. Esc interrupts
fire no Stop hook, so the transcript's interrupt marker also clears
it, and leaving local mode always resets it.

Fixes #1864

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(claude): ignore interrupt markers from an earlier local turn

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:31:44 +08:00
eb49ccd62b fix(web): resolve relative Markdown links and images in file preview (#2211)
* fix(web): resolve relative Markdown links and images in file preview

The standalone Markdown preview rendered without the previewed file's path,
so relative .md links became inert and relative images resolved against the
web page URL. Pass the session file to the renderer and resolve relative
hrefs/srcs against its directory: links open the sibling file preview,
images load through the session file-read API. HTTPS images are unchanged
(direct browser load); paths that escape the root stay inert.

Fixes #1917

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): bound preview image reads and check workspace containment

Only read supported image types whose directory-listed size is at most
10 MiB, and require absolute resolved paths to stay inside the session
workspace so escapes remain inert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): keep session links and browsing context in Markdown preview

Resolve session references before relative file paths, and carry the
preview's origin/tab/query into relative file links so Back returns to
where the user entered from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:31:28 +08:00
weishu 85ccab1ac6 Release version 0.31.3 2026-10-27 14:23:48 +08:00
weishu 2ef7d5855b ci(release): publish npm packages via Trusted Publishing
Move npm publishing from the local release script to the tag-triggered
Release workflow, authenticated with npm Trusted Publishing (OIDC) so no
npm token is needed. Local `release-all` now only bumps versions, updates
the lockfile, commits, tags, and pushes.

- Add cli/scripts/publish-npm.ts: publish platform packages, wait until
  they are live, then publish the main package; skip versions already on
  npm so a failed run can be re-run.
- Drop the platform optionalDependencies from cli/package.json. The
  published main package gets them from prepare-npm-packages; the
  workspace copy only made bun.lock depend on not-yet-published versions.
2026-10-27 14:22:30 +08:00
weishu 7bf0e5bc35 Release version 0.31.2 2026-10-27 08:32:28 +08:00
65c8dc727a feat(android): session list date-range filter with activity-aware picker (#2141)
* feat(android): add session date-range filter with activity-aware picker

- Pure SessionDateRangeFilter port of the web SessionList.tsx semantics:
  strict YYYY-MM-DD parsing with calendar round-trip validation,
  [start local midnight, end local midnight + 1 day) windows anchored to
  the injected zone, session.updatedAt as the activity field
- M3 DateRangePicker dialog (opens on the selected start's month, Clear
  resets without closing) plus a lightweight recent-activity legend —
  declared divergence: M3 exposes no per-day decoration API, so the web's
  in-cell "has session activity" emphasis surfaces beside the picker
  instead; explicit Apply replaces the web's close-after-second-click
- Wired as a transient, unpersisted lens (web useState parity) applied
  before the machine scope; the activity-day set and machine chips both
  derive from the unfiltered list so filtering never hides alternatives
- Top-bar calendar action with active dot badge, active-range summary
  row with clear, date-specific empty state; strings in en/zh-rCN/ru
  (en-ru key order KEYSYNC clean)
- JVM tests: predicate window edges, DST spring-forward, zone-anchored
  midnights, strict parsing, VM lens combination and pre-filter
  activity-day derivation

Co-Authored-By: Claude Code <noreply@anthropic.com>
via [HAPI](https://hapi.run)
Co-Authored-By: HAPI <noreply@hapi.run>

* fix(android): refresh session date filters after timezone changes

* Deduplicate Android sessions before applying date filters

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: weishu <twsxtd@gmail.com>
2026-10-26 15:20:03 +08:00
JeeandGitHub aed99e22cf fix(codex): allow larger histories over shared WebSockets (#2171) 2026-10-26 15:14:45 +08:00
b8675110b1 feat(android): add scratchlist row move, copy, and delete-confirm actions (#2132)
* feat(android): add scratchlist row move, copy, and delete-confirm actions

Align the scratchlist entry card with the web client's per-row actions
(ScratchlistPanel inventory):

- Move up/down: adjacent swap, disabled at the list edges, local-only
  like web v2 — no protocol request; the next refetch restores hub
  `createdAt DESC` order (pure `ScratchlistEntryOps.moveEntry`).
- Copy: copies only entry.text via ClipboardManager (FullTextAction
  precedent), swaps the icon to a check for 1500 ms on success, single
  per-list copied state, silent no-op on failure.
- Delete confirm: texts strictly longer than 100 characters (web
  SCRATCHLIST_CONFIRM_DELETE_THRESHOLD, untrimmed length) confirm via
  AlertDialog before delete, both from the row and the editor sheet;
  shorter notes delete directly.

New en/ru/zh-rCN strings ship in the same commit.

Co-Authored-By: Claude Code <noreply@anthropic.com>
via [HAPI](https://hapi.run)
Co-Authored-By: HAPI <noreply@hapi.run>

* fix(android): guard saved scratchlist notes and restart copy feedback

* test(android): uniquely select scratchlist confirmation actions

* Fix Android scratchlist editor test targeting

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: weishu <twsxtd@gmail.com>
2026-10-26 15:14:17 +08:00