Skip to content

fix(kanban): kanban_create inherits the spawning worker's task workspace#37182

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-f787aa79
Jun 2, 2026
Merged

fix(kanban): kanban_create inherits the spawning worker's task workspace#37182
teknium1 merged 1 commit into
mainfrom
hermes/hermes-f787aa79

Conversation

@teknium1

@teknium1 teknium1 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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_TASK set) calls kanban_create without an explicit workspace, the new child inherited scratch — so a worker editing a dir:/worktree: project that spawned a follow-up child sent that child's code to a tmp dir GC'd on archive. This is the kanban_create sibling of the decompose-inheritance fix in #37172.

Changes

  • tools/kanban_tools.py (_handle_create): when neither workspace_kind nor workspace_path is passed AND HERMES_KANBAN_TASK is set, the child inherits the worker's running-task workspace_kind/workspace_path. Orchestrators (kanban toolset, no HERMES_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

caller workspace arg result
worker on dir:/proj task none inherit dir:/proj
worker on dir: task explicit scratch scratch (arg wins)
orchestrator / CLI (no HERMES_KANBAN_TASK) none scratch (unchanged)

tests/tools/test_kanban_tools.py: 84/84 pass. E2E verified through _handle_create with real env + DB I/O.

Infographic

kanban-create-workspace-inheritance

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.
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-f787aa79 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9635 on HEAD, 9630 on base (🆕 +5)

🆕 New issues (2):

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.

@teknium1 teknium1 merged commit 272c2f3 into main Jun 2, 2026
23 checks passed
@teknium1 teknium1 deleted the hermes/hermes-f787aa79 branch June 2, 2026 04:26
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant