Skip to content

fix(sbx): suggest 'mocactl sbx mode lease+processes <id>' in the refusal - #928

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
esnible:fix/927-sbx-mode-hint
Nov 19, 2026
Merged

pdettori merged 1 commit into
rossoctl:mainfrom
esnible:fix/927-sbx-mode-hint

Conversation

@esnible

@esnible esnible commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

The processes not enabled refusal suggested mocactl sbx mode <id> lease+processes, but the CLI takes mocactl sbx mode MODE [ID], so running the suggestion as printed failed with the mode must be one of per-exec, lease, lease+processes (got 'sbx-…'). This changes the message to mocactl 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 --help and 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 text
  • docs/specs/2026-11-08-sbx-lease-mode-design.md: the two quoted messages (§7, §8.2)
  • Tests asserting the text: 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 in deploy/sbx/tests/smoke.test.sh

Not included: the optional item in #927 (adding the sandbox id to the proc ls / proc stop hints). That can be a follow-up.

Testing

  • vitest run test/mcp-server.test.ts (sandbox-client): 84 passed
  • vitest run test/sbx-proc.test.ts test/sbx-exec.test.ts (mocactl): 103 passed
  • bash deploy/sbx/tests/smoke.test.sh: no failures
  • pre-commit (prettier, shellcheck): passed

Assisted-By: Claude Code

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 esnible self-assigned this Nov 19, 2026
@esnible
esnible marked this pull request as ready for review November 19, 2026 18:41
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 19, 2026
@pdettori pdettori added this to the v0.11.0 milestone Nov 19, 2026

@ingpaolodettori-dev ingpaolodettori-dev 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.

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 fake sbx (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 for processes 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.

@pdettori
pdettori merged commit 88cf603 into rossoctl:main Nov 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sbx: 'processes not enabled' refusal suggests 'mocactl sbx mode <id> lease+processes' (wrong argument order)

3 participants