fix(agent): gate the kanban worker protocol on dispatch context, not tool presence - #68608
fix(agent): gate the kanban worker protocol on dispatch context, not tool presence#68608Sora-bluesky wants to merge 2 commits into
Conversation
16dc55e to
2aa033b
Compare
2aa033b to
b303693
Compare
|
Thanks for carrying the full worker/orchestrator split. Current The PR also covers the separate bypass-init injection at Automated hermes-sweeper review. |
|
Thanks for tracing both injection sites. The bypass-init one at |
|
Independently verified against current main: the reported failure is reproducible in an interactive Desktop/orchestrator session when the profile has the kanban toolset but no HERMES_KANBAN_TASK. The current code injects the worker protocol, which prompts an unscoped kanban_show() call and produces task_id is required. PR #68608 fixes that failure through the three-way worker/orchestrator/no-Kanban split while preserving board-routing guidance. It merges cleanly with current main, and the relevant suites pass after the merge (66 passed). I found no blocking issues. |
b303693 to
88a6a1f
Compare
… presence Orchestrator profiles (kanban in the toolsets config) carry kanban_show without HERMES_KANBAN_TASK, but the worker task-execution protocol was injected on mere tool presence — so every cron run on such a profile was told to call kanban_show() first and recorded a 'task_id is required' error (issue NousResearch#68592). Gate both injection sites (the session-static resolution in agent_init and the bypass fallback in system_prompt) on HERMES_KANBAN_TASK being set, and fix the stale 'present iff HERMES_KANBAN_TASK' comment that hid the gap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
88a6a1f to
97c7383
Compare
…task Addresses review: removing KANBAN_GUIDANCE entirely from orchestrator profiles (kanban toolset, no HERMES_KANBAN_TASK) would also drop the routing rules that were folded into the always-injected guidance when the standalone kanban-orchestrator skill was removed — profile discovery before assigning (unknown assignees are silently dropped), parents=[...] dependencies, no phantom created-card ids, attachments, and the no-shell-out rule. Split the guidance: dispatcher-spawned workers keep the full task-execution protocol, tool-only profiles get a lean board-routing block with no mandatory kanban_show() first step. The system_prompt fallback mirrors the same three-way split and is now covered directly by a bypass-agent_init test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
97c7383 to
ad73f70
Compare
Fixes #68592.
Problem
The kanban worker task-execution protocol (
KANBAN_GUIDANCE— "You have been assigned ONE task… Callkanban_show()first") was injected into the system prompt on merekanban_showtool presence. But_check_kanban_mode(tools/kanban_tools.py) exposes the kanban tool surface in two situations: dispatcher-spawned workers (HERMES_KANBAN_TASKset) and profiles withkanbanin their toolsets config (orchestrator mode, no task id). On an orchestrator profile, every agent run — notably every cron run — was instructed to callkanban_show()first, which fails withtask_id is requiredand logs a warning per run. The gating comment inagent_init.py("kanban_show tool is present iff HERMES_KANBAN_TASK is set") described a constraint that no longer held.Fix
Three-way split at both injection sites (the session-static resolution in
agent_init.pyand the bypass-agent_initfallback inagent/system_prompt.py):HERMES_KANBAN_TASKset + tool present → full worker protocol, unchanged.KANBAN_ORCHESTRATOR_GUIDANCE: board-routing rules only, explicitly stating there is no assigned task andkanban_show()needs an explicittask_id.The orchestrator block deliberately preserves the routing rules that were folded into the always-injected guidance when the standalone kanban-orchestrator skill was removed (#50473): discover profiles before assigning (the dispatcher silently drops cards with unknown assignees), express dependencies via
parents=[...], never invent created-card ids, attach artifacts instead of pasting links, and don't shell out tohermes kanban. Removing the guidance wholesale would have regressed those.The env-var gate matches how workers are actually spawned:
_default_spawnstarts the worker host-locally withHERMES_KANBAN_TASKinPopen(env=...); Docker/SSH/Modal are terminal backends inside that process, not separate spawn paths. (Custom pluginspawn_fnimplementations own their environment contract.)Operational note
Durable sessions restore their persisted system prompt verbatim, so an interactive orchestrator session resumed from before this fix keeps the old mandatory-
kanban_show()text until its prompt is rebuilt. Cron runs are unaffected (each run gets a fresh session). No cache invalidation is attempted here — that's a separate design decision; #68598 (input-fingerprint restore gating) provides the general mechanism.Tests
test_kanban_guidance_not_in_orchestrator_profile_prompt(kanban toolset via config.yaml, no env var → tool surface present, worker protocol absent, board guidance present) failed before the fix.test_kanban_guidance_fallback_three_way_splitcovers thesystem_prompt.pyfallback directly (deletes_kanban_worker_guidanceto simulate bypassingagent_init).tests/tools/test_kanban_tools.py: 116 passed.tests/agent/test_system_prompt.py+tests/agent/test_platform_hint_desktop.py: 32 passed. The 8 failures intests/hermes_cli/test_kanban_core_functionality.pyon this Windows machine reproduce identically on cleanupstream/main(pre-existing, unrelated).🤖 Generated with Claude Code