Commit Graph
739 Commits
Author SHA1 Message Date
SSU-WEI HUANGandGitHub 2d400a2abd feat(kimi): thinking level selection for remote sessions (#2349)
* feat(kimi): thinking level selection for remote sessions

Kimi Code's ACP session advertises the active model's thinking levels as
a thought_level config option (`thinking`: off/on or off plus declared
efforts). Expose it like Grok's effort: a session RPC + hub route for the
options, the composer effort picker, and per-turn
session/set_config_option in the remote launcher. The runner forwards
--effort so resumed sessions keep the selection.

* fix(kimi): keep thinking options in step with model switches

Kimi Code answers session/set_model with no config options and pushes
the new model's thought_level via config_option_update; capture it
(opt-in in the ACP backend, same hunk as #2348), re-baseline the
launcher's level after a switch, report 'switch pending' until the next
turn applies it, and have the web poll until discovery succeeds.

* fix(kimi): gate thinking discovery on the model the backend applied

Compare the model the next queued turn carries with the backend's model
instead of session state, so an older queued batch or a failed switch
keeps discovery pending; forward the saved effort on terminal resume.
2026-11-10 08:11:17 +08:00
weishu 2161a9ff96 Release version 0.34.4 2026-11-09 12:34:16 +08:00
f34ff13fce feat(peer): forward peer replies back to the caller with waitForReply (#2167)
* feat(peer): spawn_peer and reply forwarding for peer sessions

Peer sessions could only fire messages at each other: the caller had to
poll inspect_peer to learn that a peer finished, and nothing woke it once
it ended its turn. There was also no way to start a peer for new work.

- spawn_peer starts a session on the caller's machine (directory and
  agent default to the caller's) and sends it a task.
- ping_peer gains waitForReply.
- In both cases the caller's CLI watches the peer and, when its turn
  ends, posts the peer's latest reply into the caller session, which
  starts the caller's next turn.

spawn_peer needs manual approval like ping_peer. No hub changes.

* refactor(peer): drop own spawn_peer; add waitForReply to upstream spawn_peer

Upstream #1922 ships spawn_peer (spawn, rename, remit delivery, fresh-child
wait, manual approval). Remove this PR's duplicate spawnPeer and keep only
reply forwarding: spawnPeer now returns the remit's ping-peer localId and
resolved flavor, and MCP spawn_peer/ping_peer share one waitForReply hook.
Add a steered-task attribution test.

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

* fix(peer): keep waiting for a task an offline peer has not read

The hub keeps unconsumed peer tasks for replay, so a peer that goes offline
before reading the task can still run it after a resume. Only a stop after
consumption ends the reply watch.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 12:33:20 +08:00
Junmo KimandGitHub 7de3fdc405 feat(acp): show OpenCode and Antigravity questions in HAPI and return the answer (#2309)
* feat(acp): opt-in form elicitation capability advertisement

* feat(acp): route elicitation/create forms to a registered handler

* feat(opencode): map question forms to AskUserQuestion input and back

* feat(opencode): queue question forms as AskUserQuestion requests without auto-answering

* feat(opencode): advertise form elicitation for OpenCode v2

* feat(opencode): present the question tool call as AskUserQuestion

* feat(opencode): cancel pending question forms on abort, turn end, archive and exit

* test(opencode): cover the unshown question result surfacing

* feat(acp): let a form elicitation be declined

A form elicitation could only be accepted or cancelled. ACP also has
decline, the user refusing to answer, and agents may record it
differently from a cancel: Antigravity records a declined question as
"User Skipped". FormElicitationResponse now includes it, and the backend
passes it back to the agent unchanged.

* feat(acp): let the ACP permission handler ask the user a question

An agent's question (Antigravity's ask_question) is not a permission
request: it needs the user's answers, and it must never be answered
automatically. askUser() shows it as a pending request with the given
tool name and input, whatever the permission mode, and resolves with the
user's decision and answers. cancelAll() resolves an open question as
aborted, and an open question counts as a pending request, so callers
that wait for approvals also wait for it. onUserWait now covers these
waits too and no longer takes the request. isUsed() tells whether an id
is open or was already shown, since clients hide a pending request
whose id was completed before.

* feat(agy): answer agy's questions in the question card

On agy acp, agy's ask_question used to arrive as a generic tool card and
plain text. The turn ended, and whatever the user typed next became the
answer.

agy now gets form elicitation advertised, so it asks through
elicitation/create and keeps the turn open. The launcher takes these
forms through the backend's shared form elicitation handler, the same
one OpenCode uses.

- The question is shown as the AskUserQuestion card on agy's own tool
  call, with the options as choices, multi-select and an Other field.
- The user's choice goes back as agy's answer: the chosen option values,
  plus free text under qN_other only when the user typed some, so agy
  records exactly the chosen label.
- Denying declines the question, which agy records as "User Skipped".
  Stop and session end cancel it.
- No permission mode answers a question, always-proceed included.
- Steer is refused while a question is open.
- An approval that carries no usable answer declines instead of sending
  an empty answer.
- A question that arrives after Stop is cancelled.

* fix(opencode): decline question forms that arrive after Stop

cancelAll only swept requests that already existed, so a form delivered
afterwards was queued as a card whose promise never settled. Close the
gate synchronously in cancelAll and reopen it when the next prompt
begins, matching the aborted-turn guard of the agy handler.

* feat(web): let the question card be skipped

Add a Skip button, also bound to Esc inside the card, that denies the
pending question through the existing deny API and clears the draft like
Submit does. A deny already becomes a decline for agy and a cancel for
OpenCode, so the backend is unchanged.

* fix(agy): decline questions that arrive after the turn has ended

* fix(web): keep typed text when Esc is pressed in the question card's text field

* fix(question): hide Other on question forms that do not allow free text

Forms without qN_custom (OpenCode) or qN_other (agy) take no typed answer,
yet the card always offered Other, and a typed answer was dropped so the
result became a cancel. Carry an allowFreeText flag through the tool-call
input and the synthesized question input, and hide Other on the card when
it is false. Inputs without the flag keep showing Other.
2026-11-09 12:06:28 +08:00
AnanovoandGitHub 1feac0a1be feat(pi): expose peer session MCP tools (#2312) 2026-11-09 12:05:54 +08:00
Junmo KimandGitHub 38b6540bed feat(agy): show Antigravity's tool calls as the canonical tool cards (#2330)
* docs(agy): say request-review follows agy's toolPermission setting

On agy acp, HAPI's request-review is agy's default mode, which asks only
as agy's own toolPermission setting says. With toolPermission set to
always-proceed, agy runs commands and edits without asking, so HAPI shows
no approval prompts, and HAPI cannot override that per session. The
guide now says so, and says what acceptEdits and plan do on agy.

It also notes that always-proceed approves a request a PreToolUse hook
marks force_ask: agy sends it as an ordinary approval request, with
nothing that says it came from a hook.

* feat(acp): carry the agent's own tool name and args on tool calls

Some ACP agents send their own tool name and args next to the standard
title, kind and rawInput (agy: name, args). Pass them through as
nativeName and nativeArgs so a launcher can pick a card by the real tool
instead of a free-text title. Agents that send no name are unaffected.

* feat(agy): show agy ACP tool calls as the canonical tool cards

Map agy's own tool names to the cards the other flavors use: run_command
to Bash (with a clean stdout result), read_file to Read, edit_file to an
Edit diff, write_file to Write, search_web to WebSearch, invoke_subagent
to Task and call_mcp_tool to the mcp card. A write_file artifact (plan or
task list) is shown as a plan instead of a hidden brain-directory path.

A command agy moves to the background gets no further update after
end_turn, so its card spun until the next message. Show it as running in
the background at end_turn; the real result replaces that when agy reports
it in a later prompt's stream.
2026-11-09 12:05:15 +08:00
Junmo KimandGitHub f75109ce07 fix(cli): keep LAN access for sessions that outlive their runner on macOS (#2328)
* fix(cli): keep LAN access for sessions that outlive their runner on macOS

macOS attributes Local Network decisions to a process's responsible
process, which a child inherits from its spawner. Sessions spawned by a
runner that launchd started (directly, or through the npm launcher
bin/hapi.cjs) inherit the runner's or the launcher's pid. Once that
process exits (upgrade, version handoff) while the sessions are kept,
every new process in their trees that connects to a LAN address fails
with EHOSTUNREACH.

When the spawner may hand its responsibility on, detached spawnHappyCLI
children (sessions, runner handoff, runner start) are started with
HAPI_DISCLAIM_RESPONSIBILITY=<spawner pid>. In a direct child of that
pid, the entry hook removes the variable from the libc environment and
re-executes process.execPath in place via posix_spawn(POSIX_SPAWN_SETEXEC)
with responsibility_spawnattrs_setdisclaim, so the child becomes its own
responsible process. The pid, stdio, process group, cwd and the rest of
the environment are unchanged, so the runner's ChildProcess tracking keeps
working.

The spawner may hand its responsibility on when it is its own responsible
process, or when its responsible process is its direct parent, is the npm
launcher (which now passes HAPI_LAUNCHER_PID) and is itself its own
responsible process. A spawner started from Terminal or over SSH keeps the
inherited responsibility and with it the implicit LAN allowance macOS
grants there. The lookup uses responsibility_get_pid_responsible_for_pid
through bun:ffi; when it is unavailable the spawn is not disclaimed and
this is logged once.

Binaries without the hook ignore the variable, and a copy that leaks into
a rolled-back tree is ignored because its parent is not the spawner. The
private disclaim symbol may disappear: the hook then execs without it, and
any other failure continues in-process; the reason is written to the hapi
log.

* fix(cli): print --help and --version when HAPI_HOME cannot be created

The entry point imported runtime/responsibility to read the npm launcher's
pid. That module imports the logger, whose configuration creates HAPI_HOME,
so `hapi --help` and `hapi --version` failed before printing when that
directory could not be created.

Move the launcher pid into a dependency-free module, read it from there, and
make the optional disclaim fallback note best effort. Add an entry point test
that runs both flags with an unwritable HAPI_HOME.
2026-11-09 12:03:22 +08:00
Junmo KimandGitHub d784f1f7bd feat(agy): run Antigravity over agy acp with mid-turn Steer (#2319)
* refactor(agy): isolate the stream-json transport in its own module

Move everything only the stream-json driver uses into
cli/src/agy/legacyStreamJson/: the driver and stream process, the NDJSON
parser, the conversation-DB model and title readers, the transcript entry
types, and the agy transcript producer that lived on ApiSessionClient as
sendAgySessionMessage. The driver now registers its own queued-message
cancel handler for batches held in its retry backoff instead of reaching
through AgySession.

The loop runs the remote session through agyRemoteLauncher, the one place
that picks a transport; it is the only importer of the new module. No
behavior change.

* feat(acp): report soft-steer usage and prompt timing to the caller

Antigravity ends a steered session/prompt request early and reports each
request's share of the turn in its own response. Let soft-steer callers
receive that usage so they can total it for the turn.

prompt() waits for earlier output before it sends and for late output
after the answer. Callers can now learn when the request was sent and
answered, and a soft steer exposes when it was answered, so they can time
the agent itself and run their own timers on its answers.

* fix(acp): keep the JSON-RPC error code on failed requests

A rejected request lost the agent's error code, and the soft-steer failure
log printed the Error as {}. The rejection now carries code and data, and
the log keeps the message and code.

* feat(agy): run Antigravity on agy acp when agy supports it

agy 1.5.0 added an ACP server. When `agy --version` reports 1.5.0 or
newer, agyRemoteLauncher runs the session on a new ACP launcher over the
shared AcpSdkBackend; older agy, or a version that cannot be read
(pre-release of 1.5.0, missing binary, no answer), keeps the stream-json
driver and says why in the session. The check and the stream-json
launcher live in legacyStreamJson/, behind one call.

On ACP, one agy acp process serves the session. The agy conversation id is
the ACP session id, so stored agySessionId values resume through
session/resume without replay, whichever transport started them. The
launcher marks the session with agyProtocol 'acp' in metadata; the
stream-json launcher removes a stale marker.

- Model and effort apply per turn through session/set_model with agy's
  <model>-<effort> ids; clearing the model returns to agy's default. The
  mode is sent every turn, since agy can change it on its own.
- A queued message counts as delivered once agy takes it (its echo,
  output, or answer), or when it goes back to the composer.
- Permission modes map to ACP session modes. agy approval requests reach
  HAPI through the shared ACP permission handler. agy titles a
  run_command request with the command line, so the handler's name hints
  for HAPI's own MCP tools (change_title, think, ...) are turned off for
  agy; otherwise a command such as `grep think notes.md` would skip the
  approval prompt. Automatic approvals pick a one-time option, because the
  agy process outlives mode switches, and agy question requests always
  wait for the user.
- Titles come from session_info_update, and each turn reports one usage
  total built from the prompt responses.
- If the agy process dies, the next turn restarts it and resumes the
  conversation (the transport now reports whether its process is alive).
  A restart that fails part way leaves no half-started process in use;
  the next turn tries again. A prompt agy never started is restored to
  the composer.

* feat(agy): add accept-edits and plan permission modes

agy has default, accept-edits, and plan execution modes. Expose
accept-edits and plan as acceptEdits and plan next to request-review
(agy's default mode) and always-proceed. On agy acp they switch per turn
through session/set_mode without restarting agy; the stream-json driver
passes them as --mode, so a change restarts its process like other
launch settings. The iOS and Android catalogs mirror the new list.

* feat(agy): steer queued messages into the running turn

agy acp folds a second session/prompt into the running turn. Register the
SteerQueuedMessage handler in the agy ACP launcher and open the steering
gate for agy sessions whose metadata says agyProtocol 'acp'; stream-json
sessions stay queue-only. The launcher publishes the marker and registers
the handler before it starts agy, so the hub knows the protocol before any
turn can take a steer; until then the hub tells a steer on an agy session
that Steer is not available yet, rather than listing other flavors.

agy answers the request a steer interrupts at once (end_turn) while the
turn continues under the steer, and it lets a running tool call finish.
So the launcher keeps the turn, its steeringActive state, and thinking
until every open prompt request settles, and totals usage across them;
usage from a steer answered after its turn ended is not reported again.

agy echoes a steer as a user_message_chunk when it folds it in. The ACP
backend now reports those echoes after flushing the output before them,
and the launcher commits the steer when the echo text that follows the
prompt's own echo matches it (whitespace-insensitive; the longest steer
text wins when one contains another), so the message lands in the transcript where
it entered the turn rather than after the final answer. Each steer
resolves once (echoed or answered, held, or put back). agy rejects a
prompt while an approval is open, so a steer is refused then and the
message stays queued.

Stop applies to the whole turn lifetime. It withdraws Steer at once and
refuses steers that arrive after it. The turn is registered before agy
restarts or switches settings, so a Stop before the prompt is sent puts
it back in the composer, and a prompt still waiting to send is cancelled
as soon as it reaches agy. agy answers a cancelled prompt with a normal
`cancelled` result; when it produced no output, the prompt also goes back
to the composer. agy answers open requests with `cancelled` and
ends open tool calls; the turn's handler stays active so those final tool
updates still render. A steer cancelled before its echo is held for an
explicit Retry or Cancel, as for Cursor. A steer agy never answers is
dropped after a grace period: its row is held the same way and the agy
process is stopped (late permission requests are cancelled, not
approved), and the next turn restarts it. If agy ignores the cancel, its
process is stopped after a timeout in the same way.

* feat(agy): report and fall back when agy acp fails to start

An agy older than 1.5.0 never reaches this path: the version check in the
selection seam already runs it on stream-json. On 1.5.0 or newer, agy acp
can still fail to start or to open the conversation, for example when agy
is not signed in, the ACP install is broken, or the process exits during
start-up. The session used to end as crashed, without the reason.

The launcher now sends the reason to the chat, and the selection seam runs
the session on the stream-json driver instead, saying in the session that
Steer is not available. Only start failures fall back: errors after agy
acp is up end the session as before, and a kill during start-up is
neither reported as a failure nor falls back. The fallback stays in the
selection seam and legacyStreamJson/.

* feat(agy): show per-turn usage in the response footer

On agy acp each turn ends with a round summary: input, output, thinking,
cache-read and total tokens (summed across the requests of a steered
turn), the model, and agy's own time from sending the prompt to its last answer
(HAPI's waits before sending and for late output are left out), and
tok/s. agy reports no per-step timing, so generation time is that round
time minus the spans spent running tools or waiting for the user
(overlaps counted once), and generated tokens are output plus thinking,
as for OpenCode. The web footer renders it like the
other round summaries.

agy's usage adds up every model call of a request and agy sends no
usage_update, so it is not a context size. The turn's usage therefore no
longer goes out as a token_count for the context indicator, which stays
empty as it is for agy on stream-json.

* fix(agy): keep the session when Stop arrives while no turn is running

Stop aborts the queue wait and replaces the abort controller. The main
loop then checked the new controller's signal, found it not aborted, and
left the loop, so a late or repeated Stop after a turn had ended closed
the session and disconnected agy. The loop now checks the signal its
wait used and keeps waiting for the next message.

* fix(agy): confirm a steer only at its echo

A later steer makes agy answer an earlier steer's request at once
(end_turn) while the tool call and the turn go on, before agy has folded
the earlier steer in. Taking that answer as delivery marked the message
consumed, so a Stop before its echo left it without Retry or Cancel.

A steer is now confirmed when agy echoes it. An answer without an echo
counts only when the turn ends: confirmed if the turn ended without a
Stop, held for Retry or Cancel after one.

* fix(agy): hold unechoed steers when agy is lost mid-turn

An early-answered steer was confirmed when its turn ended without a Stop.
If agy exited before echoing it (for example when a later steer answered
its request and then the process died), the turn still ended without a
Stop, so the steer was marked consumed although agy may never have folded
it in, and Retry or Cancel was gone.

A steer request that fails with a lost transport now marks agy as lost
for the turn, and an early-answered steer without an echo is confirmed
only when the turn ends cleanly: no Stop and no lost agy process.
Otherwise it is held for Retry or Cancel.

* test(agy): pin how each steer outcome is decided

Cover the steer paths that had no test: a control command or a message
that left the queue is refused; a steer whose delivery state cannot be
recorded, or whose request agy loses while starting or writing it, is
held for Retry or Cancel; a steer sent while agy restarts stays queued
and runs next; an early-answered steer echoed before a Stop stays
confirmed; a steer agy rejects after a Stop goes back to the queue; the
main prompt stays delivered when Stop leaves a steer agy may have taken;
and an open steer is held when agy ignores the cancel or the session is
killed.

* fix(agy): confirm every steer that one echo chunk carries

When agy echoed two pending steers in one user_message_chunk, the first
match cleared every steer's echo text, so the other steer was not
confirmed at its echo. It was confirmed only when the turn ended, and a
Stop before then held it for Retry although agy had taken it. A match now
uses up only its own text, and the remaining steers keep matching.

* fix(agy): keep matching the prompt's echo after a stray echo

An echo chunk that did not continue the prompt (for example a late echo
from the previous turn) ended the wait for the prompt's own echo. The
prompt's echo that followed was then matched against the steers, so a
steer whose text the prompt contains could be confirmed before agy took
it. Such a chunk is now checked against the steers only, and the prompt's
echo is still recognized when it comes.

* fix(agy): settle the running turn before a kill returns

The runner ends the session and closes the client as soon as kill()
returns. kill() only cancelled the turn and disconnected agy, so a prompt
that was still waiting to send, or whose cancelled answer was still
draining, put itself back in the composer (or was confirmed) only after
that, and those events were lost; the session end could then record the
prompt as delivered without restoring it.

kill() now waits for the running turn to settle after disconnecting agy,
bounded to a few seconds so an agy that never settles cannot hold the
session end. Archive and runner stop both end the session through kill();
leaving remote mode does not apply to agy, and a normal exit waits for
the turn in the main loop.

* fix(web): choose the Antigravity permission mode when creating a session

The create form still showed Antigravity's old YOLO toggle, so a new
session could only start in request-review or always-proceed, although
the session mode picker offers request-review, acceptEdits, plan and
always-proceed. Antigravity now uses the same native permission select
as the other agents, filled from the shared mode catalog, and the chosen
mode is sent with the spawn.

The default stays as before: a stored YOLO toggle carries over
(on → always-proceed, off → request-review), otherwise the hub's default
applies, mapped onto agy's modes. Fallbacks that used the literal
'default' mode, which agy does not have, now ask the shared catalog for
the flavor's default instead.
2026-11-09 07:13:58 +08:00
Junmo KimandGitHub ee1e6ae7c2 feat(opencode): show round usage and tokens per second (#1668) 2026-11-07 11:27:04 +08:00
Junmo KimandGitHub df96b3b8fb fix(opencode): surface v2 scheduled retries (#2300) 2026-11-07 08:15:41 +08:00
Junmo KimandGitHub 5ce30b20c9 feat(cli): auto-steer ping-peer messages into active peer turns (#2298)
* refactor(shared): describe steering support with a per-flavor capability table

Replace the flavor comparison chains in isSteeringSupportedForFlavor and
isSteeringSupportedForSession with a table keyed by flavor, so a protocol
restriction such as legacy Cursor sessions sits next to the flavor it applies
to. Results are unchanged for every flavor and Cursor session shape.

* feat(cli): auto-steer ping-peer messages into active peer turns

Peer messages in auto mode only steered Codex turns. Record each flavor's
active-turn signal in the steering capability table, expose it as
hasActiveSteeringTurn(), and use it in both the peer sender and the waiting
queue's Steer gate, so remote Claude, Pi, OpenCode and Cursor ACP targets with
an active, steerable turn also get the queued message steered into it.

Auto still stores one ordinary queued message first and attempts the existing
steer action at most once. A steer that the hub rejects or that stays
unconfirmed keeps the accepted message without resending, and the receipt now
says which of "not attempted", "rejected by hub" or "not confirmed" applied.
Inactive targets, --wake, explicit steer and explicit queue are unchanged.

* fix(cli): keep ping-peer steer notes accurate when delivery is unresolved

Auto receipts reported every unsuccessful steer response as "rejected by hub"
and promised the message stays queued. Only a refusal before any native steer
is dispatched (an HTTP 4xx, or a Hub failure without a localId) is definitive.
A failure that carries a localId, such as an RPC timeout or an OpenCode steer
that is still being reconciled, now reads "steer not confirmed; delivery
unresolved" without promising queued delivery.

Auto notes for a skipped steer used the explicit-steer refusal text, so an
accepted receipt could say "no message sent". They now use separate reasons
(for example "target is idle"); explicit steer wording is unchanged.
2026-11-07 08:13:48 +08:00
Junmo KimandGitHub 0b82bd7658 fix(acp): use content as tool output when rawOutput has only metadata (#2299)
* refactor(acp): extract tool result output selection

* fix(acp): use content as tool output when rawOutput has only metadata

OpenCode v2 sends the real tool output in the ACP content array and puts
only metadata in rawOutput. rawOutput won unconditionally, so every tool
result card showed just the metadata or no output.

When rawOutput is an object whose only key is metadata and content
normalizes, report the normalized content as the output and keep the
metadata next to it. rawOutput that carries a body is left untouched.

* fix(web): render OpenCode lowercase tool names with their dedicated result views

OpenCode reports built-in tools by lowercase id (bash, glob, grep, ...),
but the result view registry is keyed by Claude-style names. Only read had
an alias, so the rest fell back to the generic markdown view: shell output
lost its line breaks and file names rendered like links.

Resolve a small set of OpenCode ids to the matching registered view after
the exact-name lookup, so exact names keep their current views. Tools whose
dedicated view reads Claude-shaped fields (skill, todowrite, patch,
question) stay on the generic view.
2026-11-07 08:12:56 +08:00
Junmo KimandGitHub b9880693a7 fix(opencode): describe display tools via Code Mode execute for OpenCode v2 (#2307)
* fix(opencode): describe display tools via Code Mode execute for OpenCode v2

OpenCode v2 can list MCP tools only in a Code Mode catalog whose entries
are callable as JavaScript inside the execute tool, so the hapi_display_*
names and aliases HAPI advertised may not exist there. Replace the three
per-tool display hints used by the OpenCode instructions with one block
that prefers a direct tool and otherwise calls tools.hapi.<tool>({ path })
through execute. The block appears once in both the ACP first prompt and
the local hapi-instructions.md. Hints for other agents are unchanged.

* fix(opencode): do not re-display user-provided files unless asked

Agents sometimes called the display tools on a file the user had just
attached or asked them to read, which only echoes it back. Say in the
display tools block that the tools are for files the user has not been
shown, and that files the user attached, pasted, or pointed to are not
displayed again unless the user asks.
2026-11-06 15:51:12 +08:00
Junmo KimandGitHub 3ce46a9b13 feat(acp): re-enable change_title for ACP launchers with manual title precedence (#1672)
* feat(acp): re-enable change_title for ACP launchers with manual title precedence

opencode/cursor/kimi disabled the hapi change_title MCP tool (#1028),
relying solely on native ACP session-title sync. When the agent never
generates a native title there was no way to set one short of hub API
calls.

Re-enable change_title on those launchers. The shared title-sync
controller marks manual titles, so later native sessionInfoUpdate
titles no longer overwrite them.

* fix(acp): include copilot in change_title re-enable and harden tests

Copilot has the same ACP title-sync shape as opencode/cursor/kimi, so it
gets the same shared controller wiring. Add a cursor regression test
asserting one controller instance is shared across backend (re)creation
paths and cover the onChangeTitle failure path.

* fix(acp): persist manual title precedence in session metadata

The manual flag lived only in one controller closure, so a recreated
remote launcher or a resumed session started fresh and let the next
native ACP sessionInfoUpdate overwrite a change_title rename. Store
acpManualTitle in session metadata and initialize new controllers from
it.

* fix(agent): preserve acpManualTitle through existing-session bootstrap

bootstrapExistingSession rebuilds metadata through an allowlist, so the
manual-title marker was dropped on process resume and native ACP title
sync could overwrite a change_title rename.

* fix(cursor): preserve manual title precedence across live relaunch
2026-11-05 12:00:37 +00:00
weishu 893260ac9b Release version 0.34.3 2026-11-05 18:39:20 +08:00
weishu 6712e19dfa Release version 0.34.2 2026-11-05 11:29:22 +08:00
weishu 5a5731f938 fix(cli): stop peer pings from waking or broadcasting to unrelated sessions
ping_peer resumed any inactive target by default, and list_peers returned
the whole namespace (including offline sessions) with no machine or cwd, so
agents re-woke finished collaborators and broadcast exclusive-work notices
to every listed peer.

- ping_peer refuses inactive targets unless wake=true (CLI --wake, exit 5);
  spawn_peer keeps waking its own fresh child.
- list_peers lists active sessions only (hub GET /api/sessions?active=true)
  unless includeInactive (CLI --list --all); rows show busy/idle, machine,
  cwd, and same-machine/same-cwd marks relative to the caller.
- inspect_peer reports the peer's machine.
- Prompts and tool descriptions: message only task-related peers, inspect
  unfamiliar peers first, never broadcast, never wake for FYI/status.
2026-11-05 11:28:40 +08:00
weishu 13541a1928 Release version 0.34.1 2026-11-04 16:00:13 +08:00
JeeandGitHub e2b2af695b feat(codex): support explicit local model catalog configuration (#2266)
* fix(codex): reuse local model catalogs by default

* fix(codex): verify catalog provenance and native schema before reuse

* fix(codex): keep refresh credentials out of discovery homes

* refactor(codex): reduce catalog support to explicit configuration

* fix(codex): invalidate selected catalogs and resolve shim names
2026-11-04 15:08:54 +08:00
3affdd92c9 fix(cli): silence Cursor post-done harness Briefly inform turns (#2268)
* fix(cli): silence Cursor post-done harness "Briefly inform" turns

After AGENT_NOTIFY_SUMMARY status:done, drop notify_on_output resume
speech/tools/thinking until the next HAPI user prompt so the competing
finished-shell system ping cannot force a second user-visible reply.

Fixes #2267

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

* fix(cli): narrow post-done silence to speech; keep soft-steer active

Address cold review + Codex P2: suppress only text/reasoning after
status:done, treat outstanding soft-steer as an active turn, and add a
launcher regression for harness-resume drops.

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

* fix(cli): discard suppressed harness buffers before next prompt

After a done close, idle-flushed harness speech stays buffered. Clear it
before reopening the silence gate so prompt()'s pre-swap drain cannot
resurrect the redundant reply (Codex P2 on #307).

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

* fix(cli): keep post-done silence through drain and handler swap

Address upstream bot Minors on #2268: suppress speech after done even
during promptInFlight drain windows, and reopen the gate only once when
promptGeneration advances after the handler swap (not before prompt()).

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

* fix(cli): seal done footer before quiet-drain harness coalescing

Address #2268 Minor: Cursor can append finished-shell speech during the
post-prompt quiet window onto the same buffer as AGENT_NOTIFY_SUMMARY
done, which hid the end-anchored footer. Seal the done segment when
flavor=cursor at native response return, and truncate buried harness
prose in the launcher as defense in depth.

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

* fix(cli): harden post-done seal against queue race and false closes

Await sessionUpdateQueue before sealing a Cursor done footer; keep note()
end-anchored; fence-aware truncate with soft-steer exemption and same-line
glue handling so examples and steered speech are not cut (#2268 Minors).

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

* fix(cli): keep seal end-anchored; harden footer scan edges

Seal only flushes end-anchored done footers (soft-steer truncate stays in
the launcher). Footer scan skips inline-code examples and tracks JSON
string/escape state so braces inside summary values do not break glue
detection (#2268 Minors).

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

* fix(cli): ignore tilde-fenced done-footer documentation examples

Recognize ~~~ fences with matching opener length alongside ``` so
truncate/seal defense does not treat tilde-fenced footer examples as a
real post-close (#2268 Minor).

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 15:06:42 +08:00
Junmo KimandGitHub c4847b241e feat(opencode): support mid-turn steering (#1981)
* feat(opencode): support mid-turn steering

Register the per-message Queue/Steer RPC on the OpenCode remote launcher so
a waiting-queue row can be delivered into the active turn as a concurrent
ACP session/prompt (soft inject, no cancel, no mode/model/effort mutation),
reusing the existing reservation/delivery-state protocol shared with Codex
and Cursor ACP.

The steer gate is closed synchronously by every cancelling or terminal path
(normal-prompt finally, abort, switch/exit, teardown, stderr stall cancel),
each steer operation is tracked from the moment its reservation is taken
until completion plus all restore/consumed bookkeeping settles, and the
foreground prompt drains those operations — abort-aware through the original
turn signal — before ready, thinking=false or the next batch. steerability is
published through the existing agentState.steeringActive flag so the web's
queued Steer button is reachable.

Gate the feature on the shared steering flavors (now including opencode) and
update the hub's supported-flavor wording.

* fix(opencode): acknowledge native steering acceptance

* fix(opencode): preserve steering delivery outcomes

* docs(opencode): remove obsolete abort-race comment

* fix(opencode): preserve steering resolution ownership

* fix(opencode): isolate ambiguous steering attempts

* fix(opencode): compare resolved steering settings

* fix(opencode): reconcile steering receipts after dispatch

* fix(opencode): distinguish pending steering delivery outcomes

* fix(opencode): restore receipts after successful native responses

Track native input requests separately from detached steer operations. Resume receipt correlation after inputs quarantined by cancellation return their own successful responses, while keeping uncertain writes on completion-based confirmation.

* fix(opencode): bound receipt proof to unambiguous native inputs

* feat(opencode): steer v2 inputs through native inbox

* fix(opencode): preserve v2 restoration and cancellation ownership

* docs(opencode): describe v2 inbox steering confirmation

* fix(steer): expire Claude confirmation with its owning worker
2026-11-03 18:37:53 +08:00
AnanovoandGitHub 82c5c00a38 feat(web,hub): add opt-in search for session message content (#1598)
Adds an opt-in content search over session messages, alongside the
existing metadata search. An FTS5 index covers visible user and assistant
prose; the sidebar gains a scope toggle, and selecting a result opens the
matching message rather than the session tail.

Search scope is a two-state toggle rather than a dropdown: a 48x48 target
matching the clear endcap, distinct glyphs for session details vs message
text, tooltips naming the real scopes, and the active mode kept on the
collapsed chip (tiann/hapi#2081).

Dogfooded on a live 1178-session fleet. The scope toggle and reading
forward from a search result were both click-tested on that install —
the latter walking six bounded pages through a 1,507-message session and
stopping correctly at the session head.

The per-commit history does not survive this squash; the review trail —
including which commit closed which finding — is on the PR threads.

Fixes #1554
Fixes #2081
2026-11-02 15:20:45 +00:00
weishu 1f4518df20 Release version 0.34.0 2026-11-02 19:07:01 +08:00
AnanovoandGitHub 3fc15e92cf fix(dsh): resume DSH ACP sessions after HAPI restart (#1926)
* fix(dsh): resume DSH ACP sessions after HAPI restart

* fix(dsh): register active session handoff

* fix(dsh): preserve native id in summaries

* fix(dsh): keep native resume on recorded machine

* test: refresh CI checks
2026-11-02 18:24:08 +08:00
AnanovoandGitHub 3208199f99 fix(files): optimize exact path and directory search (#1778)
* fix(files): optimize exact path and directory search

* fix(web): preserve incremental file mention search

* fix(cli): contain recursive file search within workspace

* perf(cli): reuse canonical workspace path

* fix(cli): classify archived workspace file stats
2026-11-02 18:08:32 +08:00
AnanovoandGitHub 8c602eb7a1 fix(cli,hub): prevent premature archive failures on Windows (#2126)
* fix(cli,hub): prevent premature archive failures on Windows

* fix(cli): preserve tree-wide forced shutdown escalation

* fix(cli): stop disconnected survivor subtrees completely

* test(hub): assert structured archive cleanup uncertainty

* fix(cli): use invariant Windows process markers

* fix(cli): attempt Windows termination when CIM fails
2026-11-02 18:03:26 +08:00
bb4b136f60 feat(cli): switch Claude effort without restarting the process (#2262)
* feat(cli): switch Claude effort without restarting the process

Changing effort in a remote Claude session made the next prompt restart
Claude with --resume and a new --effort flag, so the switch cost a
process start and a slower first reply. Claude Code's apply_flag_settings
control request changes the session effort in place (null restores the
model default), the same way set_permission_mode already changes modes.

The launcher now applies an effort-only change to the running process
before delivering the prompt. Any other process-level change, a refused
request, or no reply within 5 seconds keeps the existing restart path,
so Claude Code builds without the request still work.

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

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

* fix(cli): keep the prompt when Claude exits during a live effort change

The launcher awaited the effort control request with the dequeued batch
held only in a local. If Claude exited before replying, the attempt
ended, and the late continuation handed the batch to the closed
claudeRemote, which dropped it.

Park the batch in `pending` before awaiting and take it back only when
Claude applied the change and its process is still open. Otherwise the
next attempt delivers it, starting with the new effort.

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

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

---------

Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:00:53 +08:00
7f5d6b17f3 feat(peer): spawn-peer remit + rename-proof Parent UUID stamps (#1922)
* feat(cli): spawn-peer with required remit and MCP spawn_peer

Machine spawn creates an empty composer; stuffing message into that
JSON is stripped. Add hapi spawn-peer and MCP spawn_peer that spawn,
rename, deliver via the ping-peer path, and fail closed unless the
remit is on the new session. Reject message/prompt/text on machine
spawn with 400. Do not auto-approve spawn_peer in default/read-only.

Fixes #1509

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

* fix(cli): reject overlong spawn-peer names before spawn

Hub rename max is 255; continuing past PATCH 400 left a live session under a different title. MCP/steer copy now says the hub 400s a spawn-body remit instead of stripping it.

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

* fix(cli): wait for fresh spawn-peer child instead of resuming it

Machine spawn can return while the hub row is still inactive. ping-peer then POSTed /resume, which can launch a second agent because the original spawn has no existingSessionId for runner dedupe.

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

* fix(cli): reject flavor-illegal permissionMode before spawn-peer

Codex + bypassPermissions (and Pi + any mode) used to reach the runner and fail after a child existed, or silently drop the mode. Check isPermissionModeAllowedForFlavor when both agent and mode are explicit.

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

* fix(cli): treat omitted spawn-peer agent as Claude for permissionMode

Hub and runner default agent to claude when spawn omits it. Validate permissionMode against that effective flavor so yolo/read-only fail closed before a child starts.

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

* fix(cli): resolve spawn-peer dir locally and archive failed children

Relative --dir values were forwarded unchanged, so the runner resolved them against daemon cwd. Remit delivery failures also left the new session running, so a retry spawned a duplicate. Resolve in the caller and best-effort archive the child before rethrowing.

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

* fix(cli): verify remit before archiving a failed spawn-peer child

A timed-out ping-peer POST can still land the remit. Check the transcript before archive, and only say the child was archived when the hub returns ok.

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

* fix(cli): swallow spawn-peer transcript GET errors and skip unapplied names

A thrown messages GET after spawn skipped archive and leaked a live child. Treat transport errors as a miss so the verify loop can retry, then clean up. Also do not return a requested name the hub never applied.

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

* feat(spawn-peer): hub peerSpawnDefaults + model/effort spawn surface

Add hub settings peerSpawnDefaults (agent, permissionMode, per-flavor models)
with stock claude/yolo/sonnet fallbacks. spawnPeer resolves explicit args →
hub settings → stock, maps yolo to flavor equivalents, and forwards model/effort
into machine spawn. Settings UI under General → Agents; MCP/CLI optional overrides.

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

* test(hub): use cursor-valid permission mode in peer spawn defaults test

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

* fix(cli): teach spawn_peer that omit permissionMode means yolo

MCP copy said "pass permissionMode only when the operator asked", so agents
omitted it and got hub/stock whatever was stored — often approval-gated
default. Clarify omit = yolo via peerSpawnDefaults/stock; pass only to tighten.

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

* fix(hub,web): apply peerSpawnDefaults to machine spawn and New Session

POST /api/machines/:id/spawn now resolves omitted agent/permissionMode/model
from hub Settings, and New Session seeds from the same peerSpawnDefaults so
UI create and peer spawn share one authoritative default (stock yolo).

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

* fix(web): NewSession hub seed respects sticky prefs + QueryClient in tests

Sticky localStorage last-used agent wins over hub seed; machine spawn still
applies peerSpawnDefaults server-side. Tests provide QueryClientProvider.

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

* test(web): mock CREATABLE_AGENT_FLAVORS for settings general peerSpawn UI

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

* test(web): stabilize NewSession tests after hub peerSpawnDefaults seed

Wrap remaining mounts in QueryClientProvider, pre-seed hub settings so a
late useQuery resolve cannot wipe in-test model picks, and use neutral
stock permission defaults in the fixture.

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

* fix(spawn-peer): address tip Codex Majors for peerSpawnDefaults

Preserve explicit yolo booleans on machine spawn, fail closed when hub
defaults cannot load, validate permission modes against the resolved
agent, remap auto-approval across flavors, and stop late hub settings
from wiping New Session edits. Reject retired agents in spawn defaults
and restore the CLI executable build docs.

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

* fix(spawn-peer): address follow-up tip Codex Majors

Stop absent Yolo localStorage from beating hub defaults, track New Session
edits before late hub seed, reject incompatible machine-spawn permissions,
resolve MCP spawn_peer paths against the session working directory, and
hide unsupported Codex safe-yolo from Settings spawn defaults.

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

* fix(spawn-peer): clear tip-2 CI and follow-up Codex Majors

Omit permissionMode for Pi/DSH, preserve explicit Yolo-off across delayed
hub seed, fix settings test mocks for launch permission helpers, and
restore unrelated CLI README lifecycle/ACP docs.

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

* fix(spawn-peer): tip-3 Majors for seed edits and launchable modes

Skip hub agent seed after permission edits, resolve inherited modes via
the launch catalog (AGY request-review fallback), preserve hub Cursor
models through preference restore, and restore Codex auth README nuance.

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

* fix(web): tip Minors for Cursor/Grok hub permission seeding

Give Cursor the native permission select so Plan/Ask survive machine
spawn, and re-apply Grok hub permissions after agent-init resets.

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

* fix(spawn-peer): tip Minors for Cursor select and hub seed remap

Map hub permission through resolvePermissionModeForFlavor, keep native
Default when agent is explicit without a model, and assert Cursor Plan/Ask Mode labels.

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

* fix(web): tip Minors for delayed hub seed and Default model

Apply hub permission/model to unset fields even with a sticky agent,
preserve explicitly saved auto models, and seed OpenCode/AGY selectors
from hub defaults.

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

* fix(spawn-peer): tip Minors for model edit sticky and clear override

Mark OpenCode/AGY model picks as edited so delayed hub seed cannot
overwrite them, and treat empty hub model values as clear sentinels.

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

* fix(spawn-peer): tip Majors for models patch typing and remit page scan

Type the models patch as NonNullable and paginate transcript verification
oldest-ward so a busy child is not archived when the remit leaves page 1.

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

* fix(web): tip Minor — keep agent after explicit model pick

Do not apply a late hub default agent when the operator already chose a
model; otherwise preference restore drops that selection.

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

* fix(spawn-peer): tip Cursor YOLO migrate and Codex effort map

Bridge Cursor's saved YOLO toggle (incl. false) into native Default over
hub yolo, and send Codex/OpenCode --effort as modelReasoningEffort.

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

* fix(web): tip Majors — scoped YOLO bridge and catalog fallback

Keep unsupported saved permission modes at Default instead of hub yolo,
and apply delayed YOLO migration only when the sticky bridge agent matches.

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

* fix(cli): drop rebase conflict markers in startHappyServer

Both sessionDisplayRename and spawnPeer imports are required after
rebasing onto upstream rename work; markers had slipped into tip.

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

* fix(web): wrap Kimi NewSession tests in QueryClientProvider

Hub settings useQuery requires a provider; upstream Kimi catalog tests
rendered bare and broke after the spawn-peer rebase onto main.

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

* feat(peer): rename-proof Parent UUID stamp on spawn remits

Orchestrated spawn_peer / spawn-peer remits now auto-stamp a durable
[title](/sessions/<uuid>) Parent chip (fail-closed in-session). MCP copy
forbids inventing titles; UUID stays identity after parent rename.

Refs heavygee/hapi#175

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

* style(peer): plain hyphen in Parent-stamp warning and test comment

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

* fix(peer): reject blank remit before Parent stamp

Codex review on #1922: stamping first turned empty remits non-empty and
bypassed the idle-session guard. Also only treat ## Parent blocks as
already-present so bare /sessions citations still get the chip.

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

* fix(peer): gate New Session Create on hub defaults; require Parent chip

Codex tip review on #1922: block Create while getHubSettings is pending so
stock mount defaults cannot bypass restrictive hub peerSpawnDefaults; skip
Parent stamp only when ## Parent already has a markdown session chip; clarify
codex resume takes a native thread id.

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

* fix(peer): resolve MCP spawn cwd; Agents settings section

Codex Major on #1922: spawn_peer relative directories now prefer the
launcher cwd (Codex --cd), then skillLookup, then session metadata.path.
Move peerSpawnDefaults UI into the unused Agents settings section.

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

* fix(peer): pass session cwd to MCP spawn_peer; Agents settings section

Codex tip review on #1922: resolve relative spawn_peer directories from the
launcher working directory (Codex --cd), skillLookup, then metadata.path;
move peerSpawnDefaults UI into the Agents settings section.

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

* fix(peer): skip archive on unread transcript; validate startingMode after hub agent

Codex tip review: do not archive a child when remit verification cannot read
the transcript; run AGY/DSH remote-only startingMode checks against the
resolved hub agent; update MCP bridge test expectations for workingDirectory.

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

* fix(peer): treat exhausted remit pagination as unverifiable

Hitting the messages page cap with hasMore still true must not count as an
observed-empty transcript — that would archive a child whose remit may still
exist on older pages.

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

* docs(cli): list HAPI_API_URL as optional with localhost default

Codex tip review: the README had moved HAPI_API_URL under Required even
though configuration defaults it to http://localhost:3006 (and settings can
supply a URL). Also drop trailing whitespace flagged by git diff --check.

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

* fix(peer): re-verify empty transcript before archiving failed spawn

An earlier observed-absent page plus later unread GETs must not archive a
child whose remit may have landed after the first empty read.

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

* fix(peer): never auto-archive on spawnPeer failure path

Timed-out remit POSTs and empty-read/archive TOCTOU races can still land
work on the child. Leave the session running with its id for inspection
instead of terminating an in-flight peer.

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

* fix(peer): classify empty_session from final remit verify

An earlier empty transcript read must not stick as empty_session once
later message GETs become unavailable — report verify_failed instead.

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

* fix(peer): recognize escaped brackets in Parent chip labels

Titles with ] were escaped in the chip label but the idempotency regex
stopped at the first raw bracket and re-stamped a second Parent block.

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

* fix(peer): avoid Parent chip regex backtracking on backslashes

Exclude \\ from the single-char label alternative so escaped pairs have
one parse path — long nonmatching backslash runs no longer explode.

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

* feat(cli): MCP/CLI spawn_peer --machine for cross-host remits

Wire optional machine (UUID or hostname via GET /api/machines) through
MCP spawn_peer and hapi spawn-peer into existing spawnPeer({ machineId }).
Skip local directory existence checks for cross-host targets to match the
estate wrapper; keep fail-closed remit verify.

Fixes tiann/hapi#1931

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

* fix(peer): reject ambiguous spawn --machine label matches

Tip bot Major on #1922: hostname/displayName selectors that match more
than one online runner now fail closed with ambiguous + UUID guidance.

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

* fix(peer): preserve cross-OS absolute dirs for spawn --machine

path.resolve on the caller OS was rewriting foreign absolute roots
(C:\… on Linux, /srv/… on Windows) before the hub spawn POST. Detect
POSIX or Windows absolute paths and only resolve relative directories.

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

* fix(peer): resolve spawn dirs after local vs remote is known

Defer directory resolution until the target machine is selected. Remote
spawns still preserve foreign absolute roots; local spawns use native
path.resolve so Windows drive-less paths like \repo bind to the caller
drive.

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

* fix(web): apply delayed DSH model defaults without replacing edits

* fix(web): preserve hub permission defaults across form remounts

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: weishu <twsxtd@gmail.com>
2026-11-02 13:17:22 +08:00
weishuandGitHub 7bb2eb914f feat(claude): mid-turn Steer for remote Claude sessions (#2259)
* feat(claude): mid-turn Steer for remote Claude sessions

Queued messages can now be steered into a running Claude turn, the same as
Ctrl+X Ctrl+S in the Claude TUI. The row is written to the live stream-json
stdin and Claude folds it in at its next tool boundary.

- Spawn Claude with --replay-user-messages and tag every stdin message with
  a uuid; the echo acks pickup and is never relayed to chat
- A result that arrives while a steer is still unacked does not end the
  turn: Claude runs a follow-up turn for it, so ready waits for that result
- Launcher registers steer-queued-message: reserve the row, reject control
  commands and mode mismatches, ack the hub after the write, mark consumed
  (steered) on the echo; abort before pickup holds the row indeterminate,
  an unprompted exit requeues it
- Open the shared steer gate and peer/hub wording to Claude (remote only)

* fix(claude): retire completed input before a steer follow-up turn

- Generalize onCompactResultAccepted to onResultAccepted and fire it when a
  result arrives with a steer still unacked, so a stream failure during the
  follow-up turn recovers only the steer instead of replaying the finished
  prompt
- Close the steer target and settle pending steers when query() setup
  throws, so a retry backoff cannot accept a steer nobody will read
2026-11-02 10:12:14 +08:00
weishu 7ba52b9a5a Release version 0.33.6 2026-11-01 20:30:00 +08:00
weishu 679a2e36ca feat(cli): show images agents view inline in chat
Codex view_image (app-server imageView items) and Claude Code tool results
with image blocks (Read of an image, screenshot tools) now emit
generated-image messages tied to the tool call, so web/iOS/Android render
what the agent looked at instead of only a path. Claude transcript lines
forwarded to the hub drop the duplicated base64 payloads.
2026-11-01 20:29:37 +08:00
AnanovoandGitHub ecf40d8851 feat(web): fork active and archived sessions from the session list (#2258)
* feat(web): fork active and archived sessions from the session list

* fix(codex): preserve fork titles during history replay

* fix(web): limit list forks to supported Codex sessions
2026-11-01 14:52:42 +08:00
weishu ba2b5c5651 Release version 0.33.5 2026-11-01 13:19:38 +08:00
weishu b0d01c5307 Release version 0.33.4 2026-11-01 12:26:43 +08:00
weishu 59dcddf32b fix(codex): support queued async user questions 2026-11-01 10:34:36 +08:00
AnanovoandGitHub 46bae9b0f1 fix(codex): fork archived sessions without reopening the source (#2231)
* fix(codex): fork archived sessions without reopening the source

* fix(codex): reconcile interrupted archived fork recovery

* fix(codex): release rejected forks and serialize source startup

* fix(codex): fence unconfirmed resume startup across retries

* test(codex): validate durable resume recovery and serialize archive

* fix(codex): block local resume of pending archived fork sources

* fix(hub): coalesce concurrent resume requests to preserve idempotent startup

* fix(hub): bypass startup coalescing for PTY sessions
2026-11-01 09:55:01 +08:00
Junmo KimandGitHub be41e854e0 feat(codex,opencode): show compaction summaries and token counts (#2249)
* fix(chat): render available compaction facts

* feat(opencode): unify native compaction summary cards

* fix(opencode): report actual compaction application lifecycle

* feat(codex): render native compaction checkpoints and metrics

* fix(chat): render compaction summaries and token facts in native clients

* fix(opencode): preserve transcript priming across read failures

* fix(opencode): recover snapshot-only replies after attachment
2026-11-01 09:54:10 +08:00
AnanovoandGitHub 3e628cad5d fix(test): make shared launch path assertions cross-platform (#2255) 2026-11-01 09:53:23 +08:00
SSU-WEI HUANGandGitHub f8e55fb930 feat(agy): reuse a persistent headless stream process (#2248) 2026-10-30 19:11:26 +08:00
013ace8e88 fix(cli): show resolved versions in Claude model labels (#2245)
Co-authored-by: Kiyoshi Guo <kiyoshi.guo@bytedance.com>
2026-10-30 14:37:59 +08:00
SSU-WEI HUANGandGitHub 5fcd4a067a fix(agy): separate model and effort selection (#2244)
* fix(agy): separate model families and reasoning effort

* fix(agy): report startup before model discovery
2026-10-30 07:36:13 +08:00
weishu d9acc0c31e Release version 0.33.3 2026-10-29 22:29:49 +08:00
3f8686e623 feat(claude): offer the four current Claude models, drop the 1M presets (#2153)
* fix(claude): drop the obsolete 1M model presets

The opus, sonnet and fable aliases now resolve to models with a native 1M
window (Opus 5.5, Sonnet 5.5, Fable 5.1), so Claude Code documents the
"[1m]" suffix as having no effect on them and its own /model picker no
longer lists 1M rows. Remove Sonnet 1M / Opus 1M / Fable 1M from the
shared, Android and iOS catalogs.

Sessions stored with a "[1m]" value keep working: the composer keeps
the current model selectable, and the context-budget fallback treats any
"[1m]" model and the remaining aliases as 1M, so local-mode sessions on
plain opus/sonnet no longer show a 200k budget.

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

* fix(cli): seed a 1M turn-1 context window for bare Claude aliases

With the 1M presets gone, a session on plain fable/opus/sonnet must not
seed 200k before its first result: those aliases now resolve to models
with a native 1M window. Seed 1M when the selected model is a preset
alias; an explicit full id still seeds conservatively until its result
arrives.

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

* feat(claude): offer the four current Claude models as presets

The Claude presets now mirror the aliases Claude Code's /model lists, in
its order: Opus, Fable, Sonnet, Haiku. Each alias resolves to the newest
model of its family, and all four have a native 1M window, so neither
1M variants nor pinned older versions are offered. Haiku was missing.

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

* feat(claude): read the effective context window from get_context_usage

The 1M seed for the aliases is wrong for users who disable 1M
(CLAUDE_CODE_DISABLE_1M_CONTEXT) or cap it with autoCompactWindow. In
remote mode, ask Claude via the get_context_usage control request after
each system/init and use its maxTokens, which is what /context shows.
A result's raw contextWindow no longer overwrites that value. Older CLIs
that reject the request keep the existing seed.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: weishu <twsxtd@gmail.com>
2026-10-29 22:28:59 +08:00
Junmo KimandGitHub 97224c9dd7 fix(runner): recover sessions after host reboot (#2169)
* fix(runner): recover sessions after host reboot

* fix(runner): settle startup when process generation changes

* test(runner): wait for Hub RPC readiness before resume
2026-10-29 22:13:56 +08:00
JeeandGitHub 13fec3e157 fix(web): show session mentions without waiting for remote file search (#2170)
* fix(web): show session mentions without waiting for remote file search

* fix(web): preserve selected files during mention refresh

* test(runner): avoid fixture PID collision with test process
2026-10-29 22:13:38 +08:00
557ed3c99f perf(codex): reduce history replay during thread recovery (#2214)
* perf(codex): reduce history replay during thread recovery

* fix(codex): restore live child subscriptions during bounded replay

---------

Co-authored-by: gaodq <gaodq@koal.com>
2026-10-29 22:13:11 +08:00
AnanovoandGitHub 0f76485ad9 feat(web): support local Markdown images in conversation messages (#2215)
* fix(web): resolve relative Markdown assets in file previews

* fix(web): harden standalone Markdown asset resolution

* fix(web): preserve Markdown URI and image policies

* fix(web): route Markdown file links through app history

* fix(web): preserve session reference navigation in previews

* feat(web): support local Markdown images in conversation messages

* fix(cli): bound session file reads

* fix(cli): avoid blocking bounded reads on FIFOs

* test(cli): run FIFO regression with Bun

* fix(hub): preserve legacy session file RPC calls

* test(web): update markdown preview fixture context

* fix(cli): reject symlinked session files outside workspace
2026-10-29 22:12:57 +08:00
AnanovoandGitHub f29be07bb9 fix(codex,web): preserve late command result identity and timing (#2239) 2026-10-29 22:12:27 +08:00
weishu 9384ce031b feat(cli): add Codex-aware auto peer delivery
Default peer CLI and MCP messages to auto, steering eligible Codex turns and queueing otherwise. Preserve explicit delivery modes and uncertain-send safety, and clarify steer guidance for important time-sensitive findings.
2026-10-29 22:02:43 +08:00
weishu 730dfcb22e Release version 0.33.2 2026-10-29 13:24:52 +08:00