Conversation
The CLI grew `sandbox desktop` and `sandbox computer`, so the REST layer this driver carried for them has no reason to exist. Delete api(), api_auth(), api_check() and desktop_wait(), and shell out like every other verb. That layer was the one place cos bypassed the CLI, and the cost of it was a second implementation of things the CLI already knew: its own auth precedence, its own error-code map, its own readiness poll. It also held a false premise — a comment claiming the CLI does not read CREATEOS_API_KEY, which it has (cmd/root/root.go). The same code now serves pi, opencode and herdr, which could not do computer-use at all. cos keeps what the CLI cannot know: which box belongs to this project, and creating one on a desktop image when there is none. The rootfs guard stays too, because the CLI tells you to create a new sandbox, and for a project box the fix is to replace the one you have. Two details preserved for callers: - `cos computer screenshot -o file` still works. The CLI spells it --out, since -o is its global output-format flag, so cos translates. - `cos resume` now says to re-run `cos desktop` on a box that had one. A resumed desktop answers reads before its input stack is back, so a click can 409 for a moment after the screen route already succeeds. Requires a createos CLI carrying those commands. cos probes for them and tells the user to upgrade rather than failing with "unknown command". Blocked on NodeOps-app/createos-cli#94.
pratikbin
force-pushed
the
feat/cos-delegate-computer-to-cli
branch
from
September 16, 2026 08:15
84c14ca to
d20d764
Compare
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.
What
Deletes the REST layer
coscarried fordesktopandcomputer, and shells out tocreateos sandbox desktop/createos sandbox computerlike every other verb.-387 / +103. Gone:
api(),api_auth(),api_check(),desktop_wait().Why
That layer was the single place
cosbypassed the CLI, and it cost a second implementation of things the CLI already knew — its own auth precedence, its own error-code map, its own readiness poll. It also carried a false premise: a comment asserting the CLI does not readCREATEOS_API_KEY, which it has all along (cmd/root/root.go:77). The auth fallback ordering rested on that.The same code now serves
pi-extension,opencode-pluginandherdr-plugin, which could not do computer-use at all, because they only shell out. This is ADR-0001's direction: fold the engine into the CLI, keep the plugin thin.What stays in
cosOnly what the CLI cannot know:
desktop:1when there is none. The CLI is stateless by design.cos down && cos desktop.Compatibility
cos computer screenshot -o filestill works. The CLI spells it--out, because-ois its global output-format flag, socostranslates rather than breaking callers.cosprobes forsandbox computerand tells the user to upgrade, instead of failing with a bare "unknown command".scripts/sync-shared.sh;--checkpasses (9 copies in sync).One behavior found while testing
cos resumenow prints a hint to re-runcos desktopon a box that had one. A resumed desktop answers reads (screen,screenshot) before its input stack is back, soclickandmovereturn409 desktop_unavailablefor a moment after the readiness probe already succeeds. Confirmed server-side:computer raw POST mouse/clickwith a hand-written body failed identically whilecursorreturned correct coordinates, and everything passed on retry.This means
/computer/screenis not a sufficient readiness probe after a resume. Worth a follow-up on thefcside; the hint is the cheap mitigation.Verification
Ran end-to-end against a live box with the CLI from #94 (
COS_CLI=), then destroyed it:cos desktopcreated thedesktop:1project box and returned a working noVNC URL with expirycomputer screen1280×800,open,key ctrl l,type(multi-word joined correctly),click,screenshotvia the legacy-o(48.9 KB written)sandbox computerproduced the upgrade message, not a stack tracebash -nclean on both copiesDocs updated
SKILL.mdPattern D rewritten: says both verbs are CLI wrappers, points atcreateos sandbox computer --helpfor unwrapped ops (clipboard, window manipulation, screen resize), notes a box addressed by name needs no project state, and warns that an old CLI has nosandbox computer.README.md: the note claiming these are the only verbs calling REST directly is now accurate.