Skip to content

fix(copilot): update Copilot SDK to 1.0.26 while keeping isolated turns remote-denied - #189703

Open
roboclaw-bot wants to merge 7 commits into
mainfrom
openclaw/mig-copilot-sdk-1026
Open

roboclaw-bot wants to merge 7 commits into
mainfrom
openclaw/mig-copilot-sdk-1026

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

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-sdk 1.0.25 because 1.0.26 removed the remoteSession: "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-sdk 1.0.25 → 1.0.26, plus its 8 platform packages, in extensions/copilot/package.json and pnpm-lock.yaml. 1.0.26 is the newest release outside the repo's 7-day minimumReleaseAge (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:

  • v1.0.26 release: "Updated the bundled Copilot CLI snapshot to 1.0.103". Compare v1.0.25...v1.0.26: f2b720c8ec and f527e6134f (SDK snapshot for CLI 1.0.103).
  • docs/features/remote-sessions.md now describes remote sessions as read-only history export, not remote control. The enableRemoteSessions client option and the create/resume remoteSession option are gone; the 1.0.26 client no longer sends either. session.rpc.remote.enable/disable and session.remote_steerable_changed remain. The generated RPC contract documents remote.disable as "Disables remote session export and steering."
  • session.sendAndWait now first tries a new session.sendAndWait completion RPC. It falls back to session.send only when the runtime answers JSON-RPC MethodNotFound (-32601).
  • New host APIs: allowCreatingNewSessions (denied by default), host.setSessionCreationPolicy and 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.

  • How the runtime decides. Remote mode at create/resume is computed in the runtime with no auth input. An explicit per-session request wins, and otherwise the runtime falls back to its launch default, set by the --remote launcher flag. This flag is the only default source I found: the remoteSessions setting had no effect in five config locations. The bundled copilot-runtime accepts --remote, --no-remote and --no-remote-export, and rejects unknown flags.
  • OpenClaw's default launch (bundled runtime, no connection args) resolves remote off at create and at resume. That includes resuming a session first created with "on", and resume completes normally. With this launch, nothing remote happens before the disable call.
  • Runtime launched with --remote (for example an operator COPILOT_CLI_PATH wrapper):
    • On 1.0.25, remoteSession: "off" kept create and resume off, and resume completed in about 12 s.
    • On 1.0.26 (and on 1.0.25 with the option omitted), create reports remoteSteerable: true and resume of a persisted session blocks inside the runtime for more than 180 s, before the post-resume remote.disable() can run.
    • With auth, remote export or steering could begin inside that resume. That would be a regression against the 1.0.25 per-session contract. Fresh local review rates it P2: "Enforce remote denial before resuming isolated sessions".
  • No supported per-session pre-create/resume deny exists in 1.0.26. --no-remote did not override an explicit "on" on 1.0.25. I did not check whether it can override a --remote default.
  • Options for a maintainer decision:
    1. Launch isolated and finalization clients through the public RuntimeConnection.forStdio({ path: <packaged copilot-runtime>, args: [] }), so they always start with remote off. This changes behavior for operators whose COPILOT_CLI_PATH or default-connection overrides currently also apply to isolated turns.
    2. Reject isolated turns on non-packaged runtime launches before create/resume. This also removes a currently supported operator configuration for isolated turns.
    3. Hold the bump until upstream provides a per-session pre-create/resume deny.
    4. With an explicitly authorized GitHub credential that has Copilot remote-session access, run the authenticated probe (synthetic history only) to check whether a --remote runtime exports or accepts steering before the deny.

Holds:

  • Not taking 1.0.27/1.0.28: they are still inside the strict 7-day minimumReleaseAge at the audit time (2026-10-31T16:54Z, cutoff 2026-10-24T16:54Z).
  • Settled finalization has no pre-send deadline of its own. A wedged deny is bounded by the run's abort signal, as the existing resume call already is.
  • No change to ordinary (non-isolated) attempts.
  • Each isolated turn makes one extra RPC round trip before its first send.

Evidence

  • Real-runtime integration (harness.detached.integration.test.ts, real SDK 1.0.26 runtime, synthetic provider endpoint):
    • Isolated completion and settled finalization record ["remote.disable", "provider", "disconnect"], and session.start.remoteSteerable is false.
    • When disable rejects, both turns fail with only disconnect, and no request reaches the provider.
    • When disable never settles, isolated completion fails at its 200 ms deadline and settled finalization fails on abort. Both disconnect, and no provider request is made.
    • Red with the deny wiring removed: expected [ 'provider' ] to deeply equal [ 'remote.disable', 'provider' ] and promise 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 on c8137c9):
    • Red on the candidate: test timed out at 120 s with session-controller cleanup still pending. The fault peer answered session.sendAndWait with -32603, so the SDK never fell back to session.send.
    • Green after the peer repair: 1/1 in 1.7 s with every existing lifecycle assertion (session.error → detach → Code Mode cancellation → host closure), plus 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.
  • Live smoke, attribution only (OPENCLAW_COPILOT_AGENT_LIVE_TEST=1 pnpm test:live -- extensions/copilot/src/attempt.live.test.ts, OpenAI BYOK, real model, unchanged test blob 3e9bcbe). Both runs give the same result:
    • Baseline: extensions/copilot tree 488ad1d (base 1df5510), SDK 1.0.25.
    • Candidate: tree 42005bc (597dd2d), SDK 1.0.26.
    • "delegates user-followed deliverable work through a visible OpenClaw session" passes.
    • "uses one custom tool, then resumes with an isolated finalization turn" fails at attempt.live.test.ts:460, before finalization. The model reached live_echo through OpenClaw's tool_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.
    • The live finalization phase is not exercised by the unchanged test.
  • pnpm tsgo:extensions and pnpm tsgo:extensions:test pass. oxlint and oxfmt on the changed files pass, as do pnpm check:line-cap-ratchet and git diff --check.
  • Lockfile: pnpm install --lockfile-only, then pnpm install --frozen-lockfile, exit 0. The diff touches only the 9 copilot-sdk entries, and their integrity matches the npm registry.
  • Local autoreview (codex gpt-6.1-sol, branch mode against base 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.
  • Follow-up (not in this PR): the live smoke's first-phase predicate against tool-catalog dispatch.

Requested and guided by @steipete.

Work sessions

Worked on by

roboclaw-bot and others added 2 commits October 31, 2026 19:05
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
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: d52056d6d256da9496a769b99de830b010c76891
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These dependency graph changes were made:

  • pnpm-lock.yaml
  • extensions/copilot/package.json

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head c8137c901c95b6edceba9d5d927d29aec83b4eeb, but the PR head is now d52056d6d256da9496a769b99de830b010c76891. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-10-31T19:45:11.531Z sha c8137c9 :: needs real behavior proof before merge. :: [P2] Update the protocol peer for the SDK's new completion RPC

roboclaw-bot and others added 5 commits October 31, 2026 20:06
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
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files extensions: copilot P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant