Repository navigation
Description
Problem
If the computer surface's setup is rejected, the facade's bootstrap never settles. The session's start hangs, and Node reports an unhandled rejection. The agent never gets the setup error. A broken install, a missing service or a failed trusted RPC should produce one clear error; instead the session start hangs.
Found by #171 M3.2's task review (session linux171) while making the Linux service's setup always resolve. Linux no longer reaches it (M3.2's setup resolves and refuses per method). macOS still does.
Cause
src/cua-api/sky.mjs:27-33: the sky proxy's get answers every member that is not on the client with () => Promise.reject(setupError) once setupError is set, and that includes then. src/cua-api/create-tinysky-alt.mjs:100-103: async function loadComputer returns sky. Resolving an async function's promise with a value that has a then function calls then(resolve, reject). The synthetic then ignores both arguments and returns a rejected promise, so the outer promise never settles, and the rejection it returns is unhandled. The vendor's sky.js has the same code.
On macOS, the engine service's own setup is synchronous and does no I/O, so it cannot throw. The defect is reached when the wrapper fails at setup: CUA_SKY_SERVICE unset, its module failing to import, or the trusted RPC failing at setup.
Reproduction
Script outside the repository (~/.local/share/cua-171/repro/sky-then-hang.mjs on the MacBook):
globalThis.nodeRepl = {rpc: async () => { throw new Error('setup refused (repro)'); }};
const unhandled = [];
process.on('unhandledRejection', (e) => unhandled.push(String(e?.message ?? e)));
const {sky} = await import(process.argv[2] + '/src/cua-api/sky.mjs');
let state = 'pending';
(async () => sky)().then(() => { state = 'resolved'; }, (e) => { state = 'rejected: ' + e.message; });
setTimeout(() => { console.log(JSON.stringify({after_ms: 1000, state, unhandled})); process.exit(0); }, 1000);node sky-then-hang.mjs <checkout> on main (2026-10-31) prints {"after_ms":1000,"state":"pending","unhandled":["setup refused (repro)"]}. linux171's version through the full facade bootstrap on the #171 VM prints {"after_ms":1000,"bootstrap":"pending","unhandled":["setup refused (mac)"]}.
Fix
The proxy must not be thenable: get returns undefined for then (and the descriptor and has traps agree), so a rejected setup rejects bootstrap with its own sentence. This is a deliberate difference from the vendor's facade: declare it where the facade's vendor differential lists differences.
Acceptance
- A rejected
setupmakes bootstrap reject within one turn with the setup error's message, with no unhandled rejection: a facade test with a rejectingnodeRepl.rpc, and the full-bootstrap path. - A resolved
setupbehaves as today (the existing facade suites pass unchanged). - The vendor differential records the difference as declared.
Activity
Fix #236: a refused computer setup fails the bootstrap with its own e…
Plugin 0.20.1: #236's bootstrap fix
SSFSKIM commentedon Nov 1, 2026
[board] done: Merged in #241 (de827b4), main tree = the gated head tree; plugin 0.20.1
#171 M3: merge origin/main (f1bc48e, plugin 0.20.3) into feat/171-m3