refactor(core): introduce SubagentState enum for progress#26934
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 standardizes subagent status management by introducing a 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
|
|
Size Change: +1.39 kB (0%) Total Size: 34.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a SubagentState enum to replace string literals for subagent statuses, improving type safety and consistency across the core logic, UI components, and test suites. While the refactor is applied extensively, feedback indicates that the migration is incomplete in SubagentGroupDisplay.tsx, where some hardcoded string literals still persist.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a SubagentState enum to replace string literals for managing subagent states, improving type safety and consistency across the codebase. The reviewer highlights that several string literal usages were missed in SubagentProgressDisplay.tsx and remote-invocation.test.ts, which must be updated to avoid TypeScript compilation errors.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the handling of subagent statuses by introducing a SubagentState enum in packages/core. This enum replaces string literals for 'running', 'completed', 'error', and 'cancelled' states across the CLI UI components, core agent logic, and associated test files, ensuring better type safety and consistency throughout the monorepo. I have no feedback to provide.
Summary
Refactors
SubagentProgressandSubagentActivityItemto use a newSubagentStateenum instead of string literal unions for status values (running,completed,error,cancelled). This improves type safety and maintainability.Details
SubagentStateenum inpackages/core/src/agents/types.ts.packages/core/src/agents/local-invocation.tspackages/core/src/agents/remote-invocation.tspackages/core/src/agents/a2aUtils.tspackages/core/src/agents/browser/browserAgentInvocation.tspackages/cli/src/ui/components/messages/SubagentGroupDisplay.tsxpackages/clifailed during preflight due to environment issues (toMatchSvgSnapshotmissing) and non-deterministic spinner frames in snapshots. These are unrelated to this refactor.Related Issues
Cleanup towards #20995 generally
How to Validate
Run unit tests in
packages/core:Pre-Merge Checklist