Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hermes_cli/kanban_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -7793,6 +7793,21 @@ def _default_spawn(
# highest-precedence interface override; dropping the env var covers
# older hermes builds on PATH that predate the flag's precedence.
env.pop("HERMES_TUI", None)
# A worker must NOT inherit gateway/cron approval context: the dispatcher
# copies the parent's full environment (including HERMES_EXEC_ASK,
# HERMES_CRON_SESSION, HERMES_SESSION_*, HERMES_INTERACTIVE, HERMES_YOLO_MODE),
# but approval callbacks are process-local Python dictionaries that cannot be
# inherited. Without dropping these, workers identify themselves as
# approval-capable and attempt to send approval requests that cannot be
# delivered, causing silent failures or misrouted notifications.
# See issue #63183.
env.pop("HERMES_EXEC_ASK", None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the ask marker together with the remaining context markers sends non-hardline worker actions through the documented headless auto-approve path: check_all_command_guards() returns approved before normal dangerous-command/Tirith handling (tools/approval.py:2696-2762), and check_execute_code_guard() returns approved without gateway/ask context (:3140-3146). This needs an explicit Kanban fail-closed policy or durable approval route, not scrub-only behavior.

env.pop("HERMES_CRON_SESSION", None)
env.pop("HERMES_INTERACTIVE", None)
env.pop("HERMES_YOLO_MODE", None)
for key in list(env.keys()):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prefix cleanup does not cover HERMES_GATEWAY_SESSION, which _is_gateway_approval_context() reads directly (tools/approval.py:241-245). A worker inheriting that legacy marker remains in gateway approval context and can still produce child-local pending approval.

if key.startswith("HERMES_SESSION_"):
env.pop(key)

cmd = [
*_resolve_hermes_argv(),
Expand Down
Loading