forge-v2: feat(core): refactor subagent tool to unified invoke_subagent tool#2
Open
kimjune01 wants to merge 1 commit intoc-test-24489from
Open
forge-v2: feat(core): refactor subagent tool to unified invoke_subagent tool#2kimjune01 wants to merge 1 commit intoc-test-24489from
kimjune01 wants to merge 1 commit intoc-test-24489from
Conversation
Blind-blind winner: codex Complexity gate: delta=-0.0096 Reviewer: approved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forge-v2 refactored version of google-gemini/gemini-cli#24489
Original PR
feat(core): refactor subagent tool to unified invoke_subagent tool
Summary
Refactors specialized subagent tools into a single, unified
invoke_agenttool and updates the Policy Engine to support virtual tool aliases for subagents.Details
invoke_agentinpackages/coreas the standard mechanism for subagent delegation, replacing the previous 1:1 tool-to-agent mapping.PolicyEngineto automatically treat theagent_nameargument ofinvoke_agentas a virtual tool name. This ensures that existing safety policies (e.g., denyingcodebase_investigator) remain functional without requiring rule updates.invoke_agent.policy-engine.test.tsfor virtual alias matching and updatedsubagents.eval.tsto verify successful delegation via the new unified tool.subagents.mdandpolicy-engine.mdto reflect the new invocation pattern and policy syntax.Related Issues
Related to the effort of simplifying the main agent's toolset and improving context efficiency.
How to Validate
npm test -w @google/gemini-cli-coreto verify Policy Engine and prompt rendering logic.npm run test:evals -- subagents.eval.tsto ensure the model correctly uses the unified tool for delegation.codebase_investigator).invoke_agentwith thatagent_nameresults in aDENYdecision.Pre-Merge Checklist
Forge-v2 pipeline results
Refactoring claims applied
What is this?
This diff shows the output of a forge-wrapped LLM refactoring pipeline applied to PR google-gemini#24489's code at the point where tests first passed (
C_test). The question: can an autonomous pipeline improve the implementation before human review?Pipeline: goal-anchored volley → adversarial hunt-spec → blind-blind implementation (Opus 4.6 + Codex GPT-5.4, smaller-churn wins) → hunt-code with full build+tests → Gemini 3.1 Pro reviewer-loop → complexity gate (δ=0.05).
Experiment: refactor-equivalence v2 — Does an LLM refactoring pass help or hurt brownfield PRs?