Repository navigation
fix(copilot): update Copilot SDK to 1.0.26 while keeping isolated turns remote-denied - #189703
roboclaw-bot wants to merge 7 commits into
Conversation
Update @github/copilot-sdk 1.0.25 -> 1.0.26 (bundled Copilot CLI 1.0.103). 1.0.26 removed the create/resume remoteSession option, so isolated completions and settled-tool finalization now call session.rpc.remote.disable() before sending and fail closed when the deny cannot be applied. Co-authored-by: steipete <[email protected]>
…ns remote-denied Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: f0ab68bd-4544-4dea-94a4-a971b701990a
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
Race the pre-send session.rpc.remote.disable() in settled-tool finalization against the run's abort signal so a wedged deny cannot hold the attempt; the existing finally path disconnects the session and releases the pool handle. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 211ae6b3-abb4-4794-832b-b7a9dc377743
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: f22d261c-c785-450a-8425-a920f4dab66e
SDK 1.0.26 tries session.sendAndWait first and falls back to session.send only on JSON-RPC MethodNotFound (-32601). The catalog-lifetime fault peer answered every unknown method with -32603, so the real SDK never reached session.send and the lifecycle test hung. Return -32601 for unsupported methods and assert the exact unsupported set so a newly required RPC cannot silently pass as optional. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: a8a2382a-2d36-43bb-827f-6b1e1c3dc010
Warning
Security gate open, not ready to land. SDK 1.0.26 has no supported way to deny remote export and steering per session before create or resume. If an operator's runtime is launched with remote enabled by default, the runtime enters remote setup inside
resumeSession, before the post-resume deny in this PR can run. The details and options are under "Security gate" below. A maintainer decision, or an authorized credential to probe the authenticated case, is required before merge.What Problem This Solves
Fixes: the Copilot plugin is stuck on
@github/copilot-sdk1.0.25 because 1.0.26 removed theremoteSession: "off"session option OpenClaw used to keep isolated turns (isolated completions and settled-tool finalization) out of Mission Control export and remote steering.User Impact
User impact: Copilot runtime users get SDK 1.0.26 / bundled Copilot CLI 1.0.103. With OpenClaw's default runtime launch, isolated Copilot turns keep remote export and steering off from create/resume through the prompt. If the deny RPC fails, or wedges until the run is cancelled, the isolated turn fails before any prompt reaches the model. Ordinary Copilot turns are unchanged: they never pinned remote off. Operator runtimes launched with remote enabled by default are not equivalently protected yet (see the Security gate).
Why This Change Was Made
Version change:
@github/copilot-sdk1.0.25 → 1.0.26, plus its 8 platform packages, inextensions/copilot/package.jsonandpnpm-lock.yaml. 1.0.26 is the newest release outside the repo's 7-dayminimumReleaseAge(published 2026-10-22T16:38Z). 1.0.27 (2026-10-27) and 1.0.28 (2026-10-28) are still inside that window.Upstream highlights:
f2b720c8ecandf527e6134f(SDK snapshot for CLI 1.0.103).docs/features/remote-sessions.mdnow describes remote sessions as read-only history export, not remote control. TheenableRemoteSessionsclient option and the create/resumeremoteSessionoption are gone; the 1.0.26 client no longer sends either.session.rpc.remote.enable/disableandsession.remote_steerable_changedremain. The generated RPC contract documentsremote.disableas "Disables remote session export and steering."session.sendAndWaitnow first tries a newsession.sendAndWaitcompletion RPC. It falls back tosession.sendonly when the runtime answers JSON-RPC MethodNotFound (-32601).allowCreatingNewSessions(denied by default),host.setSessionCreationPolicyand host authentication. OpenClaw does not use them.The change: right after create or resume, and before the first send, isolated completions and settled-tool finalization call
session.rpc.remote.disable(). If that method is missing or rejects, the turn fails closed. In isolated completions the call runs inside the existing completion deadline and cancellation boundary. In settled finalization it is raced against the run's abort signal. In both paths the existing cleanup disconnects the session and releases the pooled client. The catalog-lifetime fault peer now answers unsupported RPCs with MethodNotFound, as a real runtime does, so the SDK's fallback is exercised. It also asserts the exact unsupported set.Security gate
All probes below ran on the real bundled runtime with a temp home, an isolated synthetic session, a BYOK synthetic provider and no GitHub auth.
--remotelauncher flag. This flag is the only default source I found: theremoteSessionssetting had no effect in five config locations. The bundledcopilot-runtimeaccepts--remote,--no-remoteand--no-remote-export, and rejects unknown flags."on", and resume completes normally. With this launch, nothing remote happens before the disable call.--remote(for example an operatorCOPILOT_CLI_PATHwrapper):remoteSession: "off"kept create and resume off, and resume completed in about 12 s.remoteSteerable: trueand resume of a persisted session blocks inside the runtime for more than 180 s, before the post-resumeremote.disable()can run.--no-remotedid not override an explicit"on"on 1.0.25. I did not check whether it can override a--remotedefault.RuntimeConnection.forStdio({ path: <packaged copilot-runtime>, args: [] }), so they always start with remote off. This changes behavior for operators whoseCOPILOT_CLI_PATHor default-connection overrides currently also apply to isolated turns.--remoteruntime exports or accepts steering before the deny.Holds:
minimumReleaseAgeat the audit time (2026-10-31T16:54Z, cutoff 2026-10-24T16:54Z).Evidence
harness.detached.integration.test.ts, real SDK 1.0.26 runtime, synthetic provider endpoint):["remote.disable", "provider", "disconnect"], andsession.start.remoteSteerableisfalse.disconnect, and no request reaches the provider.expected [ 'provider' ] to deeply equal [ 'remote.disable', 'provider' ]andpromise resolved … instead of rejecting. Red before the abort bound: the wedged-deny test times out (120 s). Green with the fix: 8/8 in the file.catalog-lifetime.test.ts(ClawSweeper P2 onc8137c9):session.sendAndWaitwith -32603, so the SDK never fell back tosession.send.expect(peer.unsupported).toEqual(["session.sendAndWait"]).node scripts/run-vitest.mjs extensions/copilot/harness.detached.integration.test.ts extensions/copilot/harness.test.ts extensions/copilot/src/attempt.test.ts: 51/51 and 89/89 pass.OPENCLAW_COPILOT_AGENT_LIVE_TEST=1 pnpm test:live -- extensions/copilot/src/attempt.live.test.ts, OpenAI BYOK, real model, unchanged test blob3e9bcbe). Both runs give the same result:extensions/copilottree488ad1d(base1df5510), SDK 1.0.25.42005bc(597dd2d), SDK 1.0.26.attempt.live.test.ts:460, before finalization. The model reachedlive_echothrough OpenClaw'stool_search/dispatch_action, and the test expects the direct tool name. The same failure on 1.0.25 shows this assertion fails regardless of this change. A model-routing effect is not ruled out.pnpm tsgo:extensionsandpnpm tsgo:extensions:testpass. oxlint and oxfmt on the changed files pass, as dopnpm check:line-cap-ratchetandgit diff --check.pnpm install --lockfile-only, thenpnpm install --frozen-lockfile, exit 0. The diff touches only the 9 copilot-sdk entries, and their integrity matches the npm registry.1df5510, max priority P2, with full changed files, unchanged runtime/pool/harness context and the runtime evidence above): 1 finding, "patch is incorrect (0.95)". It confirmed the fault-peer repair. The P2 is the security gate above, which needs a maintainer decision.Requested and guided by @steipete.
Work sessions
Worked on by