Repository navigation
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
gregs535
left a comment
There was a problem hiding this comment.
This PR (#92040) and #92053 address the same underlying issue (#91975). Both are mergeable and well-tested.
Comparison:
- #92053 (thinking.ts fix): Targeted, minimal blast radius, reuses existing fallback path
- #92040 (provider-level fix): More general, affects all API-family policy routing, carries API context into dispatch
Decision needed: Pick the approach you prefer:
- Merge #92053 for immediate fix (lower risk)
- Merge #92040 for generalized API-family routing (higher impact, slightly more surface)
Either way, close the other with a reference to the merged approach. Both PRs have excellent test coverage and real behavior proof.
|
@clawsweeper review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 5:37 AM ET / 09:37 UTC. Summary PR surface: Source +141, Tests +518, Docs 0. Total +659 across 14 files. Reproducibility: yes. Current-main source shows provider-runtime thinking dispatch still lacks selected API context, and the PR body supplies terminal CLI proof that a custom Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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
Security Review detailsBest possible solution: Merge this shape only if maintainers accept selected model API as the shared thinking-policy owner signal; otherwise request an explicit opt-in or narrower owner boundary before merge. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows provider-runtime thinking dispatch still lacks selected API context, and the PR body supplies terminal CLI proof that a custom Is this the best way to solve the issue? Yes for the code shape, with a policy caveat. Carrying the selected API fact into the provider-policy seam is cleaner than provider-id substring matching, but maintainers still need to accept the broader compatibility behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ec737ee74d9b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +141, Tests +518, Docs 0. Total +659 across 14 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
|
|
@clawsweeper re-review Addressed the prior P1 shared API-owner finding with a smaller follow-up on this PR:
Validation on head Final local autoreview result: clean, no accepted/actionable findings. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
eb3f954 to
cde44b2
Compare
|
@clawsweeper re-review Updated this PR on head
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated this PR on head
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
anthropic-messagesbut whose provider id is not literallyanthropic.adaptive/max/xhighlevels according to the Claude model contract.anthropic-messagesandopenai-responses.Linked context
Closes #91975
Related: the issue's ClawSweeper review identified the missing API fact in thinking-policy dispatch and recommended reusing API-owner routing without provider-id substring matching. Follow-up ClawSweeper feedback also identified non-unique API refs, so this revision continues past declining owners instead of stopping at the first API-family match.
Real behavior proof (required for external PRs)
Behavior addressed: Custom providers with
api: "anthropic-messages"now route thinking profile lookup through the Anthropic policy fallback after exact provider hooks decline, so supported Claude models no longer reject valid extended thinking controls such as--thinking xhighsolely because the provider id is custom.Real environment tested: Local OpenClaw CLI/source checkout on Node 24, using the PR branch at commit
cde44b2362cb4f184e03c902050e093321f201aewith dependencies installed.Exact steps or command run after this patch: Created a temporary
OPENCLAW_CONFIG_PATHwith providerjdcloud-anthropic,api: "anthropic-messages", modelclaude-opus-4-7, then ranpnpm openclaw agent --local --model jdcloud-anthropic/claude-opus-4-7 --message "thinking proof" --session-key agent:main:proof --thinking xhigh --json --timeout 3. The proof command asserted that output contained the expected missing-auth error and did not containThinking level "xhigh" is not supported.Evidence after fix: Redacted terminal capture from the local checkout:
Observed result after fix: The real CLI/local-agent entrypoint accepts
--thinking xhighfor the configured customanthropic-messagesClaude Opus 4.7 route and proceeds to the expected auth failure. Before this fix, this path failed earlier withThinking level "xhigh" is not supported.What was not tested: No live external Anthropic/JDCloud API request was made; this change is local provider thinking-policy/profile resolution, not network transport or auth.
Proof limitations or environment constraints: The proof intentionally uses a temporary config without credentials to avoid external network/API dependency; the expected terminal state is the missing-auth error after thinking validation succeeds.
Before evidence (optional but encouraged): Regression tests added in this PR encode the prior failure mode where the selected model API was available in catalog/config but was not passed through API-owner thinking-policy dispatch, and where the first shared API owner could block later owners.
Tests and validation
pnpm tsgo:core:testpnpm tsgo:extensions:testnode scripts/run-vitest.mjs src/plugins/provider-thinking.test.ts src/plugins/provider-runtime.test.ts src/plugins/provider-public-artifacts.test.ts src/auto-reply/thinking.test.ts extensions/anthropic/provider-policy-api.test.ts extensions/openai/provider-policy-api.test.tspnpm format:check -- src/plugins/provider-public-artifacts.ts src/plugins/provider-runtime.ts src/plugins/provider-thinking.ts src/plugins/provider-runtime.test.ts src/plugins/provider-public-artifacts.test.ts src/plugins/provider-thinking.test.ts extensions/openai/provider-policy-api.ts extensions/openai/provider-policy-api.test.tsOPENCLAW_OXLINT_SKIP_LOCK=1 OPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs src/plugins/provider-thinking.ts src/plugins/provider-thinking.test.ts extensions/openai/provider-policy-api.ts extensions/openai/provider-policy-api.test.ts src/plugins/provider-public-artifacts.ts src/plugins/provider-runtime.ts src/plugins/provider-runtime.test.ts src/plugins/provider-public-artifacts.test.tsgit diff --checkpnpm check:docs-> format, markdownlint, and MDX passed;docs:check-i18n-glossaryreported pre-existing unrelated glossary gaps in other docs pages.pnpm build.agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main-> clean: no accepted/actionable findings reported.Regression coverage added for API propagation, bundled policy lookup by manifest model-catalog API refs, shared API owner traversal for
anthropic-messagesandopenai-responses, custom OpenAI Responses thinking profile opt-in, model-level API override precedence, runtime hook precedence over API fallback, and UI/autoreply thinking profile lookup through multiple API-ref owners.Risk checklist
Did user-visible behavior change? Yes
Did config, environment, or migration behavior change? No
Did security, auth, secrets, network, or tool execution behavior change? No
Highest-risk area: Provider thinking-policy ownership and fallback ordering.
Risk mitigation: Direct bundled policy remains first for literal bundled providers, runtime provider hooks win before API-family fallback, active UI/autoreply provider hooks still win before bundled policy fallback, and common/non-unique API refs that decline no longer block later bundled owner policy surfaces.
Current review state
Next action: Waiting for fresh CI and ClawSweeper re-review on head
e22ee99a5b96e6dcc19750a691a363aaca515de8.Still waiting on: Maintainer review and any broader CI/Testbox signal maintainers want beyond the focused local proof above.
Bot/reviewer comments addressed: Rebased onto current
upstream/main, dropped the already-mergedcliBackendsownership overlap from #93261, fixed the two widened API literal test fixture type errors, refreshed current-head CLI proof, documented the new provider thinking-policyapicontext, and reran local autoreview clean.