Skip to content

fix(github-copilot): expose thinking profile via bundled provider-policy-api#79894

Closed
jakepresent wants to merge 2 commits into
openclaw:mainfrom
jakepresent:fix/copilot-thinking-policy-api
Closed

fix(github-copilot): expose thinking profile via bundled provider-policy-api#79894
jakepresent wants to merge 2 commits into
openclaw:mainfrom
jakepresent:fix/copilot-thinking-policy-api

Conversation

@jakepresent

Copy link
Copy Markdown
Contributor

Problem

/think xhigh works on Discord (#general, #fitness, etc.) for github-copilot/claude-opus-4.7-1m-internal and other xhigh-eligible Copilot models, but the dashboard:

  • Drops xhigh from the thinking-level dropdown for these models
  • Rejects /think xhigh from the dashboard slash command with: Unsupported thinking level "xhigh" for this model. Valid levels: off, minimal, low, medium, high.
  • Silently downgrades sessions previously set to xhigh back to high after a refresh

Root cause

Other extensions (anthropic, openai, deepseek, google, ollama, opencode, openrouter, deepinfra) all ship a provider-policy-api.ts artifact at extensions/<id>/provider-policy-api.ts that gets bundled to dist/extensions/<id>/provider-policy-api.js and loaded synchronously by resolveBundledProviderPolicySurface whenever something needs to know a provider's thinking profile without going through the lazy plugin loader.

extensions/github-copilot is the odd one out — no provider-policy-api.ts was ever shipped. As a result, callers like getSessionDefaults and resolveSessionRowThinkingLevels (used by sessions.list for the dashboard) hit resolveProviderThinkingProfile in src/auto-reply/thinking.ts, which:

  1. Tries the active plugin registry (globalThis[Symbol.for("openclaw.pluginRegistryState")].activeRegistry.providers) — which has providers: [] at gateway-startup time for these calls
  2. Falls back to resolveBundledProviderPolicySurface("github-copilot") — which returns null because the artifact is missing
  3. Falls through to the generic base profile [off, minimal, low, medium, high] — dropping xhigh from the dashboard's thinking-level dropdown

Discord-side and main-agent calls work because they go through resolveProviderRuntimePluginresolveProviderPluginsForHooks, which lazily loads the plugin's runtime entry. That's a different code path and sees the in-process resolveThinkingProfile from extensions/github-copilot/index.ts.

Fix

Add extensions/github-copilot/provider-policy-api.ts, mirroring the pattern in extensions/anthropic/provider-policy-api.ts and extensions/openai/provider-policy-api.ts. Exports a resolveThinkingProfile that returns the same level list as the in-process one in extensions/github-copilot/index.ts, including xhigh for the xhigh-supporting model ids (gpt-5.4, gpt-5.3-codex, gpt-5.2, gpt-5.2-codex, claude-opus-4.7-1m-internal).

The COPILOT_XHIGH_MODEL_IDS list is intentionally duplicated rather than re-exported from ./index.ts because that module pulls in the full plugin runtime, while provider-policy-api.ts is loaded synchronously by the bundled-policy-surface path and must stay lightweight. The new file flags the requirement to keep the two lists in sync.

Verification

  • pnpm test -- --run extensions/github-copilot/provider-policy-api.test.ts5/5 passing, covering:
    • Base level set for non-xhigh models (claude-opus-4.6)
    • xhigh appended for claude-opus-4.7-1m-internal
    • xhigh appended for each GPT-5.4 / 5.3-codex / 5.2 / 5.2-codex variant
    • Case-insensitive normalization of the model id
    • null for non-github-copilot providers
  • Manually verified live by deploying the patched build to my local install and reloading the dashboard. Before the fix: dashboard /think xhigh rejected with "Unsupported thinking level". After the fix: xhigh appears in the dropdown for claude-opus-4.7-1m-internal and /think xhigh accepts cleanly.

Scope

  • 1 commit, 2 files, +92/-0
  • New file only — no behaviour change for other providers
  • Mirrors the existing pattern; no API surface changes

…icy-api

Other extensions (anthropic, openai, deepseek, google, etc.) all ship a
`provider-policy-api.ts` artifact at `extensions/<id>/provider-policy-api.ts`,
which is bundled to `dist/extensions/<id>/provider-policy-api.js` and loaded
synchronously by `resolveBundledProviderPolicySurface` whenever something
needs to know a provider's thinking profile without going through the lazy
plugin loader.

`extensions/github-copilot` was missing this artifact. As a result, callers
like `getSessionDefaults` and `resolveSessionRowThinkingLevels` (used by
`sessions.list` for the dashboard) hit `resolveProviderThinkingProfile` in
`src/auto-reply/thinking.ts`, which:
  1. Tried the active plugin registry (`globalThis[Symbol.for("openclaw.pluginRegistryState")].activeRegistry.providers`),
     which had `providers: []` at gateway-startup time for these calls.
  2. Fell back to `resolveBundledProviderPolicySurface("github-copilot")`,
     which returned null because the artifact was missing.
  3. Fell through to the generic base profile `[off, minimal, low, medium, high]` —
     dropping `xhigh` from the dashboard's thinking-level dropdown for models
     that should support it (`claude-opus-4.7-1m-internal`, `gpt-5.4`,
     `gpt-5.3-codex`, `gpt-5.2`, `gpt-5.2-codex`).

Discord-side and main-agent calls work because they go through
`resolveProviderRuntimePlugin` → `resolveProviderPluginsForHooks`, which
lazily loads the plugin's runtime entry. That's a different code path and
sees the in-process `resolveThinkingProfile` from `extensions/github-copilot/index.ts`.

This patch ports the same level list to a bundled
`provider-policy-api.ts` so the bundled-policy-surface lookup returns the
correct profile. Mirrors the pattern in `extensions/anthropic/provider-policy-api.ts`
and `extensions/openai/provider-policy-api.ts`.

The `COPILOT_XHIGH_MODEL_IDS` list is intentionally duplicated rather than
re-exported from `./index.ts` because that module pulls in the full plugin
runtime, while `provider-policy-api.ts` is loaded synchronously and must
stay lightweight. A comment in the new file flags the requirement to keep
the two lists in sync.
@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 870dbc6255

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"gpt-5.3-codex",
"gpt-5.2",
"gpt-5.2-codex",
"claude-opus-4.7-1m-internal",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep bundled policy in sync with runtime profile

For github-copilot/claude-opus-4.7-1m-internal, this new bundled policy advertises xhigh, but the runtime provider still uses COPILOT_XHIGH_MODEL_IDS in extensions/github-copilot/index.ts:37, which does not include this model. Once the GitHub Copilot plugin is active, resolveProviderThinkingProfile prefers the active provider hook over this bundled artifact, so the same dashboard/session can show or accept xhigh on the cold policy path and then reject/remap it on the runtime path. Either add the model to the runtime list too or remove it here so both policy surfaces agree.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 1:07 AM ET / 05:07 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +35, Tests +58. Total +93 across 2 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model gpt-5.5, reasoning high; reviewed against ebf20241bd17.

Label changes

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +35, Tests +58. Total +93 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 35 0 +35
Tests 1 58 0 +58
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 93 0 +93

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stdout: Per-item Codex failure; continuing with the rest of the shard.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 1, 2026
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label Jun 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 2, 2026
steipete added a commit that referenced this pull request Jun 2, 2026
Repairs a batch of narrow model/provider edge cases:

- honor OpenAI and Anthropic base URL environment overrides when provider config does not set an explicit base URL
- preserve OpenRouter Anthropic cache retention while stripping unsupported transport options
- allow apply_patch for non-OpenAI providers when the tool config otherwise permits it
- prune stale same-provider model selections from configure/model picker state
- expose GitHub Copilot bundled thinking policy metadata to offline/provider-policy lookups
- repair additive SQLite shared-state upgrades for existing databases
- keep same-size rotated log readers from reusing stale content in CI tooling

Proof:

- GitHub PR checks green on exact head 4651490
- Crabbox delegated Blacksmith Testbox tbx_01kt3em5r9vd7g0bnykrff6jdk exited 0
- Focused local Vitest/oxlint/format proof recorded in PR body and land-ready comment

Fixes #80347.
Fixes #88357.
Fixes #45269.
Supersedes #74427, #74432, #79370, #79894, #80366, and #88359.
@steipete

steipete commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. I landed the current-source version of this fix in #89347 / commit 732d697, with exact-head CI and focused provider/model proof recorded there.

Closing this as superseded by the merged maintainer batch.

@steipete steipete closed this Jun 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 3, 2026
Repairs a batch of narrow model/provider edge cases:

- honor OpenAI and Anthropic base URL environment overrides when provider config does not set an explicit base URL
- preserve OpenRouter Anthropic cache retention while stripping unsupported transport options
- allow apply_patch for non-OpenAI providers when the tool config otherwise permits it
- prune stale same-provider model selections from configure/model picker state
- expose GitHub Copilot bundled thinking policy metadata to offline/provider-policy lookups
- repair additive SQLite shared-state upgrades for existing databases
- keep same-size rotated log readers from reusing stale content in CI tooling

Proof:

- GitHub PR checks green on exact head 4651490
- Crabbox delegated Blacksmith Testbox tbx_01kt3em5r9vd7g0bnykrff6jdk exited 0
- Focused local Vitest/oxlint/format proof recorded in PR body and land-ready comment

Fixes openclaw#80347.
Fixes openclaw#88357.
Fixes openclaw#45269.
Supersedes openclaw#74427, openclaw#74432, openclaw#79370, openclaw#79894, openclaw#80366, and openclaw#88359.
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
Repairs a batch of narrow model/provider edge cases:

- honor OpenAI and Anthropic base URL environment overrides when provider config does not set an explicit base URL
- preserve OpenRouter Anthropic cache retention while stripping unsupported transport options
- allow apply_patch for non-OpenAI providers when the tool config otherwise permits it
- prune stale same-provider model selections from configure/model picker state
- expose GitHub Copilot bundled thinking policy metadata to offline/provider-policy lookups
- repair additive SQLite shared-state upgrades for existing databases
- keep same-size rotated log readers from reusing stale content in CI tooling

Proof:

- GitHub PR checks green on exact head 4651490
- Crabbox delegated Blacksmith Testbox tbx_01kt3em5r9vd7g0bnykrff6jdk exited 0
- Focused local Vitest/oxlint/format proof recorded in PR body and land-ready comment

Fixes openclaw#80347.
Fixes openclaw#88357.
Fixes openclaw#45269.
Supersedes openclaw#74427, openclaw#74432, openclaw#79370, openclaw#79894, openclaw#80366, and openclaw#88359.
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Repairs a batch of narrow model/provider edge cases:

- honor OpenAI and Anthropic base URL environment overrides when provider config does not set an explicit base URL
- preserve OpenRouter Anthropic cache retention while stripping unsupported transport options
- allow apply_patch for non-OpenAI providers when the tool config otherwise permits it
- prune stale same-provider model selections from configure/model picker state
- expose GitHub Copilot bundled thinking policy metadata to offline/provider-policy lookups
- repair additive SQLite shared-state upgrades for existing databases
- keep same-size rotated log readers from reusing stale content in CI tooling

Proof:

- GitHub PR checks green on exact head 4651490
- Crabbox delegated Blacksmith Testbox tbx_01kt3em5r9vd7g0bnykrff6jdk exited 0
- Focused local Vitest/oxlint/format proof recorded in PR body and land-ready comment

Fixes openclaw#80347.
Fixes openclaw#88357.
Fixes openclaw#45269.
Supersedes openclaw#74427, openclaw#74432, openclaw#79370, openclaw#79894, openclaw#80366, and openclaw#88359.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: github-copilot rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants