The Feishu comment bot's five tools (feishu_doc_read and the four
feishu_drive_* tools) answered "Feishu client not available" on every call.
feishu_comment stored the Lark client in a threading.local on the thread
that starts the agent, and since ededa8c4f1 the agent runs each tool call
on a worker thread. The worker gets a copy of the caller's context
variables, not its thread-locals.
The client handle is now a context variable in tools/feishu_lark.py, set
and reset by token around the agent run. The handle's row in
gateway/turn_thread_reset.py goes, because nothing is keyed by thread any
more. The bot's reply was never affected: it is posted outside the tools.
A /model switch before the first reply saved the nested gateway_runtime route,
then a fallback serving that first call rewrote only the model column, and
resume read the fallback model with the switched provider. Every route writer
now stamps its model into gateway_runtime, and session_resume_route returns the
model and route together from one record (no replacement row for callers).
tools/ holds model tools. These six files register none: they snapshot and
restore a working directory for the agent loop, /rollback, /undo's
changed-files line and `hermes checkpoints`. They move next to the agent
loop that takes the checkpoints:
tools/checkpoint_manager.py -> agent/checkpoints/manager.py
tools/checkpoint_maintenance.py -> agent/checkpoints/maintenance.py
tools/checkpoint_pruning.py -> agent/checkpoints/pruning.py
tools/checkpoint_refs.py -> agent/checkpoints/refs.py
tools/checkpoint_undo_hint.py -> agent/checkpoints/undo_hint.py
tools/checkpoint_manager_profile_rename.py -> agent/checkpoints/manager_profile_rename.py
agent/checkpoints/__init__.py is a docstring only. Nine test files move to
tests/agent/checkpoints/. Every importer changes its import line in place,
inside the same function. Nothing stays at the old paths: none of the six
names is on the plugin API list, the shipped-release list or the
old-updater list.
Behaviour is unchanged. The four loggers keep their tools.checkpoint_*
names, so the lines stay under `hermes logs --component tools`. The folder
is not a root checkpoints/ package because the checkpoint store is
HERMES_HOME/checkpoints, which is the same directory as such a package on an
install whose checkout root is HERMES_HOME. agent.* is already packaged, so
pyproject.toml and the lists of root packages do not change.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py.
A minimal runner (SimpleNamespace in several gateway stream tests) has no
_show_reasoning_for_source; resolve it defensively and default to streaming,
matching how _show_reasoning itself is read here.
On Telegram (and every streaming messaging platform) with show_reasoning on,
the answer streamed in live and the 💭 reasoning block was sent as a separate
message AFTER it (#7251), so the chat showed the answer first and its reasoning
below — inverted, and doubly confusing across a multi-turn exchange.
When show_reasoning is effectively on for a messaging platform, the final
answer is no longer streamed live: the gateway's normal final send delivers the
reasoning block and the answer together as ONE message, reasoning on top
(_hmwa_prepend_reasoning, the same combined form the non-streamed path has
always produced). Interim tool-progress commentary is unaffected, and LOCAL
viewers (Desktop/TUI) are unchanged — they read reasoning off their event
stream, never the projected block.
- Extract _show_reasoning_for_source as the single resolver for the block
renderer and the new stream gate.
- Gate want_stream_deltas off in _setup_stream_consumer when reasoning leads,
reusing the existing stream_deltas_enabled=False mechanism (#105341) so the
turn is not marked already_sent.
- Drop the now-dead trailing-reasoning send; keep the uncertain-final ledger
for non-reasoning streamed turns.
`_FAILED_TASK_STATES` listed "failure", `_batch_status` and the worker
completion validator accepted "success", and the worker claim tested the
ledger state 'finalizing'. Every child-entry and unit-status writer was
read (child_run, dispatch, resumable, routes, auto_resume, async_delegation,
cronjob_tools): none writes "failure" or "success", and 'finalizing' is
only ever an in-memory record status, never a ledger row. `git log -S` finds no past writer of either word as a
child status, so no persisted row on a user's disk carries one.
`_FAILED_TASK_STATES` is now derived from SUBAGENT_FAILURE_STATUSES plus
the three states only the failed panel shows.
Greptile on #156546: anchoring the prefixes on the raw token let a colored
key through. \x1b[32mAKIA... has a raw m before AKIA, so the hold released
it, while the redactor strips CSI sequences first and masks the completed ID
only once the rest arrives, after its head was already on screen.
The anchor and the partial-prefix scan now run on both the raw token and
_strip_shadow(token)[0], the view mask_control_split_tokens matches. A word
like stream_accepted or program_id is still released, colored or not.
The new split-chunk test fails on the previous PR head (AKIA... runs on the
wire) and passes here; it passes on main too (main held every substring).
The holdback, long-holdback and redaction files pass (52), as does
test_messaging_exactly_once.py (61).
The streamed-redaction settled boundary held any trailing token that contained a secret-prefix
literal anywhere, so "am_" (AgentMail) inside "stream_accepted" or "program_id" kept the reply's
last word off screen until the provider stream ended. The prefix rules in agent.redact only match
a literal that does not follow a letter or digit, so such a word can never become a key. The
prefix literals are now matched with that same left boundary; the JWT, base64-PEM, age and
Discord mfa literals, whose rules match glued to a word, stay unanchored.
Real-world effect: a Telegram streamed reply whose last word contains such a fragment sat
incomplete until the stream closed; a gateway crash in that window lost the visible answer and the
restart sent a second, labelled copy (e2e test_crash_between_completion_and_send
[stream_accepted_unpersisted-fk_tg], 0.23.2 release blocker).
First bad commit: efcf4e1bee (#154211).
416dc3ecde (#153436) sends already-streamed interim text to on_commentary()
whenever the stream consumer takes no deltas, so Telegram with streaming off
still gets the commentary. A local (Desktop/TUI) route's consumer never takes
deltas either: its viewer already got them as message.delta frames. So the
answer streamed beside a housekeeping tool (todo_list, memory) was recorded as
a sent commentary. The final that repeats it was then deduplicated against that
commentary and went out as message.complete "", and the Desktop turn never
settled: the Stop button stayed and the reply was never sealed.
On a local route, already-streamed commentary is a segment break again.
Messaging routes keep #153436's behaviour.
Red before / green after: e2e/core/reply-painted-once.spec.ts:227 and
reply-settle-paths.spec.ts:207 (Desktop core E2E).
* fix(gateway): an adopted Desktop row with bare custom resumes on the profile route
Desktop builds before the session authority (v2026.8.x) persisted the
composer pick's resolved provider in model_config. For a bare
`model.provider: custom` profile whose custom provider entry lists no
models, `canonical_custom_identity` had nothing to heal it to, so the row
stored `{'model': ..., 'provider': 'custom'}` with no endpoint. The old
resume dropped that bare provider and ran the profile's route.
Adoption instead froze `provider: custom` as the session's route. With no
saved URL `same_route` reports a different route, so the profile's
endpoint and credential fields were stripped (53fe9f623f), and every
turn of the old chat failed with "provider 'custom' resolved without
credentials". The 0.23.2 install/update E2E from v2026.8.13 hits this on
every Desktop leg.
`legacy_launch_params` now treats bare `custom` with no endpoint as the
billing class it is, not a route: the provider (and its api_mode stamp)
is dropped, so adoption heals it to the entry serving the model, else the
profile's own route, as the pre-authority resume did.
Test: tests/gateway/test_legacy_bare_custom_desktop_row.py (real
resolve_local_target adoption + the turn's runtime resolver), red on
main, green with the fix; 18 adoption/migration test files pass.
* test(gateway): pin the profile api_mode the adopted bare-custom row must run
Greptile on #156545: the with-api-mode case never checked api_mode, so it
still passed with the pop removed. The profile now pins codex_responses and
the test asserts the turn runtime uses it, not the row's chat_completions.
* chore: retrigger CI (zero-job dispatch failure, auto-heal)
* test(gateway): pin a mode plain custom honors (anthropic_messages)
The previous commit pinned codex_responses, which the plain-custom resolver
deliberately ignores for a non-OpenAI endpoint (_resolve_plain_custom_api_mode),
so CI failed all 4 cases. anthropic_messages is honored. Verified from a
checkout outside ~/.hermes: 4 pass; with the api_mode pop removed, exactly the
2 with-api-mode cases fail.
tools/ holds model tools. These three files register none: they send a
message to a platform for `hermes send` and for cron delivery, through
gateway adapters and gateway config. They move to the gateway package:
tools/send_message_tool.py -> gateway/outbound/send.py
tools/send_message_senders.py -> gateway/outbound/senders.py
tools/send_message_targets.py -> gateway/outbound/targets.py
Twelve test files move with them to tests/gateway/outbound/. Every importer
changes its import line in place. Nothing stays at the old paths: none of
the three names is on the plugin API list, the shipped-release list or the
old-updater list.
Behaviour is unchanged. The logger name stays tools.send_message_tool in
the three files and in the QQ Bot sender that shares it, so the lines stay
under `hermes logs --component tools`. The boundary-lint baseline changes
12 keys and no count, because its keys carry the module path of the
underscore names five bundled plugins import.
The import and docs rewrites were made by scripts/move/rewrite_imports.py
and rewrite_docs.py.
Removed. A search for callers by name, attribute and string (Python, TypeScript,
docs, the plugin API list and the frozen old-updater list) finds no supported
path that reaches any of them:
- tools/send_message_tool.py: _handle_list, _handle_react and the action
dispatch in send_message_tool (every caller, including the external
hermes-snooze plugin, passes action="send")
- tools/bot_failure_reasons.py: is_auto_retryable
- tools/clarify_gateway.py: _notify_cbs, _coerce_text_response,
attempt_text_response_for_session, resolve_text_response_for_session
- tools/cronjob_tools.py: the unused task_id parameter of cronjob()
- tools/interrupt.py: is_thread_yield_requested
- toolsets.py: create_custom_toolset
- tools/tool_backend_helpers.py: prefers_gateway, REMOVED_BACKENDS,
removed_backend_note, normalize_modal_mode (callers use coerce_modal_mode)
- hermes_cli/config_value_checks.py: _validate_web_backends (only read the
always-empty REMOVED_BACKENDS map)
Tests that existed only for these symbols are deleted; tests that also
cover live behaviour now call the canonical live names
(attempt_text_response, _coerce_text_response_detailed, consume_yield).
The shared-bot route-gate tests that reached the gate through the deleted
react action now call _shared_bot_target_allowed directly, so the origin
rules (guild-only, thread-under-channel and user_id routes, Telegram topics,
the turn's sender in a shared channel) keep their coverage. The two error
hints and one comment that named send_message(action='list') now name
`hermes send --list`; the stale send_message row in the zh-Hans tools
reference goes.
Also:
- test_messaging_slash_command_fifo spies on clarify_gateway.attempt_text_response,
the name gateway/run_inbound.py calls, so its [clarify] case can fail again
- send_message_tool: an action other than 'send' returns an error that names
`hermes send --list` for listing targets
- multi-profile-gateways.md no longer says send_message sends reactions; the zh-Hans
simplex.md and tools-reference.md match the English pages
Six private readers repeated the body of utils.read_json_or_empty
line for line: read utf-8-sig, return {} on OSError or ValueError,
return {} for a JSON value that is not an object.
rich_sent_store._load and stuck_loop_counts._read_counts only took a
path, so they are deleted and their callers call read_json_or_empty.
prune_advisor._read_estimate, webapp_access._registration,
left_core_migration._auth_store and local_runtime.recovery.read_state
compute their path, so they keep their names and read through the
shared helper. utils is imported inside the function where the module
already imports utils lazily, so module import cost is unchanged.
boot_bootstrap.read_last_known stays: it is boot code that imports no
utils, and it is a public name other modules import.
environments/base._load_json_store stays: modal.py and
vercel_sandbox.py import it.
- Every clock storage read (restore, prompt_cache_generation) is best-effort:
sqlite3.Error/OSError/WorkerPersistenceError log at DEBUG and the window
reports unknown (storage_unavailable); a successful reply is never lost.
- RuntimeSessionStore.prompt_cache_generation reads the owner's durable count
(session.cache_generation receipt op), so a managed worker's fresh write is
not reported compacted.
- The agentless /context read compares the saved clock with the row's
persisted model + model_config provider/base_url, and the breakdown cache
key includes them: a session.mutate model switch reports unknown.
The clock modelled every route as "expires = last touch + tier", which is wrong for OpenAI
GPT-5.6+: a read refreshes coverage to at least 30 minutes after it and never restarts a
12h write. It also treated documented minimums as expiries and lost or revived saved state.
- Coverage deadlines per tier with per-route refresh rules: Anthropic family restarts the tier
on read; OpenAI keeps max(existing, read + 30m) and a 12h deadline stays at write + 12h.
- Windows carry guaranteed_until (earliest deadline, so mixed tiers in one response are only as
warm as the shorter) and estimated_until (OpenAI: last touch + 24h retention ceiling; pre-5.6
in_memory 1h). cache_certainly_warm / cache_certainly_cold are the two consumer helpers.
/context: warm until / may still be warm until / expired / unknown.
- Events bind to the session's durable context generation (rows a compaction or prune archived,
SessionDB.prompt_cache_generation), kept as saved on restore; a resumed agent restores and
validates the saved event before folding its first response.
- Route identity is provider + normalize_route_base_url (scheme, host, port, path) + model.
- Agentless session.context_breakdown reads the saved clock (stored_cache_window).
- Codex app-server activity is recorded as an explicit unknown (it sets its own cache options).
- MoA records the resolved aggregator route and the payload the MoA client sent.
- effective_cache_ttl applies the route ceiling on the measured-provider path too.
The redactor's control-split pass now joins 1//0<head>\n<tail> because its
body class gained '/', but the stream holdback's twin _CONTROL_SPLIT_RUN_RE
did not, so the held run started after '1//', nothing masked and the
head + tail settled raw on draft transports. Give the twin the same '/'.
Refs #39654
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
Co-authored-by: teknium1 <127238744+teknium1@users.noreply.github.com>
Adding 1//0 to the prefix list made the stream holdback treat any trailing
digit as a possible secret start, so a reset mid-stream sealed 'x = 1' as
'x = '. The refresh-token mask keeps '1//0gL' visible, so showing the
digits first leaks nothing; the token itself is still held until masked.
Refs #39654
Turning on ruff preview (needed for PLW1514, unspecified-encoding) also
widens some stable rules. Clearing what it reports first lets the config
change that enables it land with no ignore list:
- evals workers: 20 text-mode open() calls get encoding="utf-8".
- a2a and weixin adapters: legacy "# type:" comments become annotations.
- agent/lsp/client.py, gateway/run_turn.py: two prose comments started a
line with "type:", which type checkers read as a type comment.
- sorted(x)[0] becomes min(x) (plugins_session_env, one test).
- test_plugin_session_fork: the attempts default is built per call
instead of a shared list inside a tuple.
The pinned ruff 0.15.22 passes with today's config and with preview on.
A reconnect during a long turn replaces the registry adapter. The final text
already moves to the replacement through send_final_ledgered, but
_deliver_attachments still uploaded on the retired adapter, whose client is
gone: Discord answered the image batch with "Not connected", nothing was
logged, and the user got the text without its images.
Attachments now resolve the same current transport as the final text, and a
refused image batch is logged with its error instead of being recorded silently.
Squashed onto main (#151819). The session.usage conflict with #141859 keeps the
branch side: _usage_nous_fields already reads the Nous fields inside the
session profile scope.
main's #141859 test now stubs both Portal reads: a session off a Nous route reads
with the stored token only (stored_token_account_info).
agent.account_usage keeps the names that moved to agent.account_usage_nous (and
BP_FULL): plugin_api.json publishes the whole module, and catalog plugins import
build_credits_view and build_nous_credits_snapshot from it.
The gateway took the primary's failure in _resolve_session_agent_runtime and then still applied a channel_overrides provider and the session's /model layering before returning, so the turn runner's snapshot already included them and a channel on another provider kept the primary's sign-in lead. The snapshot is now taken where the failure is popped and the failure is stashed only if those layers left the route unchanged; the runner's own comparison still covers the API and one-turn routes. The policy path returns before any override, so it needs no check.
Reported-by: BearHuddleston
The failure kept only while the turn runs the route resolution fell back to. That was decided after the agent was built, by rebuilding the agent's URL and query and comparing it with a recorded backup URL; every derivation AIAgent applies to its route (query moved to default_query, escaping, normalization) was one more way for the comparison to be wrong, and the account (api_key) was never compared at all.
Both places that apply overrides before building the agent (the gateway turn's API and one-turn routes, the API server's model_routes and request provider) now snapshot provider, base_url and api_key as resolved and drop the failure when any differs afterwards: plain equality on the turn's own values, before any agent exists. The URL comparison, its helpers and the recorded backup URL are removed; the key guard from the previous commit is widened to the whole route.
Reported-by: greptile-apps[bot]
Reported-by: kvnloo
Explicit API/model routes may replace the backup API key while retaining its provider and endpoint. Do not attribute a refusal from that different account to the original primary login. Cover the gateway turn handoff and displayed failed-turn copy with one regression.
Carrier: NousResearch/hermes-agent#155246 (yoniebans)
Original reporters: Apfelkringel and aantix
(cherry picked from commit d6903e1a1202f83bc50800baa89c4f86d4a270a4)
lead_failed_turn_with_primary_auth wrote both _primary_auth_led and the primary_auth_failure descriptor in the same step; the descriptor now serves as the marker. A comment in gateway/run.py ran on past its line into the import's trailing comment.
Reported-by: kshitijk4poor
The failure found while resolving a turn's route was stashed on the shared runner, so another chat resolving on another thread could clear or replace it before the turn read it, and the sign-in hint went missing or named another session's provider. It now travels in a context variable, which each gateway turn's executor copy keeps to itself.
The failure also survived later steps that move the turn onto another provider (`/model --once`, an API caller's provider, a channel override), so a failure of that route told the user to sign in to the primary. attach_primary_auth_failure now drops it unless the agent runs the backup it names.
Reported-by: greptile-apps[bot]
When the primary's login failed at route time and the fallback then failed the turn too, the card described only the fallback, so its Sign in again button signed in to the fallback. The result's primary_auth_failure now reaches message.complete, and the card names the primary as an OAuth sign-in, which reuses the existing button for the provider that needs it.
Darling, "you're out of credits" is not the whole story when the real
problem is that your Claude login expired an hour ago. Resolution-time
fallback quietly swapped the dead Anthropic login for the backup and then
let the backup's billing error do all the talking.
- resolve_runtime_with_fallback stamps a PrimaryAuthFailure (provider,
error, exact re-login command) on the fallback runtime when the primary's
AuthError is one a re-login fixes (not quota/entitlement/retryable).
- The gateway (messaging + launch-policy routes), API server and oneshot
carry it onto the agent; the gateway clears it per turn so a cached
agent never keeps a login failure that has since resolved.
- run_conversation leads any failed turn on the backup with "<primary>
needs you to sign in again: run `hermes auth add anthropic`" and still
names the backup's problem ("the backup is out of credits"), with the
backup's own copy underneath.
Fixes#147212
A standalone gateway runs _handle_message inside _standalone_launch_scope
(the launch profile's .env over the env frozen at activation) once
multi-profile hosting is active, but sender_may_see_activity read ambient
os.environ. When those disagree an admitted sender lost typing and the
processing reactions. Evaluate the probe under the same scope.
Refs #149024
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
The turn's cleanup called _stop_typing_refresh three times even when the
typing loop never started, so Signal (sendTyping stop=True), BlueBubbles,
Matrix, Photon and Weixin still sent a platform stop to a dropped sender.
Pass the event and skip only the platform stop on the same activity
verdict; local cleanup (task cancel, pause flags) is unchanged.
Refs #149024
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
The lifecycle hooks (on_processing_start/complete) run in the same
pre-admission window as the typing refresh, so Telegram, Discord,
Feishu, Matrix, Photon and the relay adapter still sent a 👀/✅
reaction to a sender the handler then refused (Signal and Slack have
their own partial guards). _run_processing_hook now asks the same
runner verdict as the typing gate, sender_may_see_activity, which
caches it on the event so start and complete hooks agree and the
runner is asked once per turn.
Fixes#149024
The typing refresh starts in `_process_message_background` before `_handle_message`
runs, and the runner authorizes inside that handler. On a platform where strangers can
reach the bot — Signal linked as a secondary device on the owner's own number — the
contact therefore received `sendTyping` as the owner, and only then was the message
dropped, so the leak looked like the owner typing to every contact who messaged them.
`_start_typing_refresh` now asks `helper.typing_refresh_wanted`, which resolves the
runner (the adapter's `gateway_runner`, else the owner of its message handler) and reads
the same verdict the handler will: unauthorized senders get no indicator, while internal
events (admitted without an allowlist), a missing runner and a raising verdict all keep
the previous behaviour. The indicator can no longer disagree with admission.
Tests: tests/gateway/test_typing_indicator_authorization.py drives the real turn path
with a stubbed refresh loop; the unauthorized case fails on the base commit with
`assert 1 == 0` (the loop ran for a sender the handler dropped).
Closes#149024
Follow-up to the salvaged read-deny: google_client_secret.json is the
skill's other declared required_credential_file and was still readable,
and none of the three Google Workspace root stores were write-denied, so a
write could plant a refresh token the next skill run loads. One shared
GOOGLE_WORKSPACE_CREDENTIAL_FILES tuple feeds both guards (active profile,
siblings, root); the gateway media and dashboard file denylists mirror the
client secret. Both declared files stay mountable into the skill sandbox.
Fixes#149056
The 84-character legacy mfa. token is not recognized by the
stream consumer's generic continuation probe until the end of the
body, allowing the first 83 characters to reach preview frames.
Hold the mfa. prefix as soon as it begins and prove the partial
stream never releases it, without changing full-text redaction.
Follow-up to c2h5oh's PR NousResearch/hermes-agent#155422 and
reported regression NousResearch/hermes-agent#117848.
(cherry picked from commit c2ff11bf595dd0ea60a4c245e2382dc545b4c369)
The wrapper eater after the MEDIA path ran after both boundary branches; after an
escaped \n/\r/\t run it sat on the first character of the following text and
stripped its opening */_/quote (bullets, bold). Apply it on the plain branch only.
Refs #128628
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
An escaped \n/\r/\t that ends a MEDIA: path (before a boundary) was only
asserted by the lookahead, so the literal escape stayed in the caption
(MEDIA:C:\out\a.png\nMEDIA:C:\out\b.png left "\n"). Consume the run
outside the path group; api_server's .sub drops it after the data URL too.
Refs #128628
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
terminal.home_mode: profile keeps tool logins (.ssh, gh, cloud CLIs) under
{HERMES_HOME}/home and profiles/*/home while the gateway runs on the account
HOME, so those homes need the same credential subpaths denied. Derived from
_credential_home_roots() so profiles created after startup count.
A ~<NUL> path is no longer expanduser'd (it raised before _add could mark it),
so its tag now leaves the caption like every other NUL path.
Refs #128628
Offsets the media-hardening growth in the over-cap base.py facade instead
of waiving FILE_LINES. Pure move; _HERMES_ROOT is read through the facade
so existing test seams keep working.
Refs #128628
Squashed salvage of #125264 onto current main (its merge commits do not
cherry-pick cleanly); the FILE_LINES waiver on the base.py facade is
dropped, growth is offset in the follow-up commit.
- denylist home subpaths cover expanduser("~"), $HOME and get_real_home()
- an escaped \n/\r/\t before a boundary ends a MEDIA: path in cleanup
- NUL-bearing candidates are dropped but their tag still leaves the caption
Fixes#128628
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-detection scan budget refused ordinary scripts of a few hundred lines
(`\"` inside `$(...)` never closes once escapes are stripped) at the hardline
floor in every mode, and the recovery hint then had the model run the saved
payload with `bash <file>`, which no gate reads: an 800-line script ending in
`rm -rf build/` ran without the prompt main gives.
- detect_hardline_command no longer refuses on a budget trip. It returns
(False, None) and records the unfinished scan. Size, segment and real
`$(` nesting limits still refuse. Nesting is now also measured on the
text with backslash-newline continuations joined; bash joins them only
outside single quotes and quoted heredoc bodies, so this over-counts
there (a benign false refusal, never a missed one). A hardline rule the
scan reached before the trip refuses; one it did not reach is the next
commit's job.
- detect_dangerous_command reports the trip as "command too complex to scan
fully; review before running", so callers without a prompt (gateway
session shell, TUI shell.exec) refuse it, and the approval gates add it to
the findings of any command the hardline scan could not finish, so an
earlier grant for its first match does not cover the unread rest.
- That finding is approved one run at a time: no session/always scope is
offered or persisted on any surface; approvals suggest never mines it;
the trailing-& conversion compares the scan outcome too.
- The parser-limit recovery hint no longer offers `bash <saved file>`.
Refs #7485
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
`clarify.respond` documents an empty answer as a skip, and Ink and Desktop
send `answer: ""` for one. The authority handed that empty string to the
waiting clarify entry, and the wait reads an empty response as "no reply":
the batch stopped at the skipped question and the stored tool result said
`outcome: timed_out` with "[user did not respond within Nm]", seconds after
the user pressed skip.
`PendingControls.respond` now resolves a blank answer with the clarify
SKIPPED sentinel, which the turn runner already maps to a skipped
response before asking the next question. The managed-worker path
already read a blank answer as a skip.
The worker sent its activity frame every 30 s regardless of agent.gateway_timeout,
so with a 10 s timeout a live quiet tool still read as wedged between frames.
The owner now sends the interval (a quarter of its own timeout, capped at 30 s)
in the hydrated request it already passes, and the worker uses it. The test drives
the production interval for a 1 s timeout instead of a hand-picked 0.2 s.
On POSIX the watcher waits with no deadline for the old gateway to exit, checking only that its
PID exists, so a PID reused between polls held it on an unrelated process forever. The parent now
records the old process's start time when it arms the watcher, and the watcher stops waiting once
the PID is gone or belongs to a different process. The watcher source moves to its own module to
keep gateway.py under its size cap.
The owner judged a managed turn wedged by frame silence alone, but a long quiet tool sends no
frame while its agent keeps heartbeating inside the worker. The worker now forwards its agent's
own activity clock as an internal frame the owner consumes before the turn loop; an older owner
never asks for it.