Removed:
- tools/async_delegation.py::mark_completion_delivered (no production caller; delivery acks go through claim/complete_completion_delivery)
- tools/async_delegation.py: 'finalizing' in seven state SQL filters (the ledger state column is only ever written 'running' or a terminal status; 'finalizing' is in-memory record status only, in every commit)
- tools/delegate_tool_child_run.py::_ChildRun.wait_liveness_aware child_future parameter (unread in the body)
- tools/delegate_tool_child_run.py::_start_heartbeat (a constructor alias; delegate_tool builds _Heartbeat directly)
- tools/delegate_tool.py: facade imports DelegateEvent and _batch_prefix (unused in the body, reached by nobody through the facade)
- tools/delegate_tool_progress.py::DelegateEvent.TASK_SPAWNED / TASK_COMPLETED / TASK_FAILED (reserved, never emitted)
- tools/delegate_tool_auto_resume.py: _lineage's lineage-id set and superseded_reason's unused record argument
Tests: the completion-wait helper in test_delegate_auto_resume.py filters
state != "running", matching the production SQL.
Review findings from unsupportedpastels and kshitijk4poor:
- A steered child lost its brief at its second compaction. The compactor stops
protecting early turns after the first pass and restates the newest real user
turn, which after a steer is the steer. A delegated child's first user turn
is its whole brief (goal, context, output contract), so it is now always
protected (ContextCompressor.pin_task_turn, set on every child). The head
window methods move to context_compressor_window.py with it.
- Siblings given one context stopped reading it from cache: the goal came
first, so the shared bytes started after the first difference. The first user
turn is now "CONTEXT: ... TASK: <goal>", and the context is registered as the
message's stable prefix, which gives it its own cache breakpoint on marker
routes. Every brief is registered: a parent often sends one brief in separate
calls, which a per-call "shared" test cannot see.
- Stale docs and comments that still placed the context in the system prompt.
Co-authored-by: unsupportedpastels <unsupportedpastels@users.noreply.github.com>
Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
Providers that cache automatically match only inside the scope the client
sends, and only up to the first byte that differs. A child's task context sat
in its system prompt, which OpenAI-family models render ahead of the tools, and
on the Codex backend each child sent its own session_id header, the scope that
backend caches under. So every subagent paid full price for the prefix all of
one parent's children share.
- The goal and its context are the child's first user turn; the child system
prompt carries nothing per-task, so siblings send identical system prompts.
- One parent's children share a cache scope of their own (sub_<hash of the
parent's scope>), which keys prompt_cache_key and, on the Codex backend, the
session_id header. Skipped on slot-keyed routes (xAI), where two streams
under one key evict each other.
Claude children gain too: the cache breakpoint at the end of the system prompt
now covers bytes every sibling sends.
The subdirectory tracker resolves its working_dir on the machine running
Hermes (the host process cwd when unset), so on SSH a terminal.cwd of
project reached the workspace hint as <host cwd>/project: absolute, past
the relative-path guard, and hinted whenever that local directory existed.
On SSH read agent.session_cwd, the value the tracker was built from, and
let the same guards judge it. Compute the backend check once.
A terminal.cwd of ~/project or project can match a host directory under
Docker HOME. _resolve_workspace_hint used host expanduser/abspath and
injected that host path into the SSH child's WORKSPACE PATH even though
the remote terminal resolves it on the SSH target.
Skip non-absolute POSIX candidate paths for SSH before local expansion.
Add a parameterized regression for tilde and relative workspaces.
Follow-up to kshitijk4poor's #152470 and xxxigm's #143142.
Tests unrun; source-reviewed only.
The official image runs as hermes with HOME=/opt/data, so get_real_home()
equals the Hermes home and the real-home exemption kept /opt/data on the
SSH cwd: cd exited 126 on the target exactly as before. Key the rewrite on
running in a container instead (a host may share the layout over an NFS
home), and cover every directory Hermes starts in there: the Hermes home,
the root it belongs to (/opt/data under a named profile too), each one's
home/, and the install root. Matching is lexical, so a symlink on this
machine cannot redirect a remote path; the set is cached per home.
SSHEnvironment coerces its starting cwd, so environments built outside the
terminal tool (execute_code, image tools, the backend prompt probe, the
dashboard files pane) no longer start in a host directory. The files pane
dials after leaving the requested profile's scope, so it coerces the cwd
inside that scope. The subagent workspace hint skips a candidate the
rewrite changes, through the same function.
On SSH, TERMINAL_CWD=. resolves to the Docker data directory because that directory exists on the machine running Hermes. The child prompt then told the subagent to use it as its workdir.
JSON summaries: a text-level redaction pass over a structured (output_schema)
answer could eat JSON delimiters -- the ENV-assignment rule turns
{"env": "OPENAI_API_KEY=sk-proj-...", "n": 2} into
{"env": "OPENAI_API_KEY=*** "n": 2}, so a valid answer came back unparsable
with schema_valid flipped to False. When a summary is structured (schema set or
schema_valid present) and parses as JSON, redact the parsed values (with the
field name as context for credential-named keys) and re-serialize; text
redaction only for summaries that do not parse. Re-validation still runs when
redaction changed the summary.
Opt-out policy (maintainer ruling): forced redaction must not override
security.redact_secrets: false for the parent model's own copy. The entry the
parent reads (attach_worktree/emit_complete/_finalize_child_results), live
subagent.complete progress, the in-process completion queue and batch failure
notices now honour the setting (force=False). Everything that leaves the
process or persists stays forced: the spill file under cache/delegation,
async_delegations rows (_persist_completion, record_unit_child, recovery) and
their replay/reads, worker IPC, memory.on_delegation, and subagent_stop hooks.
Registered vault values are scrubbed in both modes.
Replaces the PR test that asserted forced redaction of the parent copy with
two invariants: structured summary stays valid JSON, and the opt-out keeps
the parent copy while spill/memory/hook/SQLite stay masked.
Squash of the 54 commits on victor-kyriazakos:feat/user-channel-warning-suppression
(PR #112302, head f45c640e55) so the contributor's authorship survives a rebase-merge;
the commits interleave with a cron delivery-ledger rework that the salvage removes in
follow-up commits, so per-commit cherry-picks were not practical.
Adds display.suppress_warning_notifications (global + per-platform, default false):
one resolver (gateway/warning_notifications.py), BasePlatformAdapter.emit_warning /
emit_media_warning / warning_text, a notification_category classification carried
through wakes, queues and persistence, and render/present boundaries for CLI/TUI.
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
Under gateway.multiplex_profiles a secondary profile's turn ran with the LAUNCH
profile's working directory, command allowlist, redact_secrets switch, credential
file mounts, browser engine/headed flags, LSP service, auxiliary-provider health
marks and MCP stderr log, and several TERMINAL_ENV consumers read the process env
instead of the routed profile's terminal scope. A standalone `hermes -p X gateway
run` never behaved that way.
- tools/terminal_scope.py: resolve the terminal.cwd placeholder inside the
profile scope with the same rule gateway/run.py applies at import (local ->
$HOME, sandbox default otherwise) so the system prompt, context files and the
terminal of a routed turn start where the profile's standalone gateway would.
- tools/image_source.py, credential_files.py, image_generation_tool.py,
skills_tool.py, delegate_tool_progress.py, agent/tool_executor.py: read
TERMINAL_ENV / TERMINAL_CWD through the terminal scope.
- tools/approval.py (+ approval_floors.py): one permanent allowlist per routed
profile home; the unscoped module set stays for single-profile processes.
- agent/redact.py: `_redact_enabled()` resolves security.redact_secrets for the
routed profile (scope .env, then config); launch snapshot kept when unscoped.
- tools/credential_files.py, agent/auxiliary_health.py, agent/lsp/__init__.py,
tools/browser_tool_cloud.py, tools/mcp_tool_config.py,
tools/tool_result_storage.py: key process caches by profile home (or bypass
the slot under an override).
Tests: tests/tools/test_multiplex_turn_parity.py (4, red on base).
Docs: multi-profile-gateways.md isolation table.
`format_batch_tag` handed out `set N` ordinals from one process-wide table,
so every conversation on a shared backend and every child's nested fan-out
advanced the same counter. A user's second wave of 15 lanes rendered as
`[set 20 · 13/15]`, which reads like 20 batches were spawned.
Scope the ordinal table by the parent conversation (`parent_agent.session_id`)
and thread the parent through the three render sites (batch header,
completion lines, child tree-line prefix via the shared session_ref). The
first fan-out in a conversation is `set 1`, the next `set 2`; sibling
conversations and nested child batches no longer inflate it.
Invariant test proven red on origin/main, green with the fix.
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.