Skip to content

feat(cli): report subagent parentID in ACP session/list _meta - #59409

Open
Perkovec wants to merge 2 commits into
anomalyco:devfrom
Perkovec:acp-parent-id
Open

Perkovec wants to merge 2 commits into
anomalyco:devfrom
Perkovec:acp-parent-id

Conversation

@Perkovec

@Perkovec Perkovec commented Oct 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #59406

Type of change

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

What does this PR do?

ACP session/list returns subagent sessions but didn't tell clients which session was their parent, even though the HTTP API already exposes Session.Info.parentID. Entries with a parentID now carry _meta["opencode/child-session"] with id, parentID (the immediate parent), and title — the same shape already sent on session/update notifications. Root sessions get no _meta, unknown keys are ignorable per ACP's extensibility rules (no capability bump), and depth is omitted because it only exists relative to a prompt's root session.

How did you verify your code works?

  • New wire test in packages/cli/test/acp/session.test.ts: seeds root, child, and grandchild sessions and asserts the child entries carry _meta["opencode/child-session"] with the immediate parent (grandchild points at the child, not the root), that roots have no _meta, and that depth is absent. bun test test/acp/session.test.ts --rerun-each 10 — 60/60 pass.
  • Existing ACP wire suites (session, additional-directories, error, translate, turn, permission) — 70/70 pass, confirming session/update child metadata with depth is unchanged.
  • bun check -b in packages/cli (1,885 files) and packages/app: no type errors. Full bun turbo typecheck: 35/35 packages green. Root lint: 0 errors.
  • services/www: astro check and bun run build pass with the new docs section.

Visual

--

Screenshots / recordings

--

Checklist

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

Added by the opencode bot (AI-generated).

Fixes #59406

Related: #32445

Public API: adds optional _meta["opencode/child-session"] (id, parentID, title) to ACP session/list entries for child sessions (backwards compatible)

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I ran opencode acp from source against a store holding a root session and a child session (child created via POST /api/session with parentID). On the base, the child's session/list entry has no _meta. With this change it carries _meta["opencode/child-session"] with id and parentID, and the root entry stays unchanged. All ACP tests in packages/cli/test/acp/ pass and tsc -b passes in packages/cli.

Public API: adds an optional _meta["opencode/child-session"] (id, parentID, optional title) to ACP session/list entries for sessions that have a parent. It's backwards compatible: root entries are unchanged, and clients can ignore unknown _meta keys.

One small thing: the description says it closes #58420, which is an unrelated desktop pull request. It looks like #59406 was meant, so it may be worth fixing the link.

Fixes #59406
Related: #32445

This branch has not been deployed

No deployments
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.

[FEATURE]: Expose subagent parentID in ACP session/list

1 participant