fix(kanban): kanban_create inherits the spawning worker's task workspace#37182
Merged
Conversation
When a dispatcher-spawned worker (HERMES_KANBAN_TASK set) calls kanban_create without an explicit workspace, the new child now inherits the worker's own running-task workspace_kind/workspace_path instead of defaulting to scratch. A worker editing a dir:/worktree project that spawns a follow-up child keeps it in that project. Orchestrators (kanban toolset, no HERMES_KANBAN_TASK) and CLI/dashboard callers still default to scratch. An explicit workspace arg always wins.
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
tests/tools/test_kanban_tools.py:843: [unresolved-attribute] unresolved-attribute: Attribute `workspace_path` is not defined on `None` in union `Task | None`
tests/tools/test_kanban_tools.py:842: [unresolved-attribute] unresolved-attribute: Attribute `workspace_kind` is not defined on `None` in union `Task | None`
✅ Fixed issues: none
Unchanged: 4988 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
WenhuaXia
added a commit
to WenhuaXia/hermes-agent
that referenced
this pull request
Jun 6, 2026
辅助任务现在可以正确解析命名自定义 provider(custom:name)。 Before this fix, _normalize_aux_provider() would strip the "custom:" prefix and return bare "custom", which routes through the anonymous-custom path (reading model.base_url + OPENAI_API_KEY from config/env). Users with named custom_providers (e.g. custom:qwen) but no OPENAI_API_KEY set would silently get "Goal judge is not configured" or broken vision tasks. Two changes: 1. Remove the early return in _normalize_aux_provider() that stripped custom:xxx → custom. Named custom providers are now preserved intact so resolve_provider_client can route them through the named-custom-provider branch which reads custom_providers from config.yaml. 2. Add a fallback in _resolve_custom_runtime(): when requested="custom" falls back to OpenRouter (because no bare "custom" entry exists), try resolve_runtime_provider(requested=None) to pick up the user's actual main provider. This is a safety net for code paths that still call with bare "custom". Affected tasks: vision, goal_judge, compression, web_extract, etc. Any auxiliary task that uses "custom:name" as provider now works. 修复前:_normalize_aux_provider() 会把 custom:qwen 强制 strip 成 "custom", 导致所有带命名自定义 provider 的辅助任务(vision、goal_judge 等)都走匿名 custom 路径(读环境变量 OPENAI_BASE_URL/API_KEY)。用户如果没有设置这些 环境变量,辅助任务就静默失败。 修复后: 1. 移除 strip 逻辑,保留 custom:name 完整字符串,让 resolve_provider_client 走 named custom provider 分支,从 custom_providers 读取 base_url + api_key。 2. 在 _resolve_custom_runtime() 增加 fallback:当 "custom" 回退到 OpenRouter 时,尝试用 requested=None 重新解析用户实际的主 provider 作为兜底。 影响范围:vision(图像识别)、goal_judge、compression、web_extract 等 所有使用 custom:name 作为 provider 的辅助任务现在都正常工作。 Fixes: custom provider vision tasks broken, goal judge unavailable Related: NousResearch#37182
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ace (NousResearch#37182) When a dispatcher-spawned worker (HERMES_KANBAN_TASK set) calls kanban_create without an explicit workspace, the new child now inherits the worker's own running-task workspace_kind/workspace_path instead of defaulting to scratch. A worker editing a dir:/worktree project that spawns a follow-up child keeps it in that project. Orchestrators (kanban toolset, no HERMES_KANBAN_TASK) and CLI/dashboard callers still default to scratch. An explicit workspace arg always wins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A kanban worker that spawns a follow-up task now keeps it in the worker's own project workspace instead of a throwaway scratch dir.
When a dispatcher-spawned worker (
HERMES_KANBAN_TASKset) callskanban_createwithout an explicit workspace, the new child inheritedscratch— so a worker editing adir:/worktree:project that spawned a follow-up child sent that child's code to a tmp dir GC'd on archive. This is thekanban_createsibling of the decompose-inheritance fix in #37172.Changes
tools/kanban_tools.py(_handle_create): when neitherworkspace_kindnorworkspace_pathis passed ANDHERMES_KANBAN_TASKis set, the child inherits the worker's running-taskworkspace_kind/workspace_path. Orchestrators (kanban toolset, noHERMES_KANBAN_TASK) and CLI/dashboard callers still default to scratch. An explicit workspace arg always wins.tests/tools/test_kanban_tools.py: +3 regression tests (worker-inherits-dir, explicit-arg-overrides, no-worker-task-stays-scratch).Validation
dir:/projtaskdir:/projdir:taskscratchHERMES_KANBAN_TASK)tests/tools/test_kanban_tools.py: 84/84 pass. E2E verified through_handle_createwith real env + DB I/O.Infographic