fix(agent-core-v2): reject subagent goals - #1697
Conversation
🦋 Changeset detectedLatest commit: 4c04c6b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5664752d3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
e4d0909 to
4c04c6b
Compare
Related Issue
No linked issue. This is a focused fix for an inconsistent subagent goal lifecycle exposed by the v2 RPC and Service surfaces.
Problem
Goal mode is intended for the main agent: both v1 and v2 expose the goal model tools only to the main agent, and the CLI, SDK, and legacy session entry points operate on the main agent.
The v2 Agent-scoped RPC and reflected Service channels could still target a subagent. That allowed a subagent goal to be created and automatically continued even though the subagent did not receive the goal tools required to mark it complete or blocked. The result was a half-enabled lifecycle that could start but could not close itself.
What changed
goal.unsupported_agenterror.40920and map the domain error through the v2 transport.Boundaries
Validation
pnpm --filter @moonshot-ai/agent-core-v2 exec vitest run test/agent/goal— 109 tests passed.pnpm --filter @moonshot-ai/protocol test— 524 tests passed.pnpm --filter @moonshot-ai/kap-server exec vitest run test/transport-errors.test.ts— 9 tests passed.@moonshot-ai/agent-core-v2,@moonshot-ai/protocol, and@moonshot-ai/kap-server.pnpm --filter @moonshot-ai/agent-core-v2 lint:domainpassed.pnpm exec changeset statusreports only an@moonshot-ai/kimi-codepatch.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.