Skip to content

Fix #236: a refused computer setup fails the bootstrap with its own error - #241

Merged
SSFSKIM merged 3 commits into
mainfrom
fix/236-sky-then
Nov 1, 2026
Merged

SSFSKIM merged 3 commits into
mainfrom
fix/236-sky-then

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #236

When the computer surface's Sky setup is refused (a broken install, a missing service, a trusted RPC failing at setup), the first cell now fails with the setup's own error. Before, the bootstrap never settled. In the own kernel it was worse: the rejection went unhandled, and the kernel reset with "node_repl kernel unhandled rejection: …". The new kernel test reproduced exactly that on main.

Cause. After a failed setup, the vendor-ported proxy in src/cua-api/sky.mjs answered every member it did not have, then included, with a function that rejects with the setup error. That made the proxy look like a promise. create-tinysky-alt.mjs's loadComputer is an async function that returns the proxy, so returning it called the fake then. That then never resolved or rejected the outer promise, and the rejected promise it returned had no handler.

Fix.

  • The proxy now returns undefined for then, toJSON and every symbol-keyed member: the members JavaScript reads on its own, without the agent asking for them. Any other missing member still returns the rejecting function, so cua.computer.click() after a failed setup still rejects with the setup error.
  • sky.mjs exports setupError, and loadComputer throws it. Fixing then alone is not enough: the bootstrap's next step would fail on the undefined target with UnreachableCaseError instead of the setup's sentence.
  • What changes for users: with the computer surface on, a refused setup fails every cell in that kernel with the setup's sentence, including the browser surface. A resolved setup behaves as before.
  • This is a deliberate difference from the vendor's sky.js. It is declared in test/cua-api/sky.test.mjs's vendor differential (a differs field, as facade-vendor.test.mjs uses) and in the own-host spec's Decision Log.

Tests (written first; they failed on main).

  • sky.test.mjs: after a failed setup, then, toJSON and the symbols read undefined while click is still a function. A separate own-only test checks that a promise resolved with the proxy settles and leaves no unhandled rejection.
  • bootstrap-kernel.test.mjs: the full bootstrap in a real own kernel, with surfaces computer and browser,computer. Each cell fails with sky helper unavailable and the kernel does not reset.
  • Local runs (Node 26 as CUA_NODE, vendor differential on): test/cua-api/* 127 passed, 0 failed (31 skips are the browser-client differential and zod). The parity inventory, capability-api and services-sky suites: 59 passed. The ticket's repro now prints {"state":"resolved","unhandled":[]}.

The plugin goes to 0.20.1 (plugin.json and marketplace.json), in separate commits, following #148's patch bump for a runtime fix.

Review and CI. doperpowers:reviewer-medium on 7a24390..c386ee4: "correct", no findings. ci-gate on c386ee4: GREEN (test, plugin, sandbox-live), https://github.com/SSFSKIM/cua/actions/runs/41256497726

Sminos-Session: cursor235#b93055dd (cua on macbook)

…rror

The Sky facade's proxy answered every unadvertised member after a failed
setup with a function rejecting with it, then included, so the bootstrap's
loadComputer (an async function returning the proxy) never settled, and in
the own kernel the synthetic then's rejection went unhandled and reset the
kernel. The proxy now reads then, toJSON and every symbol as undefined, and
exports setupError, which loadComputer throws: the first cell fails with
the setup's own sentence instead of an unknown target. A declared
difference from the vendor's sky.js, recorded in the own-host spec's
Decision Log and in sky.test.mjs's vendor differential.

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-01T00:34:49.418299Z
We couldn’t complete this review. Comment @codex review to try again.
c386ee4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@SSFSKIM
SSFSKIM merged commit de827b4 into main Nov 1, 2026
5 checks passed
SSFSKIM added a commit that referenced this pull request Nov 1, 2026
Brings main's #235 (cua's own macOS agent cursor, #240), #236's fix
(#241), #200 (#243) and #244 (#247) under M3, so M3's gate judges the
tree that ships. A merge, not a rebase: the spec and the evidence cite
this branch's commit SHAs.

The overlapping files and how each was resolved:
- src/runtime/launch.mjs (conflict): both sides kept. M3's Linux branch
  (cua's own service: CUA_SKY_SERVICE, CUA_ENGINE_BIN and
  CUA_DESKTOP_MODE for the cua selection, the vendor service and helper
  otherwise) beside #240's macOS branch, which adds the agent cursor's
  environment (cursorEnv) to cua's engine. The env header comment merged
  cleanly with both sides' entries.
- src/runtime/doctor-engine.mjs (auto-merged): #240's macOS row (the
  cursor switch in factsReport, cursorWords, settingsOf's cursor check)
  and M3's Linux row (service cua, capabilities, the IsEnabled row)
  touch separate functions; kept as merged.
- src/cua-api/sky.mjs and test/cua-api/sky.test.mjs (auto-merged):
  #241's fix for #236 (setupError exported, then/toJSON/symbols read
  undefined after a failed setup, the declared vendor difference and
  its settle test) beside M3.2's truncated-field scenario. Compatible
  by design: cua's Linux service's setup always resolves with the 20
  methods and keeps a failure for each method to refuse with, so the
  facade's setupError stays unset there; a setup that does throw now
  fails the bootstrap with its own error instead of hanging.
- tech-debt-tracker.md (conflict): every row from both sides kept,
  main's five newer rows first (74 at the base, +2 M3, +6 main = 82).
- .claude-plugin/plugin.json, marketplace.json (conflict): main's
  0.20.3 here; M3's own bump follows in its own commit.

Focused suites (services, facade, doctor, selection, harness, accept,
cursor) on the merged tree: 1948 pass, 8 fail; the same 8 fail on both
parents in this VM (umask 077 modes, macOS-only and env tests).

Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Facade: a rejected computer setup leaves bootstrap pending forever (the sky proxy answers 'then')

1 participant