Skip to content

SWF(bug): reject out-of-range chat penalties - #71

Merged
maplepaladin73 merged 1 commit into
mainfrom
devin/1795397211-validate-chat-penalties
Nov 23, 2026
Merged

maplepaladin73 merged 1 commit into
mainfrom
devin/1795397211-validate-chat-penalties

Conversation

@maplepaladin73

@maplepaladin73 maplepaladin73 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Chat completions now return HTTP 400 for a supplied presence or frequency penalty outside the inclusive range [-2, 2], matching legacy completions.

Root cause: Chat validated only the resolved penalties after prompt setup. ATLAS_FORCE_TEMP_ZERO can replace the supplied values with zero before that check. Validate the original request up front and keep the resolved-value check for model presets.

Test plan

Try it (CPU, with bash scripts/ci_gpu_stubs.sh run once):

ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark sampling_penalty_ranges
  • Before: sampling_penalty_ranges ... FAILED — presence_penalty=-2.1 should be rejected.
  • After: sampling_penalty_ranges ... ok — both fields reject values below and above the limits with HTTP 400 and the matching error.param; both endpoints are accepted.
  • CPU server suite: 3253 passed; 0 failed; 14 ignored (cargo test -p spark-server --bin spark with the same environment).
  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests (CI command)
  • bash scripts/check-license-headers.sh, python3 scripts/check_spdx.py, and typos
  • Added a regression test covering both sides and the inclusive limits.
  • Untested: live HTTP/model inference and GPU validation.

CLA


Software Factory opened this PR for Robert
Implemented in session Validate chat presence and frequency penalty ranges
Review with Devin · Open in Devin Desktop


Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@maplepaladin73
maplepaladin73 merged commit 02ad0d7 into main Nov 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant