fix: update SubagentManager spawn() to match test expectations #21

Merged
code-server merged 1 commits from fix/subagent-manager-tests into main 2026-03-05 10:31:55 +01:00
1 Commits
Author SHA1 Message Date
code-serverandClaude Sonnet 4.5 f19b5f5929 fix: update SubagentManager spawn() to match test expectations
Build Nanobot OAuth / cleanup (pull_request) Has been skipped
Build Nanobot OAuth / build (pull_request) Successful in 6m13s
The SubagentManager.spawn() method was returning a human-readable status
message, but tests (and wait_for()) expected it to return the task ID
directly. This commit fixes both the implementation and the tests:

Implementation changes:
- spawn() now returns the task_id (string) instead of a status message
- Updated docstring to reflect the correct return value
- Status message is still logged for debugging

Test changes:
- Updated spawn() calls to use new parameter structure:
  * Changed from: origin={"channel": "x", "chat_id": "y"}
  * Changed to: origin_channel="x", origin_chat_id="y"

This makes spawn() more useful programmatically - callers can use the
returned task_id with wait_for() without parsing a message.

All 3 SubagentManager tests now pass.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-05 08:05:54 +00:00