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): limit new sessions while preserving active conversations - #9065
Bound the StepCode sessions owned by each OpenCodex home in a proxy process. When all eight slots are occupied, existing conversations continue to work. A new conversation receives the retryable step_cli_pool_full error until a slot becomes available. Opening and closing sessions count toward the limit, and a slot is released after cleanup is confirmed.
The cap applies even when retained conversations are idle but have not yet reached their idle timeout. No existing conversation is evicted to admit another one. The limit is separate from account or subscription quotas.
Verification
On Windows with Bun 1.4.4, bun test tests/adapters/step-cli-session.test.ts tests/adapters/step-cli-ownership.test.ts tests/adapters/step-cli-conversation.test.ts tests/adapters/step-cli-run-turn.test.ts passed all 80 tests with 203 assertions. The new case uses synthetic session children to check reuse, capacity during opening and closing, and admission after cleanup.
bun check --no-script --noEmit passed for 2,691 files. The structure and privacy checks and git diff --check passed.
The documentation build generated 820 pages. Checked the updated English and Spanish guides in the generated output.
Local coverage focused on the adapter and documentation. No provider account or live StepCode process was needed. The full local suite was not run.
Checklist
Scoped the change to StepCode session admission and its error classification.
Updated the provider contract and both user guides.
Independently reviewed slot lifetime, existing session reuse, and separation from quota errors. Maintainer review is requested.
Summary by CodeRabbit
New Features
Limited each OpenCodex home to eight StepCode sessions. Existing conversations remain available at capacity; new conversations can be retried when a slot opens.
Sessions count toward the limit until cleanup completes, including during the ten-minute idle shutdown period.
Documentation
Updated the English and Spanish guides and transport documentation with session capacity details.
Reviewing files that changed from the base of the PR and between 2530edc and 683581a.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The Step CLI session pool now limits each OpenCodex home to eight owned sessions. New conversation opens at capacity receive a retryable step_cli_pool_full refusal. Existing conversations remain available, and closing sessions count until cleanup completes.
The session pool rejects new opens when eight sessions are owned. The error maps to a retryable 503 refusal. Tests cover reuse of existing conversations and capacity release after a closing child emits close. The transport and CLI guides document the limit and cleanup behavior.
lidge-jun/opencodex#7267: Added the Step CLI transport and session-pool foundation that this change extends.
Merge Risk: Minimal · previous review 4c0a3
This change limits each OpenCodex home to eight StepCode sessions. New conversations over the limit get a retryable step_cli_pool_full error, and existing conversations keep working. No concrete defect was found, and the capacity behavior and documentation are consistent. It looks safe 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): limit new sessions while preserving active conversations" matches the main change. The changeset caps StepCode sessions per OpenCodex home at eight in session-pool.ts, return…
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): limit new sessions while preserving active conversations" matches the main change. The changeset caps StepCode sessions per OpenCodex home at eight in session-pool.ts, returns step_cli_pool_full for new conversations at capacity, and keeps existing conversations reusable. The docs and tests cover the same behavior. The title is specific and concise, and it names the step-cli scope.
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 9e0e298 and 4c0a358.
Files selected for processing: 6
docs-site/src/content/docs/es/guides/step-cli.md
docs-site/src/content/docs/guides/step-cli.md
src/adapters/step-cli/errors.ts
src/adapters/step-cli/session-pool.ts
structure/providers/step-cli-transport.md
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; 5 remain after this review.
PR checks passing on that head: enforce / enforce-target, ci, hygiene / hygiene, npm-global ubuntu-latest, docs site build, test changed, docker smoke, structure gate, gates, enforce / resolve-pr, label / label, storage policy, Catalog async contracts (ubuntu-latest), api usage, select windows runner, changes, validate-source. Skipped jobs are not counted as passing.
Relaxed gate: (a) 4 commits behind origin/dev c3aa113 (limit 10): PASS. (b) git merge-tree --write-tree c3aa113683581a: clean. (c) dev commits since merge-base 8961476 touch none of this PR's files: yes; shared-class files dev touched: scripts/test-layout/layout-server-inbound.json tests/fixtures/test-layout-expected.json ; shared-class files this PR touches: none (guards below decide when both sides touch a class). (d) temporary local merge a7e2dea7b5d653423ec6deb64078032a21cb3ad7: bun run typecheck exit 0; bun test --timeout 60000 [focused: tests/adapters/step-cli-session.test.ts] [guards: tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/skill-ocx.test.ts]: 70 pass 0 fail exit 0; bun run structure:check exit 0: PASS.
Independent review (gpt-6.1-terra): APPROVE, no findings. The cap reserves capacity while opening and through cleanup and keeps existing and coalesced sessions working at capacity; the new capacity test fails against dev's session-pool.ts and passes here; six StepCode suites 107 pass.
scripts/ci/assert-mergeable-review.sh --maintainer-integration 9065: OK.
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
Bound the StepCode sessions owned by each OpenCodex home in a proxy process. When all eight slots are occupied, existing conversations continue to work. A new conversation receives the retryable
step_cli_pool_fullerror until a slot becomes available. Opening and closing sessions count toward the limit, and a slot is released after cleanup is confirmed.The cap applies even when retained conversations are idle but have not yet reached their idle timeout. No existing conversation is evicted to admit another one. The limit is separate from account or subscription quotas.
Verification
bun test tests/adapters/step-cli-session.test.ts tests/adapters/step-cli-ownership.test.ts tests/adapters/step-cli-conversation.test.ts tests/adapters/step-cli-run-turn.test.tspassed all 80 tests with 203 assertions. The new case uses synthetic session children to check reuse, capacity during opening and closing, and admission after cleanup.bun check --no-script --noEmitpassed for 2,691 files. The structure and privacy checks andgit diff --checkpassed.Checklist
Summary by CodeRabbit