mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1623] [CLOSED] fix(serve): make context overflow errors recognizable #3567
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3567
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1623
Author: @hulkbig
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:fix/context-overflow-messages-1615-20261009📝 Commits (1)
9ea8189fix(serve): make context overflow errors recognizable📊 Changes
2 files changed (+121 additions, -2 deletions)
View changed files
📝
serve/server.py(+4 -2)➕
serve/test_context_overflow.py(+117 -0)📄 Description
Fixes #1615.
Summary
Prefix both context-overflow errors with
request exceeds the context window:so client overflow classifiers can recognize them. The existing token counts, no-truncation wording, andmax_tokens/fit_max_tokensguidance remain intact.What changed
serve/server.py: message-only change in the two rejection branches. Admission rules, the eight-token context slack, fitting behavior, HTTP 400 status, and response schemas are unchanged.serve/test_context_overflow.py: CPU-only HTTP regressions cover both branches through chat completions, Messages, and Responses, with streaming requested and disabled. Coverage includes the reported 150,722-token prompt / 131,072-token context, fitting enabled and disabled, one-token/zero-token room boundaries, and preserved prompt/budget limits. Rejected requests never reach generation.Validation
python -m unittest serve.test_context_overflow serve.test_server.MaxTokens serve.test_server.FitMaxTokens serve.test_responses serve.test_request_hardening -q: 60 tests, zero failures/errors, one skip. Independently rerun with the same result.fb58e0dproduces 30 failed subtests for the missing phrase.6fb2e7815167e6b19006fc526d1a5d0f5f998787(package version 1.1.0, source blob2c0a5dc6e7f51a092545e0304248d7f264a03c98) using Node 24.19.0. All 48 baseline message forms were unrecognized; all 48 fixed forms were recognized (24 HTTP payloads, each as bare and HTTP-400-prefixed text). Two unrelated-error negative controls remained false.Test limits
python -m unittest discover -s serve -p 'test_*.py' -qran 596 tests with one error and 11 skips. The error istest_server.AmdTelemetry.test_readings: this host returnsNonefrompsutil.disk_io_counters(), causingAttributeError: 'NoneType' object has no attribute 'read_bytes'atserve/telemetry.py:311. The same error reproduces on untouchedfb58e0dwithpython -m unittest serve.test_server.AmdTelemetry.test_readings -v. No shim was applied.Validation establishes recognition by that pinned Pi classifier. It does not exercise a full Pi agent compaction/retry cycle; the issue does not specify its Pi version.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.