Skip to content

feat: include subagent in task_metadata when resuming sessions#1798

Merged
code-yeongyu merged 1 commit intodevfrom
feat/subagent-metadata-on-resume
Feb 12, 2026
Merged

feat: include subagent in task_metadata when resuming sessions#1798
code-yeongyu merged 1 commit intodevfrom
feat/subagent-metadata-on-resume

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Feb 12, 2026

Summary

  • Include subagent field in <task_metadata> when resuming sessions via session_id in the delegate-task tool
  • Enables the parent agent to identify which subagent was running in the resumed session without parsing human-readable output

Problem

When delegate-task resumes a session using session_id, the returned <task_metadata> block only contained session_id. The parent orchestrator (Sisyphus) had no structured way to know which agent type (oracle, explore, librarian, etc.) was being continued.

Changes

File Change
sync-continuation.ts Add subagent: {resumeAgent} to task_metadata (uses agent extracted from session message history)
background-continuation.ts Add subagent: {task.agent} to task_metadata (uses agent from BackgroundTask object)
sync-continuation.test.ts 2 new tests: subagent present when agent info exists, omitted when absent
background-continuation.test.ts New test file: 2 tests for subagent presence/absence in task_metadata

Example Output (Before → After)

Before:

<task_metadata>
session_id: ses_abc123
</task_metadata>

After:

<task_metadata>
session_id: ses_abc123
subagent: oracle
</task_metadata>

Testing

  • 143 tests pass across all delegate-task test files, 0 failures
  • TDD approach: RED → GREEN → verified

Summary by cubic

Adds the subagent to <task_metadata> when resuming a session via session_id so the parent orchestrator can see which subagent is being continued without parsing text.

  • New Features
    • task_metadata now includes subagent when resuming with session_id.
    • sync-continuation: reads agent from the session message history; background-continuation: uses task.agent.
    • Omits subagent if unknown. Tests added for presence/absence cases.

Written for commit 95aa759. Summary will update on new commits.

When delegate-task resumes a session via session_id, the response
task_metadata now includes a subagent field identifying which agent
was running in the resumed session. This allows the parent agent to
know what type of subagent it is continuing.

- sync-continuation: uses resumeAgent extracted from session messages
- background-continuation: uses task.agent from BackgroundTask object
- Gracefully omits subagent when agent info is unavailable
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Minimal additive changes (2 lines) adding optional subagent metadata to task output. Well-tested with 207 lines of new tests covering both presence and absence cases. No logic modifications, purely UI

@code-yeongyu code-yeongyu merged commit 283c7e6 into dev Feb 12, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the feat/subagent-metadata-on-resume branch February 12, 2026 10:18
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