Repository navigation
fix(onboard): custom provider context window vs compaction floor (#79428) - #79911
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection: current main creates non-Azure custom-provider models with a 4,000-token contextWindow while the runtime compaction reserve floor defaults to 20,000 tokens. I did not run the Windows/DashScope live path in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Keep the narrow onboarding/default-healing fix direction, then merge only after concrete runtime proof and CI are clean or clearly unrelated. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main creates non-Azure custom-provider models with a 4,000-token contextWindow while the runtime compaction reserve floor defaults to 20,000 tokens. I did not run the Windows/DashScope live path in this read-only review. Is this the best way to solve the issue? Yes for the code direction: changing custom-provider onboarding/default healing is the narrow maintainable fix, and it avoids changing global compaction policy or adding DashScope-specific behavior. The merge path still needs real proof and CI cleanup. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 60cb2325a1ce. |
Raise default/effective Custom Provider contextWindow above the compaction reserveTokensFloor default so new onboard flows do not infinite-compact. Co-authored-by: Cursor <[email protected]>
Summary
4000token custom model entries during reconfiguration.8192, so local/proxy setups are not silently expanded past their real capacity.Fixes #79428
Verification
pnpm test src/commands/onboard-custom-config.test.ts— 1 file, 37 tests passed.env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_ID pnpm check:changed— passed core/core-test/docs lanes.git diff --check— clean.Real behavior proof
Behavior or issue addressed: Non-Azure Custom Provider onboarding no longer writes a generated
contextWindowbelow the default compaction reserve floor, and re-onboarding heals legacy wizard-generated4000token entries without overwriting explicit valid smaller model limits.Real environment tested: macOS source checkout of this PR branch, Node/pnpm repo runtime, OpenClaw onboarding config helper loaded through
tsxfromsrc/commands/onboard-custom-config.ts.Exact steps or command run after this patch: Ran the patched OpenClaw config path with
pnpm exec tsxto create three custom-provider configs: fresh model, legacy4000model, and explicit8192model, then printed the resultingcontextWindowvalues.Evidence after fix: Actual terminal output from the patched branch:
{ "fresh": 128000, "legacy4000": 128000, "explicit8192": 8192 }Observed result after fix: Fresh non-Azure custom models now get
128000; legacy wizard-generated4000entries are raised to128000; explicit valid8192entries remain8192, proving the fix avoids the compaction deadlock without broad-clamping small real model limits.What was not tested: Full Windows 11 DashScope/Qwen gateway chat round-trip was not run in this maintainer patch; the changed behavior is the deterministic onboarding config write/merge path exercised above and by the focused regression test.