Skip to content

fix(core): ignore self-referential subagent IDs - #45362

Open
mjnaderi wants to merge 2 commits into
anomalyco:v2from
mjnaderi:self-subagent-id
Open

fix(core): ignore self-referential subagent IDs#45362
mjnaderi wants to merge 2 commits into
anomalyco:v2from
mjnaderi:self-subagent-id

Conversation

@mjnaderi

@mjnaderi mjnaderi commented Aug 26, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #45364

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Some models echo the calling session ID as subagent.sessionID while requesting a new delegation. The continuation ownership check rejects that ID because a session is not its own child.

Treat a self-referential sessionID as absent so the request creates a new child. Existing direct-child continuation and unrelated-session rejection are unchanged.

How did you verify your code works?

  • bun test test/tool-subagent.test.ts from packages/core
  • bun typecheck from packages/core

Screenshots / recordings

Not applicable; this is a Core behavior change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Some models echo the calling session ID as the subagent sessionID
while requesting a new delegation. The continuation ownership check then
rejects the caller as a non-child.

Treat a self-referential sessionID as absent so the call creates a new
child session. Keep direct-child continuation and unrelated-session
rejection unchanged.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant