fix(github-copilot): expose thinking profile via bundled provider-policy-api#79894
fix(github-copilot): expose thinking profile via bundled provider-policy-api#79894jakepresent wants to merge 2 commits into
Conversation
…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.
There was a problem hiding this comment.
💡 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", |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed June 2, 2026, 1:07 AM ET / 05:07 UTC. Summary 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 follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest 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 changesLabel justifications:
Evidence reviewedPR surface: Source +35, Tests +58. Total +93 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
This pull request has been automatically marked as stale due to inactivity. |
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.
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.
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.
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.
Problem
/think xhighworks on Discord (#general,#fitness, etc.) forgithub-copilot/claude-opus-4.7-1m-internaland other xhigh-eligible Copilot models, but the dashboard:xhighfrom the thinking-level dropdown for these models/think xhighfrom the dashboard slash command with:Unsupported thinking level "xhigh" for this model. Valid levels: off, minimal, low, medium, high.xhighback tohighafter a refreshRoot cause
Other extensions (
anthropic,openai,deepseek,google,ollama,opencode,openrouter,deepinfra) all ship aprovider-policy-api.tsartifact atextensions/<id>/provider-policy-api.tsthat gets bundled todist/extensions/<id>/provider-policy-api.jsand loaded synchronously byresolveBundledProviderPolicySurfacewhenever something needs to know a provider's thinking profile without going through the lazy plugin loader.extensions/github-copilotis the odd one out — noprovider-policy-api.tswas ever shipped. As a result, callers likegetSessionDefaultsandresolveSessionRowThinkingLevels(used bysessions.listfor the dashboard) hitresolveProviderThinkingProfileinsrc/auto-reply/thinking.ts, which:globalThis[Symbol.for("openclaw.pluginRegistryState")].activeRegistry.providers) — which hasproviders: []at gateway-startup time for these callsresolveBundledProviderPolicySurface("github-copilot")— which returns null because the artifact is missing[off, minimal, low, medium, high]— droppingxhighfrom the dashboard's thinking-level dropdownDiscord-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-processresolveThinkingProfilefromextensions/github-copilot/index.ts.Fix
Add
extensions/github-copilot/provider-policy-api.ts, mirroring the pattern inextensions/anthropic/provider-policy-api.tsandextensions/openai/provider-policy-api.ts. Exports aresolveThinkingProfilethat returns the same level list as the in-process one inextensions/github-copilot/index.ts, includingxhighfor 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_IDSlist is intentionally duplicated rather than re-exported from./index.tsbecause that module pulls in the full plugin runtime, whileprovider-policy-api.tsis 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.ts— 5/5 passing, covering:claude-opus-4.6)xhighappended forclaude-opus-4.7-1m-internalxhighappended for each GPT-5.4 / 5.3-codex / 5.2 / 5.2-codex variantnullfor non-github-copilotproviders/think xhighrejected with "Unsupported thinking level". After the fix:xhighappears in the dropdown forclaude-opus-4.7-1m-internaland/think xhighaccepts cleanly.Scope