Repository navigation
Conversation
There was a problem hiding this comment.
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.
Issue for this PR
Closes #59406
Type of change
What does this PR do?
ACP
session/listreturns subagent sessions but didn't tell clients which session was their parent, even though the HTTP API already exposesSession.Info.parentID. Entries with aparentIDnow carry_meta["opencode/child-session"]withid,parentID(the immediate parent), andtitle— the same shape already sent onsession/updatenotifications. Root sessions get no_meta, unknown keys are ignorable per ACP's extensibility rules (no capability bump), anddepthis omitted because it only exists relative to a prompt's root session.How did you verify your code works?
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 thatdepthis absent.bun test test/acp/session.test.ts --rerun-each 10— 60/60 pass.session/updatechild metadata withdepthis unchanged.bun check -binpackages/cli(1,885 files) andpackages/app: no type errors. Fullbun turbo typecheck: 35/35 packages green. Root lint: 0 errors.services/www:astro checkandbun run buildpass with the new docs section.Visual
--
Screenshots / recordings
--
Checklist
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)