feat(core): phase 1 - add step-through mode scaffolding (ApprovalMode.STEP + MessageBus pause)#21593
feat(core): phase 1 - add step-through mode scaffolding (ApprovalMode.STEP + MessageBus pause)#21593TravisHaa wants to merge 3 commits intogoogle-gemini:mainfrom
Conversation
…us pause)
- Add ApprovalMode.STEP = 'step' to the core enum with JSDoc
- Add getApprovalModeDescription() case for STEP mode
- Add STEP_THROUGH_REQUEST/RESPONSE types and interfaces to confirmation-bus
- Add StepThroughAction union type ('next' | 'skip' | 'continue' | 'cancel')
- Create packages/core/src/scheduler/step-through.ts: pauseForStepThrough()
publishes a STEP_THROUGH_REQUEST and awaits the correlated STEP_THROUGH_RESPONSE,
mirroring the existing awaitConfirmation() pattern
- Insert step-through pause in Scheduler before Executing transition;
handles skip (empty result), cancel (abort all queued), continue (revert to DEFAULT), next (proceed)
- Track stepIndex / stepTotal per batch for the future step-counter display
- Wire ApprovalModeIndicator: STEP renders 'step-through' in accent color
- Wire Composer bleed-through text for STEP mode
- Update CYCLE_APPROVAL_MODE cycle: DEFAULT -> AUTO_EDIT -> STEP -> [PLAN] -> DEFAULT
- Add STEP_NEXT / STEP_SKIP / STEP_CONTINUE keybindings (Enter/n, s, c)
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 establishes the foundational backend scaffolding for a new "step-through" approval mode. This mode empowers users with granular control over tool execution by pausing before each tool call, enabling them to inspect inputs and make informed decisions to execute, skip, continue, or cancel the operation. The changes encompass new approval mode definitions, message bus communication patterns, scheduler logic to manage pausing and user responses, and CLI keybindings for interaction. Highlights
Changelog
Activity
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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the backend scaffolding for a new 'step-through' approval mode, which is a great feature for giving users more granular control over tool execution. The changes are well-structured, adding the necessary enum values, message bus types, and core scheduler logic to pause before each tool call. The implementation in scheduler.ts and the new step-through.ts file correctly handles the different user actions (next, skip, continue, cancel). I've identified one potential issue regarding the step counter's accuracy with tail calls, which could lead to a confusing user experience.
There was a problem hiding this comment.
Code Review
This pull request introduces the backend scaffolding for a new STEP approval mode, which allows users to pause and inspect each tool call before execution. The changes are well-structured, adding the new approval mode to the core enum, updating relevant UI components and keybindings, and defining a new message bus protocol for step-through confirmation. The core logic in the Scheduler to pause execution and handle user actions (next, skip, continue, cancel) is sound and correctly implemented. The code adheres to existing patterns and is robust. I found no high or critical issues in this implementation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the backend scaffolding for a new "step-through" approval mode, which is a great addition for finer-grained control over tool execution. The changes are well-structured, adding the necessary ApprovalMode enum, MessageBus types, and core pausing logic in the Scheduler. My review focuses on improving the robustness of the new state management logic to prevent future bugs, specifically by ensuring exhaustive handling of StepThroughAction to adhere to fail-closed principles.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
Adds the backend scaffolding for a new
STEPapproval mode that pauses before every tool call, letting the user decide (execute / skip / continue / cancel) without being inDEFAULTconfirmation mode.Closes Phase 1 of #21484
ApprovalMode.STEP = 'step'added to the core enum; wired throughapprovalModeUtils,ApprovalModeIndicator,Composer, and theCYCLE_APPROVAL_MODEkeybinding cycle (DEFAULT → AUTO_EDIT → STEP → PLAN → DEFAULT)STEP_THROUGH_REQUEST/STEP_THROUGH_RESPONSEmessage bus types added toconfirmation-bus/types.ts, mirroring the existingTOOL_CONFIRMATION_REQUEST/RESPONSEpatternpackages/core/src/scheduler/step-through.ts—pauseForStepThrough()publishes a request and awaits a correlated response vianode:eventson()with abort-signal supportSchedulerpause point inserted before theExecutingtransition whenApprovalMode.STEPis active; handles all four user actions:next(execute),skip(return empty result),cancel(abort all queued),continue(revert to DEFAULT and proceed)Enter/n= next,s= skip,c= continueThe UI dialog (
ToolStepDialog+useStepThroughhook) that subscribes to the request and publishes the response will follow in a separate PR.Test plan
pnpm buildpassespnpm lintpassespnpm typecheckpassesApprovalModeIndicatorshows "step-through" label in accent color when STEP is active