Repository navigation
feat(sbx): sbx up configures IBM Bob, and pull --apply refuses .bob/ - #657
Conversation
Same hole as .codex/ in #592, for the next agent. `.bob/settings.json` is IBM Bob's project-scoped configuration and declares MCP servers with an arbitrary `command` and `args` that Bob launches on the laptop, so it belongs in AGENT_DIRS and did not: false .bob/settings.json <- applied true .codex/config.toml true .pi/extensions/x.ts Verified against `bob` 0.0.32: `bob mcp add` defaults to `-s project` and writes `.bob/settings.json` with a `mcpServers` map shaped like `.mcp.json`'s. One AGENT_DIRS entry, matching at any depth and under the existing case and Unicode folding like the others. Tests cover `.bob/settings.json`, the folded `.BOB/` and fullwidth `.BOB/` variants, and the negatives: `.bobrules` (a real Bob file, but a prompt file — text, not an executable, so allowed like AGENTS.md) and `docs/bob/x.md`. The refusal test fails without the entry. Also names `.bob/` in the two places that enumerate the list for readers, and re-wraps the user-guide paragraph the longer list left with a 13-column orphan. This holds whether or not `sbx up` ever writes Bob's configuration. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]>
Bob is the easy case, not another Codex. Verified against `bob` 0.0.32: `bob mcp add` defaults to `-s project` and writes `.bob/settings.json` in the repository, with a `mcpServers` map shaped like `.mcp.json`'s; it preserves unrelated keys on merge; and it reads `AGENTS.md`, which `up` already writes. So `up` merges into it like the other two — no launcher, no TOML, no new dependency. - `BOB_SETTINGS` / `BOB_SERVER` / `isBobServer`, mirroring the `.mcp.json` path: a `needObjects` + predicate conflict check, `setKey` when absent, the doc in the writes loop, and the nested-directory bookkeeping (generalised from the single `.claude` block to both nested files, so `rm` removes a `.bob/` it made). - `JSON_FILES` and `DIRS` gain the file and its directory. Without both, the record `up` writes is rejected as malformed by the next run. - `takeBackAgentConfig`'s `strict` set gains it: Bob reads plain JSON, not JSONC. - `checkAgentConfig` reports a missing server. No local-tools line, because there is nothing to check — see below. - `up`'s closing line now names Bob. **No deny list, deliberately.** Bob has no equivalent of Claude Code's `permissions.deny`: `--allowed-tools` waives the confirmation prompt rather than removing a tool, and while `excludedTools` appears in the binary I could not prove it is read from settings — Bob accepts unknown keys silently, so writing it would be configuration that looks applied and is not (#577's failure mode). The docs and SBX0 §6.3 therefore say plainly that Bob's local tools are restricted, not denied, and point at its own approval mode; `--yolo` is called out as the thing not to combine with a sandbox you care about. **The record is forward-only.** A manifest naming `.bob/settings.json` fails `manifestProblem`'s allow-list check in an older mocactl, which then refuses to run `up` and keeps the record on `rm`. Accepted at preview stage; the `cortex` field set the precedent. Tests: the server merged into an empty repository; a developer's own servers and `security` block preserved, and only our entry taken back; `.bob/` created and removed; `doctor`'s line before and after `up`; and two conflict cases (a foreign server under our name, a non-object `mcpServers`). Dropping the `setKey` fails 24. 1604 tests pass, tsc and prettier clean. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Summary
This adds .bob/ to pull --apply's refused AGENT_DIRS, which closes the same laptop-side MCP-command hole #592 closed for .codex/. It also has sbx up merge mcpServers.sandbox into .bob/settings.json through the existing merge/record/take-back machinery. The change follows the .mcp.json path one-for-one, and the tests cover merge-preserve, rm of a created .bob/, conflicts, doctor, and the folded/fullwidth refusal variants, with .bobrules as a negative. No blocking issues. The inline items are user-facing text that still says "Claude Code and OpenCode" now that doctor and up also cover Bob.
Author: mrsabath (MEMBER — maintainer)
Areas reviewed: TypeScript (mocactl sbx), tests, Docs
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: passing
Notes:
- Agreed that the forward-only manifest is acceptable for the SBX0 preview. It could get one line in the release notes.
- Repos set up with an older mocactl get a red doctor line for Bob until they re-run
up. Doctor's fix text already covers that. - +1 to one live
up→bob→pull --applypass before merge, as the PR body suggests.
| [IBM Bob](#ibm-bob) above. | ||
| - **Codex edits files on your laptop instead of in the sandbox**: check you started it with | ||
| `mocactl sbx codex` (or the `-c mcp_servers.sandbox=…` line), and that `/mcp` in the TUI lists | ||
| the `sandbox` tools. Note `mocactl sbx doctor`'s `agent config` check covers Claude Code and |
There was a problem hiding this comment.
suggestion: This is now wrong, because checkAgentConfig checks .bob/settings.json too (agent-config.ts:1406). Maybe: "covers Claude Code, OpenCode and IBM Bob (for Bob, only that the server is there)".
| } | ||
| // Bob only: it has no deny list to check, so there is no local-tools line for it. | ||
| if (!isBobServer(at(bob, ['mcpServers', SERVER]))) { | ||
| problems.push(`IBM Bob: ${BOB_SETTINGS} has no ${SERVER} MCP server (mocactl sbx mcp)`); |
There was a problem hiding this comment.
suggestion: When this check passes, doctor's success line (doctor.ts:243-246) still reads "Claude Code and OpenCode use the sandbox MCP server, with every local tool denied …", and user-guide.md:559 shows that output. Now that Bob is part of this check, name Bob there and say its local tools are not denied. Otherwise a green doctor suggests more containment for Bob than exists, which is the misreading the rest of this PR's docs work to prevent.
| @@ -1174,7 +1207,7 @@ export function takeBackAgentConfig(root: string): TakeBack { | |||
| // A record names a file after following links (target()), so a linked opencode.json is recorded | |||
| // as its target's path. Only Claude Code's two files are strict JSON: decide by resolving them. | |||
There was a problem hiding this comment.
nit: "Only Claude Code's two files are strict JSON" is stale now that BOB_SETTINGS is in the loop below.
| if (cortex) c.io.err(CORTEX_NOTE); | ||
| if (changed.length) { | ||
| c.io.err(`configured Claude Code and OpenCode: ${changed.join(', ')}`); | ||
| c.io.err(`configured Claude Code, OpenCode and IBM Bob: ${changed.join(', ')}`); |
There was a problem hiding this comment.
nit: mocactl sbx up help (cli.ts:74-77) and the agent-config.ts:32 module header still say "Claude Code and OpenCode", and the help's file list omits .bob/settings.json. Worth updating them in the same PR.
Review of #657, and a real gap: the PR said `.bobrules` "stays allowed like AGENTS.md", but `AGENTS.md` is allowed *with a warning* and `.bobrules` was allowed silently. PROMPT_FILES held only claude.md, agents.md and agents.override.md, so a pulled patch could rewrite Bob's steering file and nothing said so — the same channel the AGENTS.override.md entry closed for Codex (#592: "silently replaces the instructions an agent session reads"). Implementation now matches the stated intent rather than the other way round: `.bobrules` joins PROMPT_FILES. It is still applied, not refused — it is text, not an executable — but never silently. `sbx up` does not write `.bobrules`, so it holds no sbx block and `outsideBlock` returns the whole file: any change to it is all change, and is warned about whole. The test fails without the entry (`expected '' to match /\.bobrules/`). Both places that describe the warning now name it, and read as "a steering file" rather than listing Claude Code's two and Codex's one. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]>
|
Fixed in f505832. You are right, and the diagnosis is exactly right: the implementation contradicted the stated intent, so I changed the implementation rather than the claim.
The empty string is the point: there was no warning to match. One detail worth noting, since it differs from the other three: Both places that describe the warning now name it, and read as "a steering file — Verification: the suites this PR touches are green — One honest note on my local full-suite run: two React/ink overlay tests ( Thanks also for saying plainly which claims you could not verify yourself. Bob's behaviour here rests on my 0.0.32 measurements, and the one that matters most for this PR — that the real Bob reads what |
Follow-up to rossoctl#657's review: four places still read "Claude Code and OpenCode" after doctor and `up` grew Bob. Separate PR because rossoctl#657 merged before these were addressed. The one that mattered most is doctor's success line (`doctor.ts:243-246`). It claimed "every local tool denied" for a check that now includes Bob, whose local tools cannot be denied — so a green doctor implied more containment for Bob than exists, the exact misreading the rest of rossoctl#657's docs were written to prevent. It now names Bob and states the exception, in both the normal and Cortex wordings. Also: - `sbx up --help`: names Bob, lists `.bob/settings.json` among the merged files, and says Bob's local tools cannot be denied. - `agent-config.ts`'s module header: the same, so the file's opening claim matches what it writes. - The stale "Only Claude Code's two files are strict JSON" comment in `takeBackAgentConfig`, now that `BOB_SETTINGS` is in that loop: it reads "Only OpenCode's is JSONC; the rest are strict JSON", which stays true as agents are added. - The user guide: the `agent config` row in doctor's table, its sample output, and the Codex troubleshooting note that said the check "covers Claude Code and OpenCode only" — it covers Bob too, for the server's presence. The doctor test that pinned the old wording as one contiguous phrase now asserts its two halves plus the Bob exception, so it checks the meaning rather than the sentence. Suites touched: 196 passed (doctor, cli, agent-config); tsc and prettier clean; check-links 212 files, 0 broken. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Mariusz Sabath <[email protected]>
Summary
Adds IBM Bob (Bob-Shell) as a third agent
mocactl sbx upconfigures, and closes thepull --applyhole its config directory left open. Two commits, separable.Bob turned out to be the easy case, not another Codex. Measured against
bob0.0.32 before writing anything:bob mcp adddefaults to-s project, writing.bob/settings.json~/.codex/config.tomlonly{"mcpServers":{"sandbox":{"command","args"}}}—.mcp.json'ssecurityblock survived)AGENTS.md, whichupalready writesAGENTS.md, already writtenshell_toolyes,unified_execnoSo Bob belongs in
agent-config.tsbeside the other two rather than in a launcher:upmergesmcpServers.sandboxinto.bob/settings.jsonwith the existing JSON machinery. No launcher, no TOML parser, no new dependency.3f9bc8b—pull --applyrefuses.bob/(prerequisite)The same hole as
.codex/in #592..bob/settings.jsondeclares MCP servers with an arbitrarycommandandargsthat Bob launches on the laptop, and it was not refused:One
AGENT_DIRSentry. Tests cover the path, the folded.BOB/and fullwidth.BOB/variants, and the negatives. Note.bobrulesis a real Bob file but a prompt file — text, not an executable — so it stays allowed likeAGENTS.md, with a test pinning that.Stands on its own merits whether or not
upever writes Bob's config, so it can be split out if you prefer.ba3efbd—upconfigures BobMirrors the
.mcp.jsonpath exactly, so the module's invariants (merge-never-overwrite, read-everything-before-writing, record-exactly-what-was-added) come for free:BOB_SETTINGS/BOB_SERVER/isBobServer, aneedObjects+ predicate conflict check,setKeywhen absent, the doc in the writes loop,JSON_FILES+DIRS, thestrictset intakeBackAgentConfig(Bob reads plain JSON, not JSONC), and acheckAgentConfigline.up's closing line now names Bob.The nested-directory bookkeeping is generalised from the single
.claudeblock to a loop over both nested files, sormremoves a.bob/thatupcreated.Two things worth review attention
No deny list, deliberately. Bob has no equivalent of Claude Code's
permissions.deny.--allowed-toolswaives the confirmation prompt rather than removing a tool (allowedTools.includes(toolName)in the binary).excludedToolsdoes appear in the binary, but I could not prove it is read from settings, and Bob accepts unknown settings keys silently — so writing it would be configuration that looks applied and is not, which is exactly #577's failure mode. The docs and SBX0 §6.3 therefore say plainly that Bob's local tools are restricted, not denied, point at Bob's own approval mode, and call out--yoloas the thing not to combine with a sandbox you care about. If someone can confirmexcludedToolsupstream, that becomes a follow-up worth taking — it would give Bob real parity with Claude Code.The manifest record becomes forward-only. A
.sbx/agent-config.jsonnaming.bob/settings.jsonfailsmanifestProblem's allow-list check in an oldermocactl, which then refuses to runup(agent-config.ts:951) and keeps the record onrm. Flagging rather than working around it: thecortexfield set the precedent, and SBX0 is preview with an internal cohort. RelaxingmanifestProblemto ignore unknown files would be a broader change affecting all agents, and is out of scope here.Verification
Unit: 1604 passed, 4 skipped (6 new Bob cases),
tsc --noEmitclean, prettier clean,check-links212 files / 0 broken. Removing thesetKeyfails 24 tests; removing theAGENT_DIRSentry fails the refusal test.The integration point, checked against the real CLI rather than only in tests — the actual
writeAgentConfigwrote the file, then real Bob read it back:Bob found and parsed the entry;
Disconnectedis expected in that environment becausemocactlwas not on itsPATH.Not verified: a live end-to-end run —
upinto a real sandbox, thenbobfixing the demo's failing test andpull --applybringing it back. The environment I developed in hasbobbut nomocactlonPATHand no sandbox credentials. Worth one real pass before merge, especially since Bob's containment is weaker than Claude Code's, so "does it actually route through the sandbox" is the question that matters most.Checklist
git commit -s).make lint— not run;pre-commitis unavailable in my environment. Package tests,tscand prettier pass; CI'slintjob is the backstop.docs/sbx/user-guide.md§3, the.bob/settings.jsonrow in §4's table,.bob/in thepull --applyparagraph, a troubleshooting entry, and SBX0 §6.3 + §10.3.make check-linkspasses.