Skip to content

fix(pool): keep reused sandboxes with their provider owner - #26

Closed
xiehuanyi wants to merge 1 commit into
cased:mainfrom
xiehuanyi:fix/pool-provider-reuse
Closed

xiehuanyi wants to merge 1 commit into
cased:mainfrom
xiehuanyi:fix/pool-provider-reuse

Conversation

@xiehuanyi

Copy link
Copy Markdown

A shared SandboxPool can return a sandbox owned by another provider instance when both requests use the same labels. For example, acquire and release with account A, then acquire with account B using {"project": "demo"}: B receives A's sandbox ID and its provider never creates a sandbox. This also crosses credentials when the two instances have the same provider name.

Require provider instance ownership during label-based reuse. Matching resources from the same instance still reuse correctly, and the pool's public label lookup remains unchanged.

Validation: the regression fails on main with first-account-1 returned to the second account; it passes with the fix. All 209 offline tests pass (1 credential-dependent test skipped, 30 integration tests deselected), and full Ruff/Black checks pass. Mypy reports the same 57 diagnostics in 11 files on the unchanged base and this branch; CI already treats that check as advisory. No cloud sandbox was created.

AI assistance: implemented and tested with Codex.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@xiehuanyi xiehuanyi closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants