fix: forward provider parameters during profile cleanup - #289
Conversation
lindixu6-hash
left a comment
There was a problem hiding this comment.
Blocking edge case: this newly forwards arbitrary memoryExtraParams into the cleanup Chat Completions request, but applySafeExtraParams() does not protect stream. With memoryExtraParams: { stream: true }, the endpoint returns SSE while callViaExternalAPI() unconditionally calls response.json(), so cleanup deterministically fails. Please either add stream to the protected keys (preferred, since the existing provider consumers are also non-streaming) or force stream: false after applying extras, and add a regression assertion for this case. I locally verified the current head otherwise: targeted cleanup tests pass, full suite 447/447 passes with 1 skip, typecheck passes, and production build passes.
|
Added \stream\ to \PROTECTED_KEYS\ in \�pplySafeExtraParams\ so non-streaming endpoints across all providers and AI profile cleanup are protected from accidental SSE streaming injection. Also added regression coverage:
Verified locally:
|
|
Fixed the streaming edge case in the latest commit. stream is now protected centrally in �pplySafeExtraParams(), so it cannot put any of the existing non-streaming provider consumers into SSE mode. The cleanup regression fixture now passes stream: true and asserts that it is omitted from the final request body. Targeted cleanup tests pass (8/8), typecheck passes, and the production build passes. The full Windows suite reached 441 passing with 7 unrelated portability/worktree/SQLite timing failures. |
Summary
Fixes #287.
The external profile-cleanup request now forwards configured memoryExtraParams through the same safe-parameter helper used by the other provider paths. Cleanup-critical fields are assigned afterward, so extra parameters cannot replace the model, messages, temperature, or required JSON response format.
Validation
The full Windows suite reached 437 passing tests. Two unrelated ONNX/vector tests timed out, and build-dependent tests initially failed before dist was generated; all 10 build-dependent tests passed after the production build.