mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #278] [CLOSED] serve: count_tokens, Anthropic thinking only when asked, STRATA_REQUEST_LINES, a relative exe #2544
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#2544
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/278
Author: @sergqwer
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:pr/serve-extras📝 Commits (1)
9eae7c4serve: /v1/messages/count_tokens, Anthropic thinking only when asked, STRATA_REQUEST_LINES, a relative exe📊 Changes
3 files changed (+66 additions, -1 deletions)
View changed files
📝
serve/frontend.py(+5 -0)📝
serve/server.py(+44 -1)📝
serve/test_server.py(+17 -0)📄 Description
Summary
Four small server fixes, found by running Claude Code against the server and by starting a config with a relative
engine path:
POST /v1/messages/count_tokensanswered 404; Claude Code asks it for its context figures. It now renders andtokenizes the request exactly as
/v1/messageswould, without running the model./v1/messagesrequest withoutthinking(and without an effort) got thetemplate's default, which thinks. Claude Code's helper calls (a ~60-token session title) came back with a thinking
block and no text. Anthropic's thinking is opt-in, so such a request now renders with
enable_thinkingfalse. Aconfig's
reasoning_effortstill applies; a request withthinkingor an effort behaves as before.STRATA_REQUEST_LINES=1: a thread follows the engine log and prints one line per request on stdout(
[strata] request prompt P cached C output O ttft T ms total S ms prefill X tok/s decode Y tok/s), for supervisorsthat only see the server's stdout (a tray, llama-swap). Off by default.
exein the config failed in Windows'CreateProcess(WinError 2). It is now made absoluteagainst the config's
cwd, as the engine's own path already was.Tests
Two new tests:
count_tokensequals theinput_tokensthat/v1/messagesreports for the same request, and therequest-line pattern parses the engine's summary.
python -m unittest serve.test_server: 44 OK.🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.