Repository navigation
fix(sbx): suggest 'mocactl sbx mode lease+processes <id>' in the refusal - #928
Merged
Merged
Conversation
The `processes not enabled` refusal told the user (and, through the MCP server, the agent) to run `mocactl sbx mode <id> lease+processes`. The CLI takes `mocactl sbx mode MODE [ID]`, so the suggested command failed with "the mode must be one of ...". The order came from the two quoted messages in the lease-mode spec; the CLI, its --help and the user docs already put the mode first. Fix the message in both audiences, the spec's two quotes, and the tests and smoke-test mock that assert the text. Fixes rossoctl#927 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ed Snible <[email protected]>
esnible
marked this pull request as ready for review
November 19, 2026 18:41
ingpaolodettori-dev
approved these changes
Nov 19, 2026
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Review — fix(sbx): suggest mocactl sbx mode lease+processes <id> in the refusal
Right fix, right blast radius. The suggestion was unusable as printed: mode MODE [ID] is the CLI's order (cli.ts:209, lease-commands.ts:53), so mode <id> lease+processes fed the id as the mode and failed with "the mode must be one of …".
- Both audiences move: the model's text (
mcp-server.ts:164,processesNotEnabledText) and the terminal one (:243). - Every assertion that pins the text moves with it —
mcp-server.test.ts(4 sites),sbx-exec.test.ts,sbx-proc.test.ts(2) — and the smoke harness's fakesbx(deploy/sbx/tests/smoke.test.sh:249). - The spec's two quoted messages, which were the source of the wrong order, are corrected (
docs/specs/2026-11-08-sbx-lease-mode-design.md:518,:845); only ADRs are immutable, so editing a spec in place is right. - I searched the tree for the old order (
sbx mode <id> lease…,mode <id> lease) and forprocesses not enabled: nothing stale is left.
One leftover, too small for its own line: the comment at packages/sandbox-client/src/mcp-server.ts:77 still describes the option as "the §7 refusal's mocactl sbx mode <id>" — now that the refusal names the mode, the snippet reads as a command with the mode missing. Worth fixing the next time the file is touched.
Author: esnible (MEMBER — maintainer). One commit, signed off. CI 18/18, k8s-kind-e2e and the docs/site build included.
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.
Summary
The
processes not enabledrefusal suggestedmocactl sbx mode <id> lease+processes, but the CLI takesmocactl sbx mode MODE [ID], so running the suggestion as printed failed withthe mode must be one of per-exec, lease, lease+processes (got 'sbx-…'). This changes the message tomocactl sbx mode lease+processes <id>for both audiences: the terminal (mocactl sbx proc) and the agent (MCP server,ask the user to run: …).The wrong order came from the two quoted messages in the lease-mode spec, so those are fixed too. The CLI, its
--helpand the user docs already put the mode first, and are unchanged.Fixes #927
Changes
packages/sandbox-client/src/mcp-server.ts: both forms of the refusal textdocs/specs/2026-11-08-sbx-lease-mode-design.md: the two quoted messages (§7, §8.2)packages/mocactl/test/sbx-proc.test.ts,packages/mocactl/test/sbx-exec.test.ts(plus a comment),packages/sandbox-client/test/mcp-server.test.ts, and the mock mocactl indeploy/sbx/tests/smoke.test.shNot included: the optional item in #927 (adding the sandbox id to the
proc ls/proc stophints). That can be a follow-up.Testing
vitest run test/mcp-server.test.ts(sandbox-client): 84 passedvitest run test/sbx-proc.test.ts test/sbx-exec.test.ts(mocactl): 103 passedbash deploy/sbx/tests/smoke.test.sh: no failuresAssisted-By: Claude Code