4. modularize session shell execution - #2189
Merged
kevinjosethomas merged 1 commit intoSep 10, 2026
Merged
Conversation
Base automatically changed from
refactor/session-commit-fence
to
refactor/session-input-scheduler
September 10, 2026 04:28
kevinjosethomas
merged commit Sep 10, 2026
8d79a0a
into
refactor/session-input-scheduler
4 checks passed
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8d79a0a. Configure here.
| onUserBashEnd(): Promise<void>; | ||
| executeBash(command: string, onChunk?: (chunk: string) => void, options?: ExecuteBashOptions): Promise<BashResult>; | ||
| recordBashResult(command: string, result: BashResult, options?: { excludeFromContext?: boolean }): void; | ||
| } |
There was a problem hiding this comment.
Exported host unused outside tests
Low Severity
SessionBashHost is exported, but no production code imports it. That published construction surface is unused outside tests and implies a supported host contract that does not exist. Sibling session owners keep the equivalent host type module-private.
Triggered by project rule: Review rules
Reviewed by Cursor Bugbot for commit 8d79a0a. Configure here.
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.


Note
Medium Risk
Shell execution, abort timing, extension precedence, and deferred transcript ordering are scheduling-sensitive; behavior is intended to be unchanged but the logic moved behind new host wiring.
Overview
Extracts session shell behavior from
AgentSessioninto a dedicatedSessionBashowner insession/bash.ts, continuing the session modularization pattern used for scheduling and commit fencing.AgentSessionnow constructsSessionBashwith host callbacks (cwd/shell settings, extensionuser_bashinterception, event emit, transcript append, input checkpoint notifications, and chainedexecuteBash/recordBashResultso public method wrappers still apply). Public APIs (executeBash,runUserBash,abortBash, pending flush,isBashRunning) delegate without changing event shapes orbashExecutionpersistence. Bash lifecycle events are typed viaSessionBashEventon the session event union.Adds focused
SessionBashunit tests and documents shell ownership inREADME.md. One integration test now holds a real in-flightexecuteBashinstead of toggling private bash flags.Reviewed by Cursor Bugbot for commit 8d79a0a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Extract shell execution logic from
AgentSessionintoSessionBashclassAgentSessioninto a newSessionBashowner class in bash.tsSessionBashdepends on aSessionBashHostcallback interface rather than receivingAgentSession,Agent, kernel, or storage-manager objects, keeping the boundary decoupledAgentSessionretains public wrapper methods (executeBash,runUserBash,recordBashResult,abortBash) and getters (isBashRunning,hasPendingBashMessages) that delegate toSessionBashExecuteBashOptions,RunUserBashOptions, andSessionBashEventtypes into bash.ts; updates agent-session.ts to use the exportedSessionBashEventunionSessionBashin bash.test.ts and updates the prompt handoff race test in agent-session-prompt.test.ts to use a real transientexecuteBashinstead of mutating removed private fieldsAgentSession.runUserBashLockedand its private bash fields are removed; any out-of-tree code referencing these private members will breakMacroscope summarized 8d79a0a.