Skip to content

feat(plugin): support parent session creation - #52359

Merged
rekram1-node merged 1 commit into
v2from
pr47745-child-session
Oct 1, 2026
Merged

rekram1-node merged 1 commit into
v2from
pr47745-child-session

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • Forward parentID through plugin and HTTP session.create, so children inherit the parent's Location rather than becoming root sessions. Missing parents return the declared 404.
  • Regenerate the public clients and test the plugin, HTTP, and Promise-client paths.
  • Replace feat(plugin): support parent session creation #47745 with a clean branch from current v2. The original work is credited to @dbpolito as a commit co-author; no MDX documentation edits are carried over.

Related issues

Verification

  • bun run generate in packages/client
  • Plugin child-session test, HTTP create/import tests, and Promise-client serialization test pass.
  • Scoped Core, Protocol, Server, Client, and Plugin typechecks pass.
  • Full repository bun run check could not complete: the unrelated Posts package requires Node >=22.12.0; this host has Node 18.19.1.

Requested by: @rekram1-node (Aiden via Slack)

@rekram1-node
rekram1-node merged commit 19f2038 into v2 Oct 1, 2026
9 of 10 checks passed
@rekram1-node
rekram1-node deleted the pr47745-child-session branch October 1, 2026 03:50
Ichinose-Kazuki pushed a commit to Ichinose-Kazuki/opencode that referenced this pull request Oct 7, 2026
mradwankhalil added a commit to mradwankhalil/oh-my-openagent that referenced this pull request Oct 19, 2026
…s a child session

The V1 facade's session.create read body.parentID but only stored it as
metadata.omoParentID and in adapter memory. The native OpenCode V2 create call
never received parentID, so every session spawned by task / call_omo_agent /
background agents was persisted with parent_id NULL and showed up as a
top-level session in the UI. OMO itself did not notice because withParent and
childSessions rebuilt the link from metadata.

Pass parentID to the native create (supported since OpenCode v2.0.22,
anomalyco/opencode#52359). The native host places a child at its parent's
location and ignores location when parentID is set, so a child that asked for a
different directory (team worktree, task cwd) is moved there with session.move
right after creation. The metadata and adapter-state bookkeeping are kept.
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