You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(step-cli): require current user text to start a conversation - #9117
A new StepCode conversation now requires nonblank user text in the current turn. Empty turns, replayed history alone and tool results without a conversation receive the existing invalid-input error before a new child is prepared.
A result for an existing conversation can still join its open or opening session. The existing conversation lock checks the held call and tool catalog before delivering the result. The eight-session limit and its error precedence are preserved.
Verification
Windows and Bun 1.4.4. Five focused StepCode suites covering turns, sessions, ownership, conversation ordering and tool results passed 87 tests during implementation. After adding the replay-boundary check, all 8 selected admission and continuation cases passed (42 assertions). Tests used mock StepCode children.
Verified the input error and zero session preparations, a current user message after restored history, matching results with and without user history, in-flight session reuse, and existing pool capacity.
Typecheck, structure checks, privacy scan and whitespace validation passed. The documentation build generated 820 pages and checked 126,324 internal links. The English and Spanish StepCode pages contain the updated guidance.
Local testing focused on StepCode because the Windows test runner is shared with other worktrees. The full repository suite is left to CI.
Checklist
Changes are scoped to StepCode session admission and its regression tests.
Updated the StepCode transport contract and English and Spanish provider guides.
Reviewed the existing session ownership and shutdown paths. The change introduces no credentials, headers or logging.
Summary by CodeRabbit
New Features
New StepCode conversations can now be started with non-empty user text. Tool-result-only turns can continue a matching call in an existing or opening conversation.
Bug Fixes
Turns without starting user text are now rejected when no conversation is available to continue, rather than opening a new conversation.
Documentation
Updated the StepCode guides in English and Spanish to clarify how user text, tool results, and existing conversations affect turn handling.
No actionable comments were generated in the recent review.
Walkthrough
The Step CLI adapter now requires starting user text to create a new session. A turn without that text can use an existing or opening session. If none is available, the adapter returns a 400 step_cli_no_user_text refusal. Tests and documentation describe these rules and tool-result continuations.
Changes: Step CLI conversation admission
Layer / File(s)
Summary
Starting-text detection and session lookup src/adapters/step-cli/projection.ts, src/adapters/step-cli/session-pool.ts, tests/adapters/step-cli-session.test.ts
hasStartingUserText checks for usable user text after the continuation boundary. The session pool returns an existing or opening session for an existing-only request, and returns undefined instead of opening a new session when none exists.
Adapter refusal and continuation behavior src/adapters/step-cli/adapter.ts, tests/adapters/step-cli-run-turn.test.ts, docs-site/src/content/docs/guides/step-cli.md, docs-site/src/content/docs/es/guides/step-cli.md, structure/providers/step-cli-transport.md
The adapter returns a 400 step_cli_no_user_text refusal when no session is available. Tests cover rejected turns, restored history, and tool-result continuations. The documentation describes the starting-text and continuation rules.
sequenceDiagram
participant runTurn
participant hasStartingUserText
participant StepSessionPool
participant StepConversationHost
runTurn->>hasStartingUserText: Check transcript for starting user text
runTurn->>StepSessionPool: Open with existingOnly when text is absent
alt Existing session or open is available
StepSessionPool-->>runTurn: Return session
else No session and existingOnly is true
StepSessionPool-->>runTurn: Return undefined
runTurn-->>runTurn: Return 400 step_cli_no_user_text refusal
else Starting user text is present
StepSessionPool->>StepConversationHost: Open a new session
StepConversationHost-->>StepSessionPool: Return session
StepSessionPool-->>runTurn: Return session
end
Loading
Possibly related PRs
lidge-jun/opencodex#7267: Creates the Step CLI transport that routes Step Plan traffic through step --sdk-stdio; this change updates the same adapter and session-pool path.
lidge-jun/opencodex#9065: Adds the StepCode session-capacity limit; this change updates the session-admission path and tests its capacity behavior.
Merge Risk: Minimal · up to d90d1
Step CLI turns without starting user text can no longer open a new conversation and receive the existing 400 refusal instead. They can still resume an existing or opening conversation. No concrete defect was found, so the change is low risk to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(step-cli): require current user text to start a conversation" matches the main change. The PR adds a hasStartingUserText check in projection.ts, passes existingOnly through runTurn and …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(step-cli): require current user text to start a conversation" matches the main change. The PR adds a hasStartingUserText check in projection.ts, passes existingOnly through runTurn and the session pool, and returns a 400 step_cli_no_user_text refusal when a turn has no starting user text. The docs and tests cover the same behavior. The title is specific, concise, and free of noise.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 414faaf and d90d199.
Files selected for processing: 8
docs-site/src/content/docs/es/guides/step-cli.md
docs-site/src/content/docs/guides/step-cli.md
src/adapters/step-cli/adapter.ts
src/adapters/step-cli/projection.ts
src/adapters/step-cli/session-pool.ts
structure/providers/step-cli-transport.md
tests/adapters/step-cli-run-turn.test.ts
tests/adapters/step-cli-session.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
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
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.
Summary
A new StepCode conversation now requires nonblank user text in the current turn. Empty turns, replayed history alone and tool results without a conversation receive the existing invalid-input error before a new child is prepared.
A result for an existing conversation can still join its open or opening session. The existing conversation lock checks the held call and tool catalog before delivering the result. The eight-session limit and its error precedence are preserved.
Verification
Checklist
Summary by CodeRabbit