feat(core): add LocalSessionInvocation#26665
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new infrastructure for managing subagent sessions, specifically adding LocalSessionInvocation for local agents and defining standardized protocols to encapsulate agent execution logic. These changes are part of the broader ADK integration effort to unify how different agent types interact with the core system, ensuring consistent handling of streaming activity and execution results. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Hi @adamfweidman, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
There was a problem hiding this comment.
Code Review
This pull request introduces LocalSessionInvocation and RemoteSubagentProtocol to manage local and remote subagent executions via session-based protocols, including progress streaming and abort handling. Comprehensive unit tests for these new components are also added. Feedback identifies that LocalSessionInvocation lacks nullish checks when accessing activity data, which could display 'undefined' in the UI, and notes that THOUGHT_CHUNK updates should append content instead of overwriting it to maintain the full thought history.
33ed68f to
5cb3bd5
Compare
c6e26af to
07e94be
Compare
|
Size Change: -386 B (0%) Total Size: 33.8 MB
ℹ️ View Unchanged
|
… invocation New invocation class that delegates to LocalSubagentSession instead of directly using LocalAgentExecutor. Existing LocalSubagentInvocation is untouched — this will be wired in behind a feature flag in a later PR.
Use typeof check and trim to avoid displaying 'undefined' for missing properties in THOUGHT_CHUNK, TOOL_CALL_START, TOOL_CALL_END, and ERROR events. TAG=agy CONV=d4b1d79a-226d-4301-8d60-bdb5d4701569
07e94be to
7bf9d01
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the LocalSessionInvocation class and its corresponding unit tests. LocalSessionInvocation orchestrates subagent execution, manages progress updates, and tracks activities like thoughts and tool calls. The review feedback highlights several critical security and logic improvements: sanitizing input parameters and error messages to prevent data leakage and prompt injection, correctly appending streaming thought chunks rather than replacing them, and utilizing unique call identifiers instead of names to reliably track parallel tool executions.
There was a problem hiding this comment.
Code Review
This pull request introduces the LocalSessionInvocation class and a comprehensive test suite to handle local subagent execution via LocalSubagentSession. The implementation manages activity streaming for thoughts and tool calls, progress updates, and lifecycle management including abort and error handling. Feedback focuses on security enhancements to prevent prompt injection by sanitizing tool arguments and avoiding user-controlled error messages in llmContent. Additionally, a correction was suggested for the THOUGHT_CHUNK handling to ensure streaming deltas are appended rather than overwritten.
…session invocation
|
This review was performed by /review-frontend with manual review by Jacob. Note that review-frontend also noted that LocalSessionInvocation and LocalSubagentInvocation are nearly identical but I am assuming that is intentional. Findings & Feedback1.
|
|
|
✅ 69 tests passed successfully on gemini-3-flash-preview. 🧠 Model Steering GuidanceThis PR modifies files that affect the model's behavior (prompts, tools, or instructions).
This is an automated guidance message triggered by steering logic signatures. |
3d51422 to
7d5d1c5
Compare
…se year, description truncation, callId parallel tracking)
7d5d1c5 to
af3aadd
Compare

Summary
Implements
LocalSessionInvocationto enable session-based local subagent invocation, wrappingLocalAgentExecutorbehindAgentProtocol. This branch is stacked on top of therefactor/subagent-progress-enumsbranch.Details
LocalSessionInvocationclass inpackages/core/src/agents/local-session-invocation.ts.AgentProtocolinterface to abstract local execution.local-session-invocation.test.ts.Related Issues
Progress towards #22700
How to Validate
Run the unit tests:
Pre-Merge Checklist