Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection shows current main can forward a full OpenAI-compatible model/config output cap without subtracting input tokens, and the linked issue provides a concrete StepFun failure pattern. 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: Clamp the final outbound max-token budget across every source the request builder can choose, including Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can forward a full OpenAI-compatible model/config output cap without subtracting input tokens, and the linked issue provides a concrete StepFun failure pattern. Is this the best way to solve the issue? No, not yet. The stream-wrapper approach is plausible, but the proposed fix does not cover Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 277a4b695264. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
…like openai-completions endpoints Strict OpenAI-compatible servers (vLLM, LocalAI, llama.cpp, LM Studio, DashScope, GLM, Kimi) reject Chat Completions requests where max_completion_tokens >= max_model_len with HTTP 400. OpenClaw can emit such values when the catalog has model.maxTokens >= model.contextWindow (e.g. wildcard-discovered vLLM models defaulting to large maxTokens). Clamp to contextWindow - 1 in buildOpenAICompletionsParams when usesExplicitProxyLikeEndpoint is true. Native OpenAI/Azure/OpenRouter paths are byte-identical. Supersedes openclaw#85008 at the canonical payload builder seam (covers gateway, embedded runner, and public plugin-SDK consumers in a single 12-line change with no heuristic estimator).
|
Closing as superseded by #85889, which landed on #85889 keeps the fix at the shared OpenAI Chat Completions payload builder and clamps against the estimated final outbound request after compatibility transforms, including the remaining-context case this PR was targeting. Thanks for working on this; future PRs are easier for maintainers to carry forward when "Allow edits by maintainers" is enabled. |
Fixes #83086.
Summary
maxTokensto the remaining context window instead of forwarding values that exceed the available budgetcallModel.maxTokenstoo so providers that fall back to model defaults cannot bypass the same limitVerification
OPENCLAW_VITEST_INCLUDE_FILE=src/agents/pi-embedded-runner/extra-params.sampling.test.ts node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts --passWithNoTests=falsecorepack pnpm exec oxfmt --check src/agents/pi-embedded-runner/extra-params.ts src/agents/pi-embedded-runner/extra-params.sampling.test.ts src/agents/pi-embedded-runner/stream-max-tokens-context-window.tsgit diff --checkNotes
pnpm tsgo:core:testwas not run because the repo's sparse-checkout guard requires a much broader checkout (packages,ui/src, etc.)