Support invoke_agent in direct runtimes - #3587
Conversation
📝 WalkthroughWalkthroughChangesThe PR adds a runtime-local Generic agent delegation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CallingAgent
participant invoke_agent
participant AgentResolver
participant TargetAgent
CallingAgent->>invoke_agent: Provide target, task, prompt, and context
invoke_agent->>AgentResolver: Resolve target at call time
AgentResolver-->>invoke_agent: Return target agent
invoke_agent->>TargetAgent: Execute augmented prompt
TargetAgent-->>CallingAgent: Return delegated result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d379f8214
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/agent/runtime/agent-delegation.test.ts`:
- Around line 122-192: Replace the three Deno.test declarations in
src/agent/runtime/agent-delegation.test.ts lines 122-192 with describe() and
it() from `#veryfront/testing/bdd.ts`, and use assertions from
`#veryfront/testing/assert.ts`. Apply the same BDD test API conversion to the
changed declaration in src/agent/runtime/skill-metadata.test.ts line 974; update
imports as needed and preserve each test’s existing behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8b149e02-c2ac-4c6b-8dfd-5c3dba32a68e
📒 Files selected for processing (10)
docs/guides/multi-agent.mdsrc/agent/factory.test.tssrc/agent/factory.tssrc/agent/hosted/cloud-agent-chat-execution.tssrc/agent/hosted/cloud-agent-child-tools.tssrc/agent/hosted/veryfront-cloud-agent-service.test.tssrc/agent/runtime/agent-delegation.test.tssrc/agent/runtime/agent-delegation.tssrc/agent/runtime/mcp-server-tool-sources.tssrc/agent/runtime/skill-metadata.test.ts
Codex independent reviewReviewed SHA: Findings
Verification
Verdict: REQUEST_CHANGES Review-Gate: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfc38e39f6
ℹ️ 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". |
|
Addressed the four findings from the 58/100 review against 6d379f8:
A subsequent review also identified cancellation propagation; the parent abort signal now reaches the invoked child and has regression coverage in d339b92. Current head: d339b92. Verification: 27 PR checks passed, 0 failed, 0 pending; full local pre-push validation passed with 3,780 tests; 0 unresolved review threads. The latest Codex review on this head reported no major issues. |
Codex exact-head reviewReviewed SHA: FindingsNo blocking or unresolved actionable findings. The original four findings are fixed at this head: explicit delegate scopes suppress generic selection, direct tools do not receive unsupported hosted overrides, execution coverage runs across runtimes, and generated API documentation is current. Parent cancellation also propagates into child execution. Verification
Scoring
Minor deductions are non-blocking: direct runtimes retain the documented acyclic-authoring expectation instead of the hosted depth cap, and the generic unavailable-target branch is straightforward but lacks its own dedicated assertion. Verdict: APPROVE Review-Gate: |
What changed
tools: { invoke_agent: true }as a runtime-local platform tool in direct runtimesdelegatescapability boundaries, including empty delegate scopesinvoke_agentinvoke_agentas a first-class multi-agent communication toolRoot cause
Direct-runtime MCP discovery deliberately excluded
invoke_agentbecause it is runtime-provided, but the direct agent factory never materialized the tool. Explicit declarations therefore reached tool assembly as unresolved booleans and failed withUnknown tool reference: invoke_agent.Impact
Projects pulled from Studio can retain
tools: { invoke_agent: true }and run the same generic multi-agent communication pattern locally without converting to fixed delegate bindings. Explicitdelegatesconfigurations remain the capability boundary and cannot expose generic agent selection.Validation
git diff --checkpassedinvoke_agentcompleted and invoked thecase-ingestchild; the prior unknown-tool failure no longer occurredReview follow-ups
Addressed delegate scoping, direct-runtime override behavior, cross-runtime test execution, generated documentation, and child cancellation propagation.