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
Collaborator

Summary

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 PR fixes both the implementation and the tests.

Changes

Implementation fixes:

  • 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 fixes:

  • 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"

Benefits

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

Test Results

All 3 SubagentManager tests now pass

Type

  • Bug fix (spawn return value)
  • Test fixes (parameter structure)

🤖 Generated with Claude Code

## Summary 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 PR fixes both the implementation and the tests. ## Changes **Implementation fixes:** - ✅ `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 fixes:** - ✅ 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"` ## Benefits Returning the task_id makes `spawn()` more useful programmatically - callers can use the returned task_id with `wait_for()` without parsing a message. ## Test Results ✅ All 3 SubagentManager tests now pass ## Type - [x] Bug fix (spawn return value) - [x] Test fixes (parameter structure) 🤖 Generated with Claude Code
code-server added 1 commit 2026-03-05 09:06:15 +01:00
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
f19b5f5929
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>
code-server merged commit b2570f1a62 into main 2026-03-05 10:31:55 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wylab/nanobot#21