Skip to content

fix(copilot): honor configured Fusion tiers - #205907

Merged
vincentkoc merged 4 commits into
mainfrom
fix/copilot-fusion-sdk-support-20261126
Nov 26, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/copilot-fusion-sdk-support-20261126

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Related: #205897

What Problem This Solves

Copilot Fusion selections lose their configured tier when OpenClaw creates or resumes an SDK session. The pinned SDK also predates the Fusion session option.

User Impact

Users can set params.fusionTier to standard, high, or max for github-copilot/fusion. Changing the tier starts a compatible fresh session. Ordinary turns, isolated completions, and settled-turn finalization use the same selection.

Why This Change Was Made

Upgrade the existing SDK package to 1.0.34 and use its capi.fusionTier contract. Keep tier resolution in one helper shared by session configuration and reuse keys. The new SDK replaces remoteSession with a session RPC, so restricted paths await remote-export disabling before sending a prompt.

Evidence

  • The Fusion regression fails on the pinned base for all three tiers.
  • All 11 focused Fusion and remote-export regressions pass, including create/resume, tier changes, isolated completion, and finalization timeout.
  • Independent local reviews found no actionable defect in the SDK change and subsequent fixture corrections.
  • Public-entrypoint package typecheck passes.
  • Targeted lint reports zero errors (one file-length warning); formatting passes.
  • All 16 prompt-stability tests pass.
  • Live Fusion standard, high, and max each executed the custom tool through Tool Search, returned complete dispatch metadata, resumed the session, and completed restricted finalization with no further tool calls.
  • A real isolated Gateway returned the expected answer for github-copilot/fusion through the Copilot harness and reported usage. Its process and temporary state were cleaned up.
  • An earlier local run timed out during finalization. Subsequent instrumented runs passed after fixing caller-owned pool cleanup; they do not establish that the leak was the sole cause of the earlier timeout. Live proof used this PR's session/tier implementation alongside separate, pending catalog/side-question changes.
  • SDK fixture incompatibilities (read-only session identity and the new completion RPC) and the cancellation assertion are corrected. The 49-test Copilot harness suite passes after these corrections.
  • Live smoke now disposes its caller-owned client pools. The previously leaked pools could keep SDK clients alive after a failed test.
  • Draft qualification CI passed: https://github.com/openclaw/openclaw/actions/runs/45825906277. The normal PR run also passed: https://github.com/openclaw/openclaw/actions/runs/45827102909.

@vincentkoc vincentkoc self-assigned this Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: copilot size: M labels Nov 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR upgrades the Copilot SDK and preserves configured Fusion tiers across session creation, reuse, isolated completion, and finalization.

Example: An agent selects github-copilot/fusion with params.fusionTier set to high.

  • Before: Session configuration omits the tier, and session compatibility does not distinguish it.
  • After: Session configuration sends capi.fusionTier=high, and switching to max starts a fresh session.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful, focused implementation with incomplete required behavior proof and three concrete compatibility-test failures.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: Users selecting a Fusion routing tier cannot preserve that selection through the Copilot SDK runtime.
Reason: The maintainer-authored direction has clear value, and Related appropriately describes its narrower scope within the linked request.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this maintainer-authored PR adds useful Fusion tier support, but three diff-caused test failures block readiness.

Reviewed head: fcf8ed53371bde8122a593a07c020115cc33c9df

Before merge

  • Construct session probes without assigning getter-only sessionId (P2) - SDK 1.0.34 changes CopilotSession.sessionId from an instance field to an inherited getter without a setter. createProbeSession still uses Object.assign on Object.create(CopilotSession.prototype), so assigning this property throws before the probe can send anything. Exact-head CI confirms all three tool-policy handoff rows fail with the readonly-property error. Update the probe construction for the upgraded SDK while preserving its create/resume and filesystem assertions.
  • Return MethodNotFound for the unsupported completion RPC (P2) - SDK 1.0.34 first calls session.sendAndWait and falls back to session.send only on JSON-RPC MethodNotFound (-32601). This peer supports only session.send and answers unknown methods with -32603. The upgraded client therefore fails before resolving peer.sent, leaving catalog-lifetime.test.ts waiting indefinitely; exact-head CI reports that timeout and pending cleanup. Return the standard unsupported-method response for this RPC, or implement its contract in the existing peer.
  • Retarget cancellation coverage to the actual send boundary (P2) - The new awaitWithinCompletionBoundary call for remote.disable adds an abort-listener registration before inference. The existing cancellation test triggers on registration five, which now targets remote disabling rather than the send boundary. That stage has no send-stage abort callback, so its expected session.abort call is absent, matching the exact-head CI failure at line 494. Update the fixture to exercise cancellation at the intended send boundary and retain its no-send and cleanup checks.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Construct session probes without assigning getter-only sessionId — extensions/copilot/test-api.ts:66
  • [P2] Return MethodNotFound for the unsupported completion RPC — extensions/copilot/src/catalog-lifetime.test-support.ts:50-51
  • [P2] Retarget cancellation coverage to the actual send boundary — extensions/copilot/src/isolated-completion.ts:220-223

Tests

  • Missing end-to-end proof: Provide redacted shipped-Gateway evidence of configured Fusion tier selection, reuse and tier changes, isolated completion and finalization, plus fresh-install and v2026.11.10 upgrade results preserving settings and sdk-sessions bindings; omit API keys, IPs, phone numbers, and non-public endpoints.
Agent review details

How this fits together

The Copilot plugin translates OpenClaw model settings and prepared credentials into native SDK sessions, then returns assistant output and tool activity to the host.

flowchart TD
  A[Model configuration] --> B[Shared tier resolver]
  B --> C[Session compatibility keys]
  B --> D[SDK session configuration]
  C --> D
  D --> E[Copilot SDK runtime]
  E --> F[Assistant output and tool activity]
Loading

Technical review

Best possible solution:

Retain the shared plugin-owned tier resolver, repair the affected SDK fixtures, and demonstrate complete Fusion behavior with existing settings and sessions preserved.

Do we have a high-confidence way to reproduce the issue?

Current main demonstrably omits Fusion tiers from SDK session configuration and compatibility keys; this read-only review executed no target code.

Is this the best way to solve the issue?

The shared resolver is a small, appropriate implementation using existing parameter and session owners, but the SDK upgrade must also update its affected consumers and fixtures.

Full review comments:

  • [P2] Construct session probes without assigning getter-only sessionId — extensions/copilot/test-api.ts:66
    SDK 1.0.34 changes CopilotSession.sessionId from an instance field to an inherited getter without a setter. createProbeSession still uses Object.assign on Object.create(CopilotSession.prototype), so assigning this property throws before the probe can send anything. Exact-head CI confirms all three tool-policy handoff rows fail with the readonly-property error. Update the probe construction for the upgraded SDK while preserving its create/resume and filesystem assertions.
    Confidence: 0.99
  • [P2] Return MethodNotFound for the unsupported completion RPC — extensions/copilot/src/catalog-lifetime.test-support.ts:50-51
    SDK 1.0.34 first calls session.sendAndWait and falls back to session.send only on JSON-RPC MethodNotFound (-32601). This peer supports only session.send and answers unknown methods with -32603. The upgraded client therefore fails before resolving peer.sent, leaving catalog-lifetime.test.ts waiting indefinitely; exact-head CI reports that timeout and pending cleanup. Return the standard unsupported-method response for this RPC, or implement its contract in the existing peer.
    Confidence: 0.99
  • [P2] Retarget cancellation coverage to the actual send boundary — extensions/copilot/src/isolated-completion.ts:220-223
    The new awaitWithinCompletionBoundary call for remote.disable adds an abort-listener registration before inference. The existing cancellation test triggers on registration five, which now targets remote disabling rather than the send boundary. That stage has no send-stage abort callback, so its expected session.abort call is absent, matching the exact-head CI failure at line 494. Update the fixture to exercise cancellation at the intended send boundary and retain its no-send and cleanup checks.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 81bc5ec79fe4.

Provenance checked

  • Restricted Copilot sessions keeps the original intent (ce67ffb: feat(agents): add tool-free isolated completion #114343 established fresh, tool-free inference with ambient SDK capabilities disabled.)
  • Persistent session compatibility keeps the original intent (ece92bc: Persist SDK session IDs in SQLite and resume only when provider, model, workspace, agent, and authentication compatibility match.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/copilot/harness.test.ts --maxWorkers=1
  • pnpm test extensions/copilot/src/attempt.test.ts --maxWorkers=1
  • pnpm test extensions/copilot/src/catalog-lifetime.test.ts --maxWorkers=1
  • pnpm test test/copilot-tool-policy-handoff.integration.test.ts --maxWorkers=1
  • git diff --check

What I checked:

  • Pinned introduction: The introduced merge-base-to-head diff adds one tier resolver, applies it to session configuration and compatibility keys, and updates restricted sessions for the SDK remote-export RPC. (extensions/copilot/src/model-selection.ts:10, fcf8ed53371b)
  • Current main still lacks tier propagation: Fetched main pins SDK 1.0.25, sends model without capi.fusionTier, and omits the tier from session compatibility. (extensions/copilot/src/attempt-session-setup.ts:224, 81bc5ec79fe4)
  • Exact-head CI failures: CI annotations identify the getter-only sessionId assignment failure, the cancellation test's missing abort call, and the catalog-lifetime protocol fixture timeout; these match independently traced consequences of the diff. (extensions/copilot/harness.test.ts:494, fcf8ed53371b)
  • Authoritative upgraded SDK contract: The plugin directly imports this dependency. Tag v1.0.34 defines standard/high/max through capi.fusionTier, exposes sessionId through a getter, and attempts session.sendAndWait with fallback only for MethodNotFound. (nodejs/src/session.ts:773, adf1da2c6db7)
  • Previous SDK behavior: Tag v1.0.25 defines sessionId as a constructor property and implements ordinary sendAndWait through the previous event-based send path, establishing why the existing fixtures worked before the upgrade. (nodejs/src/session.ts:682, 339e55beb4b7)
  • Partial scope and reported live result: The PR body reports a standard-tier live tool call that stops at a tool-metadata assertion before finalization. The broader request at Support Copilot Fusion across the SDK runtime #205897 also includes native discovery and side-question routing, which this PR does not implement. (fcf8ed53371b)

Likely related people:

  • Vincent Koc: Raw commit bfffc77 adds extensions/copilot/harness.ts:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bfffc77bfc86; files: extensions/copilot/harness.ts)

PR surface

Source +71, Tests +144, Docs +27, Config 0, Other +29. Total +271 across 17 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 10 76 5 +71
Tests 4 148 4 +144
Docs 1 27 0 +27
Config 1 1 1 0
Generated 0 0 0 0
Other 1 183 154 +29
Total 17 435 164 +271

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
New model parameter params.fusionTier: standard | high | max Adds one user-facing routing setting for github-copilot/fusion, defaulting to standard.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The SDK upgrade changes session and RPC contracts, while Fusion changes persisted session compatibility fingerprints; upgrade compatibility remains unproven.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • merge-risk: 🚨 compatibility: The SDK upgrade changes session and RPC contracts, while Fusion changes persisted session compatibility fingerprints; upgrade compatibility remains unproven.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 26, 2026, 6:03 AM ET / 11:03 UTC.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​github/​copilot-sdk@​1.0.25 ⏵ 1.0.3498100100 +1100100

View full report

@vincentkoc
vincentkoc marked this pull request as ready for review November 26, 2026 13:13
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This PR changes the dependency graph.

This comment is informational because the PR author is a repository admin or an active member of @openclaw/openclaw-secops.

  • Current SHA: 6330f6a3c2fe05cae2517159347ae38b28e248b3
  • Approver: @vincentkoc
  • Repository role: admin

These dependency graph changes were made:

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

Carefully review these changes before merging.

@vincentkoc
vincentkoc enabled auto-merge (squash) November 26, 2026 13:20
@vincentkoc
vincentkoc merged commit fa14bcf into main Nov 26, 2026
300 of 301 checks passed
@vincentkoc
vincentkoc deleted the fix/copilot-fusion-sdk-support-20261126 branch November 26, 2026 13:40
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
* fix(copilot): preserve Fusion tiers in native SDK sessions

* test(copilot): update fixtures for SDK 1.0.34

* test(copilot): follow Tool Search dispatch in live smoke

* test(copilot): dispose live smoke client pools
tideclaw-bot added a commit that referenced this pull request Nov 30, 2026
Release adaptation: stable direct consumers already use Zod 4.6.7.
Upgrade @github/copilot-sdk from 1.0.25 to 1.0.29, its first patch
release declaring Zod 4.6.7. Copilot ships unbundled, so a workspace
only override would not repair standalone installs. Regenerate the
lock with pnpm; do not import the old direct-dependency sweep.

Adapt the required SDK compatibility from #205907
(fa14bcf): replace the removed
remoteSession option with an explicit disable RPC before isolated
sends. The separate Fusion behavior and later SDK bump are not needed.
Keep the legacy local test peer's RPC fallback intact.

Companion 763cbb6 is satisfied by
construction: leave Zod 3 users untouched. The vendored Discord parser
fix 0c38cbb is separate; the custom
A2UI parser fixed by 6ffb9e5 is absent.

(cherry picked from commit 16d61ac)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
* fix(copilot): preserve Fusion tiers in native SDK sessions

* test(copilot): update fixtures for SDK 1.0.34

* test(copilot): follow Tool Search dispatch in live smoke

* test(copilot): dispose live smoke client pools

(cherry picked from commit fa14bcf)

Co-authored-by: RomneyDa <[email protected]>
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 docs Improvements or additions to documentation extensions: copilot impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant