Skip to content

Subagent tool rejects self-referential session IDs #45364

Closed

Description

@mjnaderi

Description

A model can send the calling session ID in subagent.sessionID while it is requesting a new delegation. The continuation path treats that ID as an existing session and rejects it because a session is not its own child.

Plugins

None

OpenCode version

V2

Steps to reproduce

  1. Start a session.
  2. Call subagent with a valid subagent agent, prompt, and description, but set sessionID to the calling session ID.
  3. The call fails with Session <id> is not a child of the current session instead of creating a child session.

Screenshot and/or share link

Image

Operating System

Linux

Terminal

Ghostty

Activity

  1. github-actions commented on Aug 26, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. mjnaderi commented on Aug 27, 2026

    @mjnaderi
    Author

    Found the cause. In my setup, strict field was missing from tool functions. I added strict: false and the issue was resolved.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions