mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #923] [CLOSED] serve: answer Codex's thread-title requests without running them (Codex compatibility) #2918
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#2918
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/923
Author: @softbearlolz
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:codex/thread-title📝 Commits (10+)
749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it57bd713sycl: pipeline the expert cache's profile fill (model load 3-4x faster)📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
docs/DETAILS.md(+1 -0)📄 Description
Related to #451. A Codex compatibility fix: Codex CLI 0.160 sends a request that other clients do not, and on Strata's single prefix cache it evicts the conversation. Other clients are unaffected: the change applies only when Codex's own
x-codex-turn-metadatasays so.Codex 0.160's TUI (
tui/src/app/thread_title.rs) sends a secondPOST /v1/responsesbeside the user turn to name the thread. The body hasthread_sourcethread_title, an emptytoolslist, a differentsession_idthan the conversation, and the full Codex instructions, so the prompt is about 4,000 tokens rather than a few dozen. The schema is a singletitleof at most 36 characters.request_kindis stillturn.What we saw
This server has one prefix cache. A prompt matches only when it starts with the tokens the engine is holding (
generate.cpp). The title request does not: its tools are empty, and the template writes tools at the front. It also reachespreparebefore the real turn finishes tokenizing, so it takes the single slot first.Captured from the live Codex session on 2026-10-05 (requests were logged only for this investigation; that logger is not in this branch):
thread_source=thread_title,tools: [], session01a10b2e. The conversation file is session01a109ab, 8 tools, 687 input items.cache_n0 (prompt3,992, 185 generated; earlier the same day 4,149/222 and 4,050/999, the count moving with the user line and the reasoning length).The title is not in the conversation JSONL. Its
session_idis not the rollout's.Change
If
thread_sourceisthread_title, do not call the engine. Return a completed response whose message is{"title": "<the user line, cut to 36 characters>"}. The conversation request is unchanged and keeps the cache.The title is the user's line, not a model-written title.
docs/DETAILS.mdgets a row for it in the Responses API table.Why not
--conversation-cache-mib: with it (the default is 0) the conversation could be parked and restored, but the title request would still read ~4,000 tokens and take the slot first on every user line. This answers it without the engine.Evidence
Branch
codex/thread-title: the change at58fe594and the docs row at9d111b1, fromv0.1.39(6f32ec0, currentmain). No dump code.python3 -m unittest test_responsesinserve/: 21 tests OK. The new test posts a normal turn, then a title: the mock engine's prompt is unchanged, and the body is{"title":"只回四個字然後停:傾印測試"}. A 40-character line is cut to 36.On the same 2080 Ti, this build:
reading the prompt: 855 of 862 tokens, 6 s,done: 3 tokens in 7 s,cache_n0, answerHi.{"title":"Say hi"}. Noreading the promptline and nodoneline for it.done: 3 tokens in 1 s,cache_n864,prompt_n18.The request dump used to capture the original bodies is not in this branch.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.