fix: clarify custom provider HTML responses#84703
Conversation
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-22 15:57 UTC / May 22, 2026, 11:57 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection shows current main accepts any 2xx custom-provider verification response and the OpenAI SDK posts Chat Completions to PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Rebase on current main, keep the custom-provider JSON/HTML diagnostic changes, restore the node-host Codex routing fix and its tests/changelog, then add redacted real OpenClaw/custom-provider proof or get an explicit maintainer proof override. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main accepts any 2xx custom-provider verification response and the OpenAI SDK posts Chat Completions to Is this the best way to solve the issue? No for the current branch. The custom-provider diagnostic approach is narrow in isolation, but the force-pushed Codex/changelog regression must be removed before this is a safe fix path. Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 5cc0dbce8628. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
294c81d to
0bba7f6
Compare
Summary
/v1base URL hint.Fixes #84697
Verification
node scripts/run-vitest.mjs src/commands/onboard-custom.test.ts src/commands/onboard-custom-config.test.ts src/agents/openai-transport-stream.test.tsgit diff --checkReal behavior proof
Behavior addressed: OpenAI-compatible custom providers that point at a web root can return
text/html; OpenClaw now rejects that during setup and reports a base URL/API-path hint at runtime instead of falling through to a generic response failure.Real environment tested: Local checkout with a loopback HTTP server in
src/agents/openai-transport-stream.test.tsreturningtext/htmlto the OpenAI-compatible Chat Completions request path.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/commands/onboard-custom.test.ts src/commands/onboard-custom-config.test.ts src/agents/openai-transport-stream.test.tsEvidence after fix: The new runtime regression asserts the error includes "returned HTML instead of an API response" and "baseUrl includes the provider API path, such as /v1"; the onboarding regression asserts a successful HTTP response with invalid JSON is rejected with the same base URL guidance.
Observed result after fix: 4 test files passed; 396 tests passed.
What was not tested: Live spanagent.xyz provider traffic; the regression uses a local HTTP server to reproduce the HTML response class safely.