πΎ Open Computer Use β Open-Source Alternative to Codex Computer Use
[2026-09-21 21:00] | Task: Add JS REPL Computer Use
π€ Execution Context
- Agent ID:
TRAE CLI - Base Model:
GPT-5.4 - Runtime:
local macOS repository workspace
π₯ User Query
Review the community PRs and the bundled official Computer Use plugin, determine how its JavaScript REPL works, and add JS REPL support to Open Computer Use.
π Changes Overview
Scope: Codex plugin transport, Node.js adapter, native MCP bridge, tests, and repository documentation.
Key Actions:
- Official runtime investigation: Verified that the inspected official bundle uses a host-provided
node_repland instructs the model to import its asynchronous@oai/skypackage. - Persistent REPL: Added a Node.js REPL with top-level await, persistent bindings, explicit text/image output, reset, and a worker timeout boundary.
- Native bridge: Adapted the existing native 9-tool MCP server into an asynchronous
cua.getApp(...)API without duplicating the platform automation implementations. - Compatibility: Switched the Codex plugin to
js/js_resetwhile preservingopen-computer-use mcpas the existing native compatibility surface. - Packaging and docs: Included the REPL files in local/plugin npm installation and documented architecture, security, reliability, and usage.
- Lifecycle hardening: Isolated model code in a Worker, capped execution at five minutes, reset the kernel after timeouts, made shutdown idempotent, and verified copied/symlinked adapter entrypoints.
- Installer correction: Flattened the plugin source into the versioned Codex cache root (matching Codex's cache layout) before adding the native payload and REPL scripts.
- Protocol normalization: Converted the native human-readable macOS/Linux/Windows app catalog into a stable structured array for
cua.listApps(). - Concurrency and failure isolation: Serialized direct Worker callers, converted invalid source input into structured errors, and let the outer JS timeout remain the single deadline for native calls so timeout recovery cannot leave a second timer behind.
π§ Design Intent (Why)
The main value of a code tool is not another spelling of the same actions. It is the ability to keep deterministic sequencing, intermediate state, branching, retry, and final observation inside one tool round trip. The implementation therefore follows the official asynchronous Node orchestration direction while providing a small app-bound API, rather than merging the synchronous JavaScriptCore prototype from PR #75.
π Files Modified
scripts/node-repl/open-computer-use-repl.mjsscripts/node-repl/open-computer-use-kernel.mjsscripts/node-repl/open-computer-use-repl.test.mjsplugins/open-computer-use/.mcp.jsonplugins/open-computer-use/scripts/launch-open-computer-use-repl.shscripts/install-codex-plugin.shscripts/npm/build-packages.mjsdocs/references/js-repl.mddocs/ARCHITECTURE.mddocs/SECURITY.mddocs/RELIABILITY.md
β Validation
node --test scripts/node-repl/open-computer-use-repl.test.mjsβ 12/12 passed locally and on Linux devbox with Node 22.swift testβ 167 tests, 0 failures, 1 opt-in live test skipped.- Linux and Windows
go test ./...; Linux Python runtime tests β passed. ./scripts/run-tool-smoke-tests.shβ native 9-tool and cursor-idle smoke passed.- npm staging,
npm pack --dry-run --json, isolated Codex plugin install, and staged/installedtools/listprobes β passed and exposed onlyjs/js_reset. - Real macOS native bridge probe verified structured
cua.listApps(), binding persistence, CPU timeout recovery, andjs_reset. Linux devbox verified the same REPL lifecycle and native bridge with Node 22; after installing its missing AT-SPI introspection package, the headless SSH session correctly returned a structured empty app array. make check-docs, shell/Node syntax checks, action pinning, andgit diff --checkβ passed. Fullscripts/ci.shremains blocked only by pre-existing repository-hygiene files absent from this checkout, unrelated to this change.