Repository navigation
feat(provider): let custom providers set sampling and token knobs - #1308
TheGreatAxios merged 3 commits into
Conversation
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Comment
Custom OpenAI-compatible providers persist optional context window, max output tokens, temperature, and top-p; the form rejects setting both sampling knobs.
Findings
-
src/config/index.ts:280—buildOpenAISourcewrites bothtemperatureandtop_pintoproviderOptionswhen both fields are set. Mutual exclusion exists only insrc/tui/provider/submit.ts:84. Hand-editedsettings.json(or a catalog row) with both knobs reaches the outbound request. Verified:buildInferenceSourceForRefwithtemperature: 0.5andtopP: 0.8yields{ temperature: 0.5, top_p: 0.8 }. Refuse the pair inbuildOpenAISource/ the settings schema, not only at submit. -
src/tui/provider/form.ts:69—stepReadyhas no lower bound formaxTokensorcontextWindow."0"and"-1"are ready, submit persists them, andfields.maxTokens ?? SOURCE_MAX_TOKENSkeeps0(it is notundefined). A zero/negative output cap starves generation; a zero/negative context window poisons compaction and the status-bar meter. Reject non-positive integers atstepReadyand at submit, matching the 0–2 / 0–1 checks already used for temperature / top-p.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review findings resolved at 9f16963: live context limits refresh without a restart, hidden custom numeric fields cannot affect preset/OAuth submissions, and invalid/noninteger token counts are rejected by shared ArkType validation. A further integration regression proves delayed discovery cannot undo a model switch. Test-first evidence: original regressions fail before fixes, focused checks pass afterward, and full bun run check against current main passes with 8,254 tests and zero failures. All original PR files and follow-up changes are reviewed; no remaining actionable findings. No live API smoke is claimed.
Summary
Verification
bun run checkpasses against current main: 8,254 tests, zero failures.Fixes CL-9834