Commit Graph
847 Commits
Author SHA1 Message Date
1473fa1dfa merge: hapi upstream v0.36.5
Adopt fork preview/boundary and branch endpoints, GitHub PR awareness,
session external refs, queue batch aliases and the attached runtime's
history validation. The fork keeps its Session List/Row/Chat surfaces,
Claude/DSH import dialogs, goal controls and DSH Web runtime.

Notable resolutions:
- Codex projection compares replay payload identity while still carrying the
  fork's Hub persistence options; queue committed() now uses upstream's batch
  alias matching
- user messages are ACKed per accepted batch member, with the fork's replay
  createdAt/verifyPersistence path retained
- server keeps the fork's public studio/share middleware and one gzip
  middleware; upstream's static cache headers and HEAD handling are adopted
- settings keeps the fork's session-summary/teams/unavailable-agents rows and
  adds GitHub PR awareness
- iOS keeps the personal bundle id and local string catalog (Japanese catalog
  from upstream is not merged)

Validation: typecheck passes; suite 5971 pass, failures limited to the four
machine-specific macOS responsibility probes.

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

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-20 13:33:58 +08:00
81f0c0215c merge: hapi upstream v0.36.0
Adopt passkey login/management endpoints, attached Codex runtime gating and
the generic local-session RPC registry. The fork keeps its per-flavor Claude/
DSH/Pi/OpenCode import routes and dialogs, DSH Web runtime and custom Session
List/Row UI.

Resolutions worth knowing:
- schema is v36 with both passkey_credentials and the fork's studio/share
  tables; local stores remain alongside upstream PasskeyStore
- server mounts passkey login before auth and passkey management after, with
  the fork's guest/share middleware intact
- Codex root keeps local history sync/compaction and goal metadata while
  honoring host.attached: no bridge, read-only forks, attached refresh
- generic ListLocalSessions is registered in addition to the fork's per-flavor
  handlers; Claude transcript conversion accepts the fork's localId shape
- web keeps the local Claude/DSH import dialogs and manual upload path

Validation: typecheck passes; suite 5689 pass, failures limited to the
machine-specific macOS responsibility probes.

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

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-20 13:26:16 +08:00
1638bb8577 merge: hapi upstream v0.35.1
Keep the fork's DSH Web runtime, OpenCode goal/native-variant paths and
media uploads; adopt upstream model-error notifications, OpenCode rewind
gating, chunked upload endpoints, hub settings split and the ACP shouldSend
guard.

Notable resolutions:
- ACP prompt keeps the local runPrompt request hook, now with upstream's
  shouldSend option, numTurns and boolean result
- OpenCode dequeue keeps local goal-aware thinking and native variants inside
  upstream's runtime gate / conversation-history flow
- web attachment adapter intentionally stays on the local 50 MiB single
  upload path; hub/client chunked endpoints remain available
- removed the upstream DSH ACP model-probe test because the fork uses the
  Web runtime catalog

Validation: typecheck passes; suite 5600 pass, 6 fail (five macOS
responsibility probes in disclaimExec.darwin are environment-specific; one
obsolete DSH probe test removed).

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

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-20 13:19:03 +08:00
ed517bfc1f merge: hapi upstream v0.35.0
Preserve the fork's teams, session groups, widgets/Live Activities, skins,
DSH steering and custom Claude models while adopting upstream session-attached
jobs, tri-state pin policy, presence badges, ACP prompt timing, agent quotas
and the usage parser version.

Resolutions worth knowing:
- schema ladder is now v35; local v31→v32 chat attachments and upstream's
  session-jobs step coexist, and v32→v33 installs jobs for existing fork DBs
- store keeps local Studio/live-activity/share/attachment stores alongside
  upstream SessionJobsStore and SessionRedirectStore
- DSH steering stays enabled through upstream's capability map
- iOS keeps personal bundle ids, grouped sections and widgets; upstream's
  presence badge, job line, sort order and Filter menu are integrated
- team tools and peer spawn remain, now gated by enabledTools

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

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-20 13:06:05 +08:00
weishu 590a9533c9 Release version 0.36.5 2026-11-18 12:55:16 +08:00
e55d29c056 feat(session): opt-in GitHub PR awareness + explicit attach (#1163)
* feat(session): structured externalRefs + list PR chip

Add optional metadata.externalRefs for durable session↔GitHub PR
identity and a clickable primary-PR chip on session list rows, plus
GET /api/sessions/:id/external-refs. Fixes titles-as-identity hacks
without title parsing (tiann/hapi#1160).

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

* fix(session): validate external PR URL identity

Prevent structured PR chips from linking outside the declared GitHub repository and pull request.

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

* fix(session): preserve externalRefs on merge + restore row focus group

Carry forward metadata.externalRefs when consolidating into a replacement
session row that omitted them (explicit new values still win). Move
group/session-row back onto the focusable list button so keyboard tooltips
reveal correctly (PR #1161 review).

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

* fix(session): carry forward externalRefs on bootstrap/metadata write

Preserve metadata.externalRefs when CLI pickExistingSessionMetadata and
hub updateSessionMetadata receive sparse replacements that omit the
field; explicit incoming refs (including []) still win. Closes the
resume/bootstrap data-loss path left after mergeSessions (PR #1161).

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

* feat(session): opt-in GitHub PR awareness and explicit attach

Add hub githubPrAwareness (default off), features API, PUT/CLI external-refs
write path, Settings toggle, link dialog, hapi link-pr, and MCP link_pr so
sessions can attach to PRs without title scraping. Depends on #1161 schema.

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

* feat(session): cache PR status on externalRefs for chip display

Extend GithubPrExternalRef with optional status/statusCheckedAt/statusAction
so Meta can write classifier health onto the attachment. Chip renders emoji
+ #N with status tone. Fixes link_pr tool-list expectations in MCP tests.

Part of tiann/hapi#1162 / #1163 (awareness + state in one PR).

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

* test(web): mock AppContext for General settings language test

SettingsGeneralPage now reads githubPrAwareness via useAppContext /
useFeatures; wrap the settings page suite with mocks so the language
inline test stops throwing AppContext is not available.

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

* fix(web): put PR chip left of session list time

Chip was a trailing sibling outside the row button, so rows with chips
shoved the relative-time column left. Keep time as the stable trailing
meta; optional chip sits immediately before it.

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

* fix(web): mute PR chip when statusCheckedAt is older than 2h

Cache honesty for Meta-filled externalRefs — never live-query GitHub from
the browser; stale chips show ? and a muted tone.

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

* fix(web): use relative ago in PR chip tooltip title

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

* test(web): keep companion baseUrl when mocking AppContext for features

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

* feat(session): forge-native PR chip snapshot + estate display profile

Replace Meta babysit status enums with GitHub-shaped openState/checks/merge
plus opaque estateCode. Chip terms (emoji, action prose) come from
$HAPI_HOME/pr-chip-display.json served on GET /api/features.

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

* fix(hub): use bun:test in prChipDisplay tests

Hub package typechecks include *.test.ts and has no vitest types;
CI failed resolving 'vitest' from the forge chip display suite.

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

* feat(web): compact PR chip to emoji; details on hover/long-press

Session list chips show status glyph only (estate emoji, or PR/?) so
multi-digit numbers stop crowding the row. Full repo#N + status copy
moves to HoverTooltip (desktop hover/focus) and touch long-press.

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

* fix(web): show PR detail in session action menu, not chip long-press

Keep desktop HoverTooltip on the compact emoji chip. Mobile long-press
stays on the session row; linked PR identity/status now tops that menu.

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

* fix(web): chip-specific hover tooltip + emoji in PR menu header

Keep HoverTooltip scoped to the PR chip (not row), unclip overflow, and
front the same status glyph in list long-press and session ⋯ menus.

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

* fix(cli): give claudeRemote first-result test a 15s CI timeout

Same flake as sibling cases under full-suite load; default 5s timed out
twice on #1163 after upstream merge.

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

* fix(cli): drop duplicate vitest timeout after merge

Upstream #1493 uses it(name, { timeout }, fn); the merge also kept the
legacy third-arg timeout, which Vitest 4 types reject.

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

* fix(hub,cli): address Codex Majors on PR awareness

Owner-gate PATCH /features, persist githubPrAwareness via updateSettings,
and fail MCP link_pr unless flushMetadata keeps the ref.

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

* fix(cli,web,shared): close remaining Codex findings on #1163

Gate MCP link_pr on hub awareness, upsert externalRefs, mark undated
chip snapshots stale, and hide the settings toggle from tenants.

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

* fix(hub,cli,web): CLI features probe + preserve secondary PR refs

Expose GET /cli/features and /cli/sessions/:id/external-refs for CLI
auth, upsert primary links in hapi link-pr and the web dialog, and tick
chip/menu staleness on a minute clock.

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

* fix(hub,cli,web): atomic external-ref upsert + create-session gate

Hub merges refs inside the metadata-version retry loop; CLI/web call
upsert/remove-primary instead of snapshot PUT. Strip externalRefs on
CLI create when awareness is off; list chips are display-only in the
row button.

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

* fix(shared,hub,cli): preserve PR health cache on same-identity upsert

Re-linking an already-linked github_pr was wiping openState/checks/merge
snapshots. Merge identity fields instead of replace-on-upsert.

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

* fix(shared,cli): case-insensitive PR identity + valid source fixtures

Treat owner/repo as case-insensitive on upsert/re-link so cached health is
not dropped, and keep regression fixtures within agent|user|inferred.

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

* fix(cli): initializeToken before hapi link-pr hub calls

Match ping-peer/inspect-peer so settings.json auth and apiUrl load
before getAuthToken/axios; keep --help free of prompts.

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

* fix(cli): omit link_pr from standalone hapi mcp defaults

Keep awareness opt-in: internal bridges still pass --tools after hub probe.

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

* test(cli): match default MCP tool registration order

list_peers registers after ping/inspect on the stdio bridge.

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

* fix(cli,shared): exact link_pr auto-approve + single primary refs

Stop substring/call-id matching for link_pr, and reject multi-primary
externalRefs at the Metadata/PUT schema boundary.

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

* fix(web): drop duplicate showSessionSummaryInChat in markdown-a test

Upstream merge left a duplicated mock field that broke tsc.

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

* fix(#1163): cap externalRefs count and disable env-pinned PR toggle

Bound externalRefs at 32 in schema + socket update-metadata ingress;
forward disabled on SettingsSwitch when HAPI_GITHUB_PR_AWARENESS pins the hub.

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

* fix(#1163): validate mutate externalRefs + hapi-scoped link_pr approval

Re-parse upsert transforms with ExternalRefsSchema before persist; only
auto-approve link_pr when MCP server provenance is hapi or the tool name is
a verified HAPI bridge identity.

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

* fix(#1163): trust HAPI link_pr provenance from envelope only

Auto-approve link_pr variants only when trustedHapiMcp is set from MCP
elicitation envelope serverName, not from tool arguments. ACP no longer
reads forged serverName from rawInput; HAPI mcp_tool_call approvals route
through the permission handler instead of blanket bridge auto-accept.

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

* fix(#1163): outer envelope only for trusted HAPI MCP provenance

Do not treat nested elicitation request.serverName as trusted identity;
poll features query so hub-global githubPrAwareness updates reach other tabs.

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

* fix(#1163): reject duplicate external ref identities in schema

Case-insensitive github_pr repo+number pairs cannot appear twice in
externalRefs; prevents upsert health merge depending on array order.

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

* fix(#1163): bound repo slugs, hoist PR polling, toggle errors

Cap GitHub repo slugs at 140 chars; share one features query and minute
clock across session list rows; surface githubPrAwareness toggle failures.

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

* fix(#1163): hub upsert link_pr + read-only untrusted gate

MCP link_pr uses atomic hub upsert (no metadata flush retry loop); block
untrusted link_pr auto-approve in read-only mode.

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

* fix(#1163): authoritative hub upsert + merge retry + 400 invalid refs

Stop replaying stale externalRefs through CLI metadata after hub upsert;
recompute merge metadata from the latest target row on version retry;
map ExternalRefsSchema failures to 400 on upsert routes.

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

* fix(#1163): fail merge before deleting source on metadata contention

Use METADATA_RETRY_ATTEMPTS for carry-forward metadata during session
merge; throw if externalRefs never commit so the source row is not deleted.

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

* fix(#1163): merge metadata before moving source-owned rows

Run carry-forward metadata merge before messages, scratchlist, and
attachments transfer so a failed merge leaves the source intact.

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

* fix(#1163): validate externalRefs on CLI session create

Share externalRefsInMetadataValid between socket and REST session
ingestion so malformed metadata.externalRefs returns 400 before persist.

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

* fix(#1163): reject non-boolean githubPrAwareness in settings.json

Match serverChanBackgroundOnly: Boolean("false") is true and would
silently enable the opt-in PR-awareness flag from a hand-edited file.

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

* fix(#1163): reveal nested PR chip tooltip on session-row focus

Non-interactive chips sit inside the row button as spans; wire
SESSION_ROW_TOOLTIP_FOCUS_CLASS so keyboard focus shows the tooltip.

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

* fix(#1163): keep raw metadata when linking PR on unparsed rows

mutateSessionExternalRefs reads the on-disk metadata blob instead of
cache-null fallback so link/unlink cannot wipe name/summary/worktree.

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

* fix(#1163): prefer merge conflicts over passing checks on PR chip

Candidate forge keys now rank conflicting/blocked merge ahead of
checks.pass/pending so the chip cannot look healthy when unmergeable.

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

* fix(#1163): localize PR chip detail strings for zh-CN

Map default forge labels and checked/stale/linked through i18n so tooltips
are not mixed-language; pass estate labels through unchanged.

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

* fix(#1163): prefer terminal PR openState over clean/pass chip

Merged/closed/draft snapshots must not show "ready to merge" when the last
poll still has clean+pass. Also localize aria-label status via the same
forge-label map as tooltips.

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

* fix(#1163): a11y label and i18n for Link PR invalid input

Give the PR field an aria-label and show localized invalid-input copy
instead of English parseGithubPrInput errors in the dialog.

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

* fix(#1163): gate PR awareness switch; expose nested chip to AT

Disable the settings toggle until features load so owners cannot flip a
placeholder off state. Nested session-row chips use sr-only detail so the
focused row announces PR identity and status.

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

* fix(#1163): refresh MCP link_pr catalog when awareness flips

Re-fetch hub githubPrAwareness for each new HTTP MCP session and invalidate
stale sessions so listTools picks up the toggle without restarting the
Happy server. Stdio --tools remains spawn-scoped.

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

* fix(#1163): gate link_pr at call time without killing MCP sessions

Keep link_pr in the HTTP and stdio catalogs under dynamic awareness, and
re-check the hub flag on each call. Avoids 404ing the stdio bridge session
when Settings toggles awareness mid-run.

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

* fix(#1163): hide MCP link_pr via enable/disable when awareness flips

Keep HTTP/stdio transports alive; toggle RegisteredTool visibility from hub
settings and sync the Codex stdio catalog without killing cached sessions.

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

* fix(#1163): avoid link_pr list_changed loops; poll idle HTTP clients

Only call RegisteredTool enable/disable on actual visibility transitions.
Add a bounded awareness poll so Claude HTTP MCP learns Settings flips
without a client request, and cover idempotent + poll-only transitions.

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

* feat(#1163): accept GHES hosts for GitHub PR external refs

Fold the upstreamable multi-host parser core into PR awareness: validate
github.com and *.ghe.com (plus configureGitHubHosts inject), preserve forge
host in parse/build/upsert, and relax schema URL matching accordingly.
Browser-safe — no operator YAML or Meta tooling in this change.

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

* fix(#1163): keep GHES host through attach + PR identity

Pass parsed.url from UI/CLI/MCP builders, and key identity/dedupe on
host+repo+number so github.com and Enterprise PRs with the same slug
do not collide or share cached health.

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

* fix(#1163): typecheck link-pr GHES attachment test

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

* fix(#1163): assert GHES link-pr body via toHaveBeenCalledWith

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

* fix(#1163): do not auto-approve link_pr in read-only mode

Trusted HAPI MCP provenance must not bypass read-only permission mode
when linking a PR; leave the write pending for user approval.

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

* fix(#1163): make list PR chip open its PR and show #N

Render the session-list chip as a sibling link beside the row button
(no nested interactive content) and include the PR number in the
compact glyph so operators can tell which PR is linked at a glance.

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

* fix(#1163): drop invalid host from SessionList PR chip test

SessionSummaryMetadata has no host field; CI typecheck failed on the
fixture metadata literal.

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

* fix(web): put session-row focus group on the row button

Restore group/session-row on the focusable button so attention and
schedule HoverTooltips still reveal under group-focus-visible.

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

* fix(#1163): align stdio default-tool test with peer/session_job catalog

Standalone MCP defaults now include spawn_peer and session_job; keep
asserting link_pr stays opt-in.

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

* fix(#1163): match merge metadata failure tests to preserve contract

SessionCache throws "Failed to preserve session metadata during merge"
after exhausted retries / store errors; update hub expectations.

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

* fix(#1163): prompt for Codex link_pr instead of native auto-approve

Native approval_mode approve bypassed BasePermissionHandler's read-only
guard; prompt so linking a PR still requires permission in read-only.

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

* fix(#1163): satisfy typecheck on link_pr approval regression

Avoid optional tools property access that failed cli tsc under strict
null checks.

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

* fix(#1163): align archive timeout assertion with 503 Cloudflare contract

Upstream #2423 maps ArchiveCleanupError timeout to 503 (not 504) so
Tunnel keeps JSON bodies; update the missed singleflight assertion.

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

* fix(#1163): memoize session-list PR clock between minute ticks

Avoid sampling Date.now() every render so memoized SessionItem rows
do not rerender on unrelated SSE updates when awareness is off.

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

* fix(#1163): preserve machine-spawn stub when attaching a PR

External-ref metadata writes used to clear the preallocation tag, so
adoptPreallocatedSession failed after an early link. Pass
preservePreallocation and cover stub → link → adopt.

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

* fix(#1163): size PR chip padding from quick-action span

Pinned active rows show Unpin + Archive; reserve the CSS action span
so the chip no longer overlaps Unpin and steals clicks.

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

* fix(#1163): align quick-unpin unread focus test with #2434 panels

session-group-unread-peek was removed when collapsed groups kept unread
rows in per-row CollapsiblePanels; update the #2443 focus assertion.

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

* fix(#1163): unblock passkey browser CI after shared-RP rematch

Playwright route.fulfill drops Location fragments on 3xx, so the
callback never received #state/#code and the opener hung. Apply the
fragment via a document navigation in the harness. Also reuse the
parsed complete form body instead of reading the request twice.

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

* Revert "fix(#1163): unblock passkey browser CI after shared-RP rematch"

This reverts commit 0092ea4b8c69add993fdd2f4b3da411eca641364.

* Revert "Revert "fix(#1163): unblock passkey browser CI after shared-RP rematch""

This reverts commit 1094372855204375a72101c07fa06f70a1aefdd7.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 12:53:26 +08:00
Junmo KimandGitHub e57df1822a feat: preview forks and rewinds with the boundary the fork will use (#2421)
* refactor(hub): resolve fork and rewind boundaries in one place

Move selectForkTranscriptPrefix into forkBoundary.ts as the single home
for fork and rewind boundary resolution. Fork execution keeps calling
the same function with identical behavior; the forkTranscript module
and its tests move with it, so the next boundary consumers (preview,
token validation) extend one resolver instead of forking the rules.

* feat(shared,hub): read-only fork preview with a boundary token

Add POST /sessions/:id/fork-preview: the hub resolves the preview mode
from the live session (a running Codex with a verified completed turn
previews through it), runs the same admission guards as confirm without
taking the history-action lock, and answers with the kept tail rows,
the excluded rows, counts, and a boundary token.

Confirm accepts the token back on fork and rewind. The public wrappers
re-check it right after the history-action lock: an epoch change, new
invoked rows, or a source that started running since the preview reject
with 409 boundary_moved so the caller re-previews instead of forking a
transcript it never saw. Clients that send no token keep the legacy
behavior, and a latestCompleted preview fails closed on runners that do
not advertise the forkPreview capability, because answering it from hub
rows is the drift this replaces.

* feat(cli): codex shared runtime answers and pins its fork boundary

Add the PreviewForkBoundary RPC: the shared runtime reads its native
history and answers where each fork mode cuts - latestCompleted through
latestCompletedForkCutoff, current through the last turn (falling back
to the completed cut once a turn runs), message through the projected
turn with the steered-cut clientId rule - and names the first excluded
hub row so the hub cuts its preview tail at the same place.

Confirm accepts a preview-pinned lastTurnId: the runtime re-verifies the
turn still exists with a completed native prefix and forks through that
fixed inclusive cutoff instead of re-deriving a moving one, so a turn
that starts between preview and confirm cannot drift the boundary. The
capability is advertised as conversationHistory.forkPreview.

* feat(web): fork preview dialog fed by the hub

Replace the web-side fork boundary mirror with the hub's preview
answer: useForkFlow asks POST /sessions/:id/fork-preview, renders the
returned kept tail and excluded boundary through the regular
normalize/reduce pipeline, and confirms by echoing the boundary token.
A 409 boundary_moved refreshes the preview in place and demands a
re-confirmation, a source that starts running while the dialog is open
re-answers through the hub, and an older hub (404) falls back to the
legacy confirm dialog. forkPreview.ts keeps only the compact text
shaping; its cut rules are gone. SessionChat and SessionList share the
flow, the MessageActions fork button invokes it directly under the
message-fork testid, and the dialog's confirm stays accessible as
Fork. en and zh-CN locales and the e2e fixture/spec come along.

* feat(web): rewind preview dialog

Route rewind through the same hub-fed preview: the MessageActions
rewind button opens the rewind variant of the fork preview dialog,
which emphasizes the region the source would delete (destructive
styling, struck-through rows, and a truncation count) before confirming
with the boundary token. The runner-side fork-safe ambiguity still
offers the fork-at-boundary fallback, an older hub falls back to the
legacy rewind confirm, and the inline rewind confirmation dialog is
removed now that the preview gates the destructive action.

* test(hub): align archive cleanup timeout status with the 503 semantics

* fix(hub): reject the fork preview when the transcript moves during the boundary call

* fix(web): surface fork preview failures in the chat with a connect-error retry

* test(e2e): pin the list fork menu and opencode affordances to the preview flow

* fix(cli): make shared Codex fork previews respect forkable boundaries

The message-mode preview answered boundaries the confirm would refuse: a
historical cut whose completed-turn prefix contains an unfinished turn
only failed after the user confirmed. PreviewForkBoundary now applies
ForkConversation's terminal-status rule on the assertBoundary snapshot it
already fetched, so both sides inspect one history state.

The latestCompleted preview could also name an empty-text userMessage as
the cut row, but the projection never emits a hub row for those, so the
hub resolved a boundary that does not exist and failed with 'Fork
boundary message not found'. firstExcludedUserLocalId now skips items
without hub-visible display text, sharing the projection's rule through
userMessageDisplayText.

* fix(hub): gate the fork preview on the archived-fork admission rules

The inactive-session preview branch answered a boundary without any of
the guards the confirm enforces in forkArchivedCodexSession: an archived
Claude or OpenCode session, a diverged history, queued messages, or an
offline Runner all rendered a preview dialog that could only fail on
confirm. The admission guards now live in assertArchivedForkEligible and
run in both paths.

A latestCompleted token is only minted for a running source, so a runner
exit before the confirm used to fail with the unactionable 'No verified
completed turn' answer instead of refreshing; boundaryMovedReason now
returns boundary_moved when the source went inactive, and the client
re-previews under the archived rules.

* fix(web): replace a stale fork preview with the error dialog and honor the thinking edge

A preview refresh that failed with a non-404 error left the previous
ForkPreviewDialog mounted, so the error dialog — gated on
errorMessage && !preview — never appeared and the stale boundary token
stayed confirmable. The non-404 catch now drops the stale preview first.

The thinking-edge effect also consumed an edge that landed while the
first preview request was still in flight: neither the state nor the
legacy request existed yet, so the stale idle-time answer opened the
dialog after the turn had already started. The in-flight request intent
is now tracked in a ref the effect can re-issue from, and an edge during
a confirm RPC no longer mutates the dialog behind the mutation.

* fix(web): keep the legacy fork confirm locked while the RPC is in flight

confirmLegacy awaited the fork/rewind RPC without any pending flag, and
all three legacy confirm dialogs bind isPending to the preview-loading
state, so the confirm button never showed its confirming label and both
buttons stayed enabled: a double click submitted the fork twice and the
dialog could be dismissed mid-request. A dedicated confirming state now
covers the legacy RPC in useForkFlow and drives the three dialogs.

* fix(web): align the fork error dialogs between the chat and the list

SessionList's error dialog ignored the retry affordance the chat already
had: connect-level preview failures showed only Dismiss with the buttons
unbound to any pending state. Both components now share the same dialog
contract: Retry for connect failures, Dismiss otherwise, one action and
no duplicate Cancel, and the pending state bound to the retry fetch.

The chat's error dialog also introduced every failure as a fork even
when the failed request came from openRewind; useForkFlow now records
the failing intent and the dialog titles itself accordingly. Finally,
HappyThread's historyActionPending was hardcoded false after the preview
flow replaced the direct fork callbacks, so per-message Fork/Rewind
buttons stayed enabled while a preview request was in flight and another
click would supersede it via requestSeq; the loading state now locks them
like the pre-preview flow locked them during its RPCs.

* fix(web): clean up the fork preview dialog's confirm error and rewind footer

A failed confirm quoted the raw ApiError message ('HTTP 409 Conflict:
{...}') inside the dialog while the rest of the flow extracts the hub's
error text; the dialog now shares useForkFlow's apiErrorText. The error
also survived a background view refresh, quoting a stale boundary under
the refreshed one, and a rewind whose excluded rows were all non-text
hid the deletion summary because the section was gated on excludedTurns
being non-empty even though counts.excluded was not zero.

* fix(hub): reject the fork preview when the CLI answers a resolved error envelope

RpcHandlerManager serializes a thrown handler error as a RESOLVED
{error} envelope, so previewForkBoundary's cast answered the preview
with undefined nativeTurnId/cutBeforeLocalId and the runtime failure
was silently swallowed. Unwrap the envelope and throw so the hub
surfaces the failure like any other preview error.

* fix(web): honor the flattened summary capability on the legacy fork fallback

SessionSummary flattens conversationHistory onto metadata while the
full hub Session nests it under metadata.capabilities; the legacy
confirm only read the nested shape, so a 404 fallback from the list
sent a plain current fork for a running session that supports the
latest-completed fork. Accept both shapes.

* fix(web): offer the fork fallback when the legacy rewind is fork-safe

The legacy rewind confirm dropped the ambiguous-native-boundary fork
fallback that the preview confirm and the pre-preview dialog had: a
409 ambiguous_native_boundary_fork_safe surfaced as a dialog error
instead of offering fork-at-boundary. Mirror the preview confirm's
handling on the legacy path.

* fix(hub): catch source active transitions between fork preview and confirm

The boundary token did not record the source's active state, so a
transition between preview and confirm bypassed boundary_moved: a
stopped runner sent the confirm into the archived-fork path (uncoded
admission failure for non-Codex sources, or an archived fork that
silently ignores the previewed live cut), and a reopened session ran
the live fork with a token minted on the archived path. The rewind and
non-Codex message confirms also failed as uncoded 'Session must be
active' / 'Session is busy' on thinking edges.

ForkBoundary now carries sourceActive and boundaryMovedReason rejects
the mismatch across all modes; the rewind and live non-Codex message
cases also reject a thinking edge. latestCompleted keeps its existing
runner-exit guard for tokens minted before this field existed.

* fix(web): keep the preview confirm locked against thinking edges mid-confirm

confirmLegacy set confirmingRef but confirmPreview did not, so a
thinking edge landing while the confirm RPC was in flight re-answered
the preview behind the confirm: the dialog's view was replaced (or
unmounted into the error dialog) under a pending confirm, and the
confirm then navigated over it or threw against a dead dialog. Lock
the confirm the same way the legacy path does, and release it before
the boundary_moved re-preview so the refresh behaves like any other
in-flight preview.

* fix(web): mark the fork boundary on a current preview that excludes a running turn

A shared Codex runtime answers mode 'current' with the last completed
turn while a turn is already running in the CLI (before the hub saw
thinking), so the preview carries an excluded running turn and confirm
pins lastTurnId. The dialog gated the fork-point marker and boundary
box on kind !== 'current' and showed the full-copy footer, hiding the
cut the confirm would apply. Show the boundary section whenever the
preview carries a cut and use the latest-completed footer for a current
preview with exclusions.

* fix(hub): refuse the fork preview when the confirm's pending-fork guards would

forkConversation rejects a confirm outright while a Codex resume is
unconfirmed or an archived-fork child binding is pending on an active
source, but forkPreview ran neither check and opened a dialog whose
confirm always failed. The archived message preview also answered
without the conversationHistoryTurns entry (or pending attempt) that
forkArchivedCodexSession resolves the native turn from. Mirror all
three guards on the fork preview paths; rewind keeps its own, since
the rewind confirm runs different guards.

* fix(cli): answer the idle fork preview with a pin the confirm would accept

The idle current-mode preview pinned the last native turn without
checking its terminal prefix, so a thread holding a non-terminal turn
previewed a 200 whose confirm always failed verifyPinnedTurn with 'The
pinned fork turn no longer has a completed native history prefix'.
Validate the pin before answering and omit it when invalid: preview and
confirm then agree on the unpinned whole-history cut. Message mode also
fetched the thread twice per preview (once up front, once inside
assertBoundary); the up-front read now lives only in the branches that
need it.

* test(hub): pin the rewind route's coded 409 boundary_moved contract

The rewind route tests never sent a boundary token, so the claim that
the route maps a moved rewind boundary to a coded 409 had no coverage.
Mirror the fork route test: the boundary reaches the engine and the
structured code is returned on a 409.

* fix(hub): let a boundary-token rewind confirm reach the engine when the source went inactive

The rewind route answered 409 session_inactive before the engine ran
whenever the source had stopped, so the confirm's sourceActive
re-check was unreachable over HTTP and a confirm after the runner
exited dead-ended instead of refreshing the preview. Every rewind
token is minted on an active source, so an inactive confirm is always
a moved boundary: parse the body first and skip requireActive only
when a token is present, mirroring the fork route. Token-less legacy
rewinds keep the session_inactive 409.

* fix(web): keep the fork preview confirm locked while a refresh replaces the view

A boundary_moved refresh leaves the previous preview mounted until the
fresh answer lands, and the confirm's await only covers the refresh it
started: when a thinking edge fires a second re-preview behind that
refresh, the dialog's local pending resets and Confirm becomes
clickable on a view that is about to be replaced, re-sending the stale
boundary for another refresh. Gate Confirm on the flow's loading state
alongside the pending flag, in both the chat and the list dialogs;
Cancel stays available since closing discards the in-flight refresh.

* fix(web): refuse legacy fork dialog dismissal while the confirm RPC is pending

The legacy confirm dialogs lost the old handlers' pending guard when
they moved onto ConfirmDialog: its Cancel button honors isPending, but
Escape and the dialog's close button reach onClose unconditionally, so
dismissing mid-RPC unmounted the flow while the fork or rewind kept
running, and a later failure had nowhere to surface. Guard the legacy
fork and rewind dismissals with !confirming in the list and the chat;
the preview-route dialog already guards dismissal through its own
pending state.

* fix(hub): refuse archived-fork preview for attached runtimes

* fix(codex): name the original hub message when a fork cut starts at a queued batch
2026-11-18 10:12:23 +08:00
a9e4d445cc feat(hub,web,cli): work-scoped liveness — derive in-progress tool work so autonomous rounds stop rendering as waiting (#2470)
* feat(hub,web,cli): work-scoped liveness — derive in-progress tool work so autonomous rounds stop rendering as waiting

thinking is round-scoped, not work-scoped: a session running an
autonomous loop between turns reports thinking=false while its tool
calls are still open, so the client renders "waiting" for hours. The
hub now sweeps open tool-call rows (getLiveToolWork) and marks the
session with derivedToolWork while any live call exists; the web
session list and status row render it as working. Stale
backgroundTaskCount values are cleared by the same sweep, and the
claude backend re-bumps thinking on autonomous-round assistant frames.

Ported from the fork line; the queued-thinking-grace refinement is
dropped here because that feature does not exist upstream.

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

* test(web): assert the ticker-era presence badge class, not animate-pulse

The low-rate ticker refactor (#2447) removed animate-pulse from the
presence badge; the derived-work test still expected it. data-presence
plus the badge background class is the visible contract now.

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

---------

Co-authored-by: miuiadmin <miuiadmin@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-11-18 08:12:48 +08:00
84d08dfc05 fix(runner): avoid blocking Windows heartbeat on process probes (#2472)
Co-authored-by: 3ndetz <30196290+3ndetz@users.noreply.github.com>
2026-11-18 08:11:08 +08:00
OverbakerandGitHub cde0b355d8 perf(cli,hub): compress large /cli payloads and coalesce keep-alive heartbeats (#2477)
* perf(hub): enable gzip compression for large /cli HTTP payloads

* perf(cli): extract zero-side-effect keepAlive module and bump interval to 10s

* perf(cli): share SESSION_KEEP_ALIVE_INTERVAL_MS across agent loops
2026-11-18 08:10:24 +08:00
f6d7238607 fix(shared): hide and report near-miss AGENT_NOTIFY_SUMMARY footers (#2481)
* fix(shared): hide and report near-miss AGENT_NOTIFY_SUMMARY footers

A turn whose final line attempts the machine footer but does not parse -
most often truncated before the closing brace - fails twice over: the
status is dropped, and because the strict matcher found nothing to strip,
the raw `AGENT_NOTIFY_SUMMARY {...` line is rendered to the reader. The
second half contradicts the product intent `e2e/notify-summary.spec.ts`
already asserts, and the first half is silent: `extractNotifySummary`
returns null with no log, so the only detector is a human noticing.

Introduce the near-miss notion: the last non-empty line is positionally
eligible to be a footer (the existing glued/indented rules, unchanged) but
yields no summary. On that condition:

- `stripNotifySummaryFooter` removes it, keeping any glued prose prefix
  exactly as it does for a valid footer. The machine line is addressed to
  the harness, not the reader, and a truncated one is no more readable
  than a valid one. `NotifySummaryText` now falls back to the stripped
  body instead of re-rendering raw text when there is no summary to show.
- `detectNotifySummaryNearMiss` classifies why it failed - unterminated
  JSON, trailing content, invalid JSON, not an object - and the work-graph
  ingest logs one warn naming the reason, so a broken emitter is greppable
  instead of invisible. Mid-stream snapshots are excluded: a footer still
  being written is incomplete by construction, not malformed. The log
  carries the payload *length*, not the payload, to keep agent output out
  of hub logs.

What is accepted as a *valid* footer is unchanged, and so is what is left
alone: whitespace-delimited prose mentions (`Example: AGENT_NOTIFY_SUMMARY
{...`), mid-body quotes, non-final footers, and a bare token with no
payload all still render as written.

Deliberately not included: repairing a truncated payload by appending the
missing brace. Truncation cuts content, not only syntax, so a repaired
footer would write a silently shortened summary into the append-only
work-graph ledger as though the agent had meant it. The near-miss reason
makes repair a small follow-up if a maintainer wants it.

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

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

* fix(shared): keep quoted footer examples out of near-miss matching

Review catch: the near-miss path inherited the strict matcher's "glued"
eligibility, which treats any non-whitespace character before the token as
glue - including a backtick or quote. A final line such as

    Use `AGENT_NOTIFY_SUMMARY {"status":"done"}` at the end.

therefore matched, the closing backtick read as trailing content, and
stripping left only `Use ` + the opening backtick, deleting the example and
the explanation after it. The Codex commentary path strips before storage
rather than before display, so that text was lost, not merely hidden.

Near-miss matching now skips occurrences inside an inline-code span and
occurrences immediately preceded by a quoting or opening delimiter. The
strict matcher is deliberately left as it was: a payload that parses as an
object through end of line is its own evidence that the line is a real
footer, so a backtick-glued valid footer is almost certainly an agent that
forgot the newline. A near miss has no such evidence, so it has to be more
conservative about what it will delete.

Genuine glued footers are unaffected, including after an earlier inline-code
span on the same line (``Ran `bun test`.AGENT_NOTIFY_SUMMARY {...``), which
is covered by its own regression test alongside the preserved examples.

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

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

* fix(shared): treat near-miss quoting as a span, not one character

Second review catch, same class as the first: the guard added in 3fbda1e7e
inspected the single character before the token, but quoting is a property
of the *span*. A final line such as

    The agent wrote "Done.AGENT_NOTIFY_SUMMARY {"status":"done"}" verbatim.

has ordinary prose punctuation immediately before the token, and the
backtick-parity check only counted backticks, so a double-quoted span read
as unquoted. The line was stripped to `The agent wrote "Done.`, and the same
variant existed for every quote style the local check did not enumerate -
`('Done.AGENT_NOTIFY_SUMMARY {...}')` among them.

Replace both checks with one span test: is the token inside an open quoting
or code span on this line? Symmetric delimiters (backtick, double quote,
single quote) are counted by parity, so a *closed* pair earlier on the line
(`He said "hello".AGENT_NOTIFY_SUMMARY {...`) does not grant immunity;
bracketing delimiters are counted by depth. An apostrophe inside a word is
not treated as a quote, or `didn't` would hide a real footer.

Angle brackets are deliberately absent: `a < b` is far more common in agent
prose than an angle-bracketed footer example, and treating `<` as an opener
would hide real footers. That narrows the previous commit's delimiter set by
one character, by choice.

The strict matcher remains untouched, for the same reason as before: a
payload that parses as an object through end of line is its own evidence of
a real footer.

Regression coverage for the quoted-glue variants, plus three over-correction
guards that pass on both sides of the change - a closed inline-code span, a
closed quote or bracket pair, and an in-word apostrophe must all still strip
a genuine glued footer. The Codex commentary path gets the same cases, since
that path strips before storage rather than before display.

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

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

* fix(shared): strip a near miss only when its payload runs to end of line

Three review rounds found three quoting constructs the near-miss guard did
not know about - a single-backtick span, a double-quoted span with glued
prose inside it, a double-backtick run - and each fix enumerated one more
piece of syntax. That was not converging, and the reason is visible in the
classifier: *every* reported false positive is `trailing-content`.

    The agent wrote "Done.AGENT_NOTIFY_SUMMARY {…}" verbatim.   → trailing-content
    ('Done.AGENT_NOTIFY_SUMMARY {…}')                           → trailing-content
    Use `AGENT_NOTIFY_SUMMARY {…}` at the end.                  → trailing-content
    Use ``Done.AGENT_NOTIFY_SUMMARY {…}`` at the end.           → trailing-content
    See [Done.AGENT_NOTIFY_SUMMARY {…}] above.                  → trailing-content

while every shape this feature exists to catch is not:

    …,"summary":"ok     → unterminated-json      {bogus}    → invalid-json
    {"ver               → unterminated-json      not-json   → not-an-object

So stop enumerating quoting syntax and gate on the payload region instead:
strip a near miss only when it runs to the end of the line. Truncation
terminates the line by definition, so it always qualifies; a quoted example
always closes its delimiter *after* the payload, so it never does. One rule
replaces the whole guard - no quote characters, no backtick runs, no in-word
apostrophe case - and `shared/src/messages.ts` is ~40 lines shorter for it.

`trailing-content` stays classified and logged, so a genuinely stray-text
emitter is still greppable; it simply is not deleted. The cost is one odd
line on screen when an emitter really does append text after a complete
object - and the status was dropped for that shape anyway, since the strict
matcher rejects it too, so the change is purely cosmetic. The alternative is
deleting a reader's example and the prose around it, which the Codex
commentary path does before storage rather than before display. Showing a
strange line beats destroying text.

Every preservation test from the previous two rounds still passes, now for
this one reason rather than per-syntax guards, and the Codex commentary
suite keeps the quoted and double-backtick cases the review asked for.

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

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

* fix(shared): only delete a near miss when no prose shares its line

Two review points, both about not destroying text.

**The log wording was wrong for the one reason that is no longer stripped.**
`[work-graph] ignored a malformed AGENT_NOTIFY_SUMMARY footer` is untrue of a
`trailing-content` line: a quoted example is correct prose, and it is kept and
shown rather than ignored. Someone grepping that string for lost statuses
would read an example as a dropped one. The message is now
`no AGENT_NOTIFY_SUMMARY status recorded from the final line`, which holds for
every reason, and `removedFromDisplay` carries which of the two outcomes
happened. The reason is still logged - an emitter that appends stray text
after a complete object is genuine signal, and suppressing it to quieten the
noise would trade the wrong way.

**A quoted example of an *incomplete* payload was still being deleted.**
``Use `AGENT_NOTIFY_SUMMARY {"summary":` to reproduce.`` classifies as
`unterminated-json`, so the end-of-line rule could not protect it: an
unterminated payload has no object end to measure against. This was a known
residual of that rule and should have been on the record when it landed.

The fix is a second structural condition rather than a return to parsing
quote syntax: **the token must own the line.** Nothing but whitespace may
precede it. That covers every quoting construct at once, including the ones
earlier rounds enumerated and the ones nobody has thought of, because what it
tests is the presence of prose rather than the shape of quotes.

A *valid* footer still tolerates glued prose - a payload that parses as an
object through end of line is its own evidence that the line is a real footer.
A near miss has no evidence, so it must be sure the line is machine output
before deleting it.

The cost, stated plainly: a truncated footer glued to prose on the same line
now stays visible. That is a real sub-case of the defect this PR fixes, and it
is given up deliberately. The status is lost either way - the strict matcher
rejects that shape too - so the cost is one odd line on screen, against the
risk of deleting a reader's example and the prose around it, which the Codex
commentary path does before storage rather than before display.

The four syntax guards from the previous rounds are replaced by this one rule
and their tests collapse into it, alongside a contrast test that a valid glued
footer is still stripped.

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

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

* test(shared): pin why line ownership, not payload shape, decides the strip

A payload-shape predicate - "the remainder must be a well-formed JSON prefix
that runs to end of line" - looks like it should separate a truncated footer
from a quoted example, and it does for most shapes. It fails on an open
string, because an unterminated string swallows everything after it:

    Use `AGENT_NOTIFY_SUMMARY {"summary":"` to reproduce the failure.

the payload of which is byte-for-byte the shape of a real truncation
(`"summary":"ok`). The signature of the defect and the signature of the
false positive are the same, so no test of the payload can tell them apart -
which is why the decision is made from the line instead.

Pins that case so the next person to reach for a payload-shape rule finds the
counterexample already failing.

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

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

---------

Co-authored-by: HAPI <noreply@hapi.run>
2026-11-18 08:08:40 +08:00
wushenghua 8338c17e4c feat(opencode): expose goal through live RPC like Codex 2026-11-18 05:29:00 +08:00
wushenghua 1efb55332f fix(opencode): keep goal sessions working and auto-apply PWA updates 2026-11-18 05:10:46 +08:00
wushenghua 09495f779b feat(opencode): bridge native /goal command, status and round output 2026-11-18 03:37:42 +08:00
KiyoshiandGitHub 37446bcf5f feat(agy): negotiate ACP slash commands and support native /swarm (#2454)
* feat(agy): negotiate ACP slash commands and support native /swarm

* fix(agy): clear cached ACP commands when available_commands_update is empty

* fix(agy): recognize backgrounded commands in swarm_wait turn boundaries
2026-11-17 15:16:17 +08:00
dff2d99fd6 fix: align Stop with the official agent TUIs (#1992)
* fix(cli): preserve queued user input on plain Stop across flavors

Plain Stop must abort only the active runtime turn and keep unconsumed
queued messages (localIds/order/isolate/mode) for the next drain. Previously
the per-flavor Abort handlers unconditionally called queue.reset(), dropping
pending messages, and an idle loop could collect/ACK a batch that arrived
during abort teardown.

- MessageQueue2.waitForMessagesAndGetAsString checks the abort signal before
  both batch collections, so an in-flight Abort can never collect/ACK (and
  therefore never replay) a pending batch.
- Add a serialized Abort barrier in RemoteLauncherBase with an optional
  synchronous entry callback: onAbortEntry aborts the current signal so an
  idle waiter fails closed, and waitForAbortBarrier holds the loop's next
  dequeue until teardown completes. A rejection during teardown no longer
  spins the loop with a stale aborted signal; it is boxed and propagated to
  the Abort RPC caller, the run loop, and clearAbortHandlers lifecycle.
- Launcher handleAbort resets the queue only on terminal cleanup
  (shouldExit/leavingRemote). BaseLocalLauncher Abort (switch to remote)
  preserves the shared queue. Cursor ACP soft-steer drain handles an already
  aborted signal without deadlock.
- Codex shared root Abort stays a pure turn/interrupt; native queue retained
  (control regression only, no resume-policy change).

Tests: Launcher-level Abort preservation (active/idle/concurrent/rejection),
enqueue-during-cancel, MessageQueue2 idle wake-then-abort and post-await
guard, base-local queue preservation, Codex abort/native-queue control.
Verified with Node22 (.sbx/node22) - full cli suite green; see
.sbx/REPORT.md.

* fix(web): settle Stop state with the abort request

* test(web): cover Stop request settlement without an idle render

* feat(cli): batch compatible Codex queued input

* fix(codex): preserve batch recovery and fork boundaries

* test(cli): cover idle and overlapping Stop teardown

Keep queued input unacknowledged while an idle Stop or a later Stop is still tearing down. Gate cancellation acknowledgements independently from prompt completion to exercise both ordering races.

* fix(codex): keep queue preflight failures retryable

Persist a retryable state during the read-only tail lookup, then journal uncertainty with the native mutation. Preserve released native edits and avoid replay when acceptance arrives during preflight.

* fix(cli): honor exit requests after abort teardown

* test(cli): cover terminal handoff during overlapping stops

* fix(codex): retain uncertain batch append ownership

* fix(dsh): stop queued dispatch during process cleanup

* fix(dsh): stop idle queue waits before process cleanup

* fix(codex): preserve removal intents across native edits

* test(codex): resolve native batch inputs in full-stack checks

* test(copilot): stub session metadata on the abort test client

The ACP session title sync now reads client.getMetadata() when a launcher is
created, so the abort test client needs a getMetadata stub next to its existing
updateMetadata stub. Without it every case built on createAbortSession fails
with "client.getMetadata is not a function".

* fix(opencode): keep the dequeue signal usable after a Stop that only abandons round metadata

The abort barrier aborts the dequeue signal when a Stop arrives so an idle wait
wakes up. A plain Stop during the post-prompt round-summary settle phase only
abandons metadata and returns before performAbort, which is what replaces the
controller. The loop then re-read the aborted signal in a tight microtask loop
and never reached the queued input, pinning a CPU. Recycle the controller on
that early return so the queued input is dequeued on the next iteration.

* fix(cli): keep launchers running when a native cancel is rejected

The abort barrier aborts the dequeue signal when a Stop arrives and, when the
teardown rejected, boxed the failure so the run loop threw it at the next
dequeue. Every launcher that uses the barrier therefore stopped surviving a
rejected native cancel, which it did before the barrier: a rejected cancel left
the controller untouched and only the Abort caller saw the error.

setupAbortHandlers now takes an onAbortRejected callback next to onAbortEntry.
On a teardown rejection the base restores the dequeue signal through it and
rethrows to the Abort RPC caller only; the boxed failure is gone. Each launcher
passes a one-line callback that replaces the controller only when it was
aborted. Queue preservation and the barrier's ordering are unchanged.

* fix(codex): restore the applied batch version after definite rejections

A definite native rejection left the rejected proposal in versions and
rolled batch.current back positionally (length - 2), so a second
consecutive rejection selected the earlier rejected proposal instead of
the applied version; the stale current survived reconciliation and a
later member cancel could submit rejected content for execution.

Capture batch.current before each append and restore that saved index
on definite rejection across nativeUpdate, extendBatch,
cancelBatchMember and steerBatchMember.

Covered by failing-first regression tests: consecutive rejected appends
followed by a member cancel, and consecutive rejected native edits.
See tiann/hapi#1992 review discussion.

* fix(hub): align archive cleanup status assertion with the 503 mapping

tiann/hapi#2423 changed ArchiveCleanupError to return 503 instead of 504
(Cloudflare Tunnel replaces 502/504 bodies; the code field distinguishes
timeouts) and updated one assertion, but the overlapping-archive
singleflight test still expected 504, which the 409 | 503 status union
can never produce.

* fix(opencode): preserve queued input on a plain Stop

tiann/hapi#1992 promises pending input survives a plain Abort on the
queue-backed launchers. Upstream #2424's performAbort reset the queue
unconditionally, dropping not-yet-dispatched input on a plain Stop. Reset
only when leaving the session (switch/exit), and let a terminal request
joining an in-flight plain Stop promote its cleanup intent onto the
operation so the reset still lands exactly once, after the shared
cancellation restore drain.

* fix(opencode): terminal drain ordering, dequeue fence, teardown escalation

Hydrogen pre-review of the preserve-on-plain-Stop round surfaced six
defects in the Stop/terminal paths, all adjudicated valid, and its
re-review surfaced three more:

- A direct switch/exit reset the queue before the v2 cancellation drain,
  so a proven-cancelled steer restored back into the queue after the
  reset and a switch bounced straight back into remote mode. Run the
  terminal reset after the drain, where a terminal joining a plain Stop
  already applied its promoted reset.
- The dequeue loop could dequeue, ACK, and then drop a preserved row on
  the prompt-prep aborted-continue while a plain Stop was still awaiting
  its native cancellation. Park the dequeue on the runtime gate's
  cancellation-idle fence and refuse beforeDequeue while a cancellation
  drain is in flight.
- restoreQueuedReservation ignored shouldExit, re-admitting a steer
  parked before its v2Steers entry after the terminal reset. Leaving
  remote never re-admits.
- performAbort's finally escalated every steer to 'teardown' when the
  teardown threw, stranding a proven-cancelled steer indeterminate on a
  plain Stop that keeps running. Escalate only when leaving remote.
- A terminal joining a plain Stop lost its promoted cleanup intent when
  the owner's performAbort rejected: the queue kept its rows and an idle
  dequeue waiter was never woken. Run the reset and the abort in the
  rejection handler.
- dispatchV2Steer removed its entry only after awaiting the restore, so
  a Stop landing mid-restore ran a second concurrent restore whose
  failed restoreReservation falsely reported the row indeterminate.
  Detach the entry before the restore.
- A plain Stop landing between the dequeue and the prompt (model/effort
  setup, round snapshot, or the native history read) still dropped the
  already-dequeued, hub-ACKed batch on the pre-dispatch bail-outs.
  Requeue the batch there in its original order with each localId
  intact, and echo it at the dispatch commit point so the retry does
  not double-echo; compact keeps its early echo.
- restoreQueuedReservation's leaving-remote path returned false without
  undoing its work: the steer stayed stuck 'dispatching' in the shared
  queue (Cancel answered 'in-flight' forever) and the hub stamp never
  reverted. Persist 'queued' and release the held reservation instead.
- The v1 terminal path had no rejection cleanup: a performAbort(true)
  that threw left the queue unreset and the dequeue signal un-aborted,
  parking the idle loop forever. Mirror the v2 rejection cleanup.

* fix(cli): preserve queued input across pre-prompt Stops in every queue-backed launcher

The whole-PR review surfaced the OpenCode preserve class defect in every
other queue-backed launcher, plus teardown and batching gaps:

- dsh, cursor ACP, copilot, grok and kimi dequeued and hub-ACKed a batch
  and then dropped or dispatched it when a plain Stop landed during the
  pre-prompt setup awaits. Requeue the batch at every pre-dispatch
  bail-out (requeue never fires for terminal switch/exit, whose reset
  already cleared the queue) and defer the cursor ACP hub ACK and user
  echo to the dispatch commit point so a retry never double-ACKs or
  double-echoes. The shared requeue lives in MessageQueue2.unshiftBatch;
  OpenCode's helper delegates to it.
- cursor ACP requeued into the shared queue without a shouldExit check,
  bouncing a switch straight back into remote mode, and its soft-steer
  restoreQueuedReservation re-admitted a 'dispatching' steer after the
  terminal reset. Guard the requeues and release the steer the same way
  OpenCode does: persist 'queued' and release the held reservation.
- A rejected handleAbort(true) skipped the queue reset everywhere and
  the dequeue-signal abort outside DSH, parking an idle runMainLoop
  forever. requestExit now invokes an onTerminalTeardownRejected hook on
  rejection; copilot, grok, kimi and cursor ACP override it with their
  reset+abort, OpenCode and DSH are no-ops (their teardowns guarantee
  the cleanup on every path), and DSH moves its reset into a finally so
  a rejected cancel cannot skip it.
- runAbortUnderBarrier overwrote an in-flight abort barrier instead of
  chaining onto it, letting dsh kill() unblock the loop's dequeue while
  an earlier plain-Stop teardown was still running. The release now
  chains onto the prior barrier.
- codex/shared/root captured the message batch key from this.settings at
  callback arrival, merging queued messages across a settings-changing
  slash command and splitting around cold-start hydration. The key is
  now computed inside the work continuation, after bound and after
  earlier queued commands ran.

* fix(cli): keep origin-indeterminate steers resolvable and skip dead prep on Stop

The round-4 confirm review surfaced three residual steer/teardown gaps:

- restoreQueuedReservation's terminal-exit branch deleted an
  origin-indeterminate reservation and left the hub steerDeliveryState
  stuck at 'dispatching'. An origin-indeterminate row cannot be honestly
  reverted to 'queued': stamp 'indeterminate', emit it, and keep the
  reservation for explicit Cancel/Retry in local mode (opencode and the
  same newly added cursor ACP branch).
- restoreQueuedReservation now returns 'restored' | 'dropped' |
  'indeterminate' so dispatchV2Steer can tell a clean terminal drop from
  an unknown outcome: the rejected-admission branch reports 'Active turn
  changed' instead of a false 'Steer state is indeterminate', and the
  stop-cancellation path treats the drop as definitive removal.
- A plain Stop landing during the inline setModel/setConfigOption awaits
  no longer runs captureOpencodeRoundSnapshot or toggles
  thinking/steeringActive for a prompt that never starts; the already-
  dequeued batch requeues before the round-snapshot setup.

* test(cursor): cover legacy queue preservation across Stop and terminal exits

The PR changed cursorLegacyRemoteLauncher's abort handling (+10: the
leavingRemote queue reset and the rejected-cancel signal restore) without
any behavioral test. Mirror the Cursor ACP coverage: a plain Stop during
an in-flight turn keeps the queued row and drains it after the Stop
settles, a terminal switch/exit resets the queue exactly once with no
further dispatch, and a Stop landing during the dequeue wait preserves
the not-yet-dequeued row. The launcher already behaved correctly on all
three paths; the tests guard them.

* fix(launchers): close abort-window races across teardown and pre-dispatch setup

Four launcher loops (cursorAcp, copilot, grok, kimi) plus dsh and
opencode kept a live dequeue signal and a dequeue-time hub ACK across
their pre-prompt setup awaits, so a batch arriving behind a terminal
switch/exit teardown was dequeued, stamped invoked at the hub, run
through ACP model/mode mutations, and dropped unprompted; and an abort
that landed mid-setup could be erased by a later state reset and still
dispatch the canceled turn.

cursorAcp
- single userAbortRequested reset per turn window: an abort that lands
  during model/mode setup survives to the pre-dispatch gates
- hub ACK moved to the dispatch commit point, after every pre-dispatch
  bail-out: an aborted batch is never stamped invoked nor dropped with
  a false ready
- new requeueAbortedBatch helper: abort-path requeues carry only user
  content, so a Stop-canceled model-error-bridge item is dropped
  instead of resurrecting after the Stop settles
- durable Bridge mutations (user-turn supersede, replay-gate persist)
  deferred to the dispatch commit point with post-persist abort/exit
  guards; guard added after the harness-resume buffer discard
- soft-steer restoreQueuedReservation re-checks shouldExit after the
  'queued' persist and releases the held reservation instead of
  restoring it into the queue, which would bounce a terminal switch
  straight back into remote mode; 'Active turn changed' when the turn
  changed during the restore
- handleAbort aborts and replaces the dequeue signal at entry when
  leavingRemote, unparking the wait before the teardown's own awaits
- lastUserMessage recorded at the dispatch commit point

copilot/grok/kimi
- handleAbort entry abort-and-replace when leavingRemote
- shouldExit break right after the dequeue resolves, before any state
  mutation
- hub ACK deferred to the dispatch commit point
- intermediate shouldExit/aborted checks after each setup await;
  isClosed guards on every unshiftBatch
- grok: thinking deferred to the commit point, history busy kept early

dsh
- hub ACK deferred to the dispatch commit point
- a failed top-of-loop reconnect requeues the un-ACKed batch when a
  plain Stop landed inside it; isClosed guards on every unshiftBatch
- generation checks after the model/effort switch awaits; thinking
  deferred to the commit point
- kill() batch drop emits the sibling idle 'ready' signal

opencode
- display-mode state applied below the pre-snapshot Stop/exit check

Each loop change is covered by a behavioral regression test that fails
against the pre-fix dequeue-time ACK / live-signal teardown behavior.

* fix(launchers): close bridge supersede, cancel-window, and teardown races

- cursorAcp: markModelErrorSupersededByUserTurn now drops the pending
  bridge row, and the replay gate fails closed once superseded, so a
  manual Bridge enqueued mid-setup can no longer replay after the user
  turn that superseded it
- cursorAcp/dsh: a batch resolved while the terminal teardown flips
  shouldExit breaks before reconnect or mode/model setup instead of
  mutating ACP state on a closing backend
- MessageQueue2: cancelByLocalId answers 'in-flight' for dequeued-but-
  uncommitted localIds, closing the deferred-ACK window where a cancel
  could double-deliver a message or deliver one after an explicit
  cancel
- MessageQueue2: unshift forwards internal provenance; unshiftBatch and
  the cursorAcp requeue helper keep it on non-isolated requeues
- dsh: a plain Stop racing a failed acpSessionEnded restart requeues
  the dequeued batch instead of dropping it in the recovery catch, and
  the null-model switch path gains the same abort-generation guard as
  its sibling branch
- copilot/kimi: the switched model's effort baseline is captured before
  the plain-Stop bail so the requeued turn takes the new baseline
- tests: failing-first regression tests for each sequence; grok/kimi
  requeue tests drop unused spies, fix stale deferred-ACK comments, and
  assert the commit-time ACK exactly once

* fix(cli): scope in-flight cancel tracking to deferred-ACK launchers

* fix(opencode): commit hub consumption only when the prompt is dispatched

* fix(codex): persist batch uncertainty after an unconfirmed shrink

* fix(codex): journal batch uncertainty before dispatching a shrink

* fix(codex): journal batch uncertainty before every native batch write

Every native RPC that can change the content or existence of a batch's
queued submission now persists the batch as unknown, together with the
proposal that motivated it, before it is dispatched. Only a confirmed
response or a definite rejection settles the batch back, and that
transition is persisted.

Previously the whole native edit (nativeUpdate), the append edit
(extendBatch), the restoration after a rejected steer and the suspend
delete left the batch queued while an unconfirmed proposal was current.
A crash before the edit applied, followed by canceling a member, could
then delete or rewrite the native submission from a version it never held
and silently drop sibling input.

---------

Co-authored-by: sbx <sbx@agent-sandbox.invalid>
2026-11-17 14:58:11 +08:00
weishu 825af9ba1d Release version 0.36.4 2026-11-17 13:09:12 +08:00
weishu eefa420503 Release version 0.36.3 2026-11-17 12:04:15 +08:00
weishu ce377fa03c Release version 0.36.2 2026-11-17 11:45:57 +08:00
Haoyuan WangandGitHub d01acf994b feat(cli): read Claude plan quota on demand via get_usage (#2451) 2026-11-17 07:37:06 +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 8ff6bd12fa Release version 0.36.0 2026-11-16 17:36:27 +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 6237e90b37 feat: import local sessions through one registry (Pi, OpenCode, Codex, Claude) (#2435) 2026-11-15 17:06:21 +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
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 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
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 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
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
adminandGitHub bebda45006 fix(dsh): respawn dead ACP children, recover closed sessions, sandbox modes, inline images, reasoning effort (#2386) 2026-11-13 08:40:55 +08:00
HeavyGeeandGitHub 04032d704e fix(cli): isolate claude.test.ts resume-identity tests from HAPI_INVOKED_CWD (#2396) 2026-11-13 08:40:19 +08:00
JeeandGitHub ebd4ac2105 fix(agy): handle stale errors and missing session titles (#2401) 2026-11-13 08:39:32 +08:00
AnanovoandGitHub 083aaca779 fix(web): distinguish and navigate pending requests (#2402) 2026-11-13 08:39:15 +08:00
JeeandGitHub d391324e81 fix(cli): handle ACP stdin stream errors (#2403) 2026-11-13 08:38:54 +08:00
AkiiiaandGitHub 72b341fde1 perf(cli): load command modules on demand (#2404) 2026-11-13 08:38:41 +08:00
Junmo KimandGitHub e24ccf5e50 feat(agy): show the round turn count and running background commands (#2405) 2026-11-13 08:38:25 +08:00
SSU-WEI HUANGandGitHub f1339d3ee5 docs(cli): note that worktree spawn-peer needs a git repository (#2410) 2026-11-13 08:38:08 +08:00
HeavyGeeandGitHub cca38a4acc fix(cli,hub): clear stale permission required when request is inactive (#2415) 2026-11-13 08:37:27 +08:00
JeeandGitHub b3219357eb fix(pi): register peer tools directly when registerMcpServer is absent (#2418) 2026-11-13 08:37:02 +08:00
Junmo KimandGitHub cad21ec6d0 feat(opencode): fork and rewind OpenCode v2 conversations (#2424) 2026-11-13 08:35:45 +08:00
weishu 06d9e51f5c Release version 0.35.0 2026-11-12 10:16:52 +08:00
KiyoshiandGitHub 31cb262ee0 feat(usage): display CLI account quotas and rate limits in Settings -> Usage (#2389)
* feat(usage): display CLI account quotas and rate limits across Codex, Antigravity, and Claude

* fix(usage): persist live quota state across processes and normalize agy usage

* fix(cli): isolate Claude quota observations by account and bound probe deadlines

* fix(usage): bind Claude quota events to producing session account and surface quota fetch errors

* fix(usage): preserve OAuth token isolation without email and surface Codex read failures

* fix(usage): skip host claude path lookup when test probe override is active
2026-11-12 10:16:07 +08:00
KiyoshiandGitHub 0bea8967b4 fix(agy): wake session and stream reactive background turns over agy acp (#2387) 2026-11-12 08:47:36 +08:00