mirror of
https://github.com/readest/readest.git
synced 2026-12-01 13:36:39 +00:00
X-Ray sent no max_tokens, so a server with a low default output cap (2048 tokens on the reporter's llama.cpp) cut each batch's JSON reply short, and every entity past the cut was lost. The Context Dictionary's Maximum Output Tokens applied only to dictionary lookups. X-Ray now has its own Maximum Output Tokens row under Manage Dictionaries > X-Ray. It is separate from the dictionary's, because one X-Ray reply covers a whole batch of text and needs many times the tokens of a dictionary entry. Blank keeps the provider's default, as before. The value persists and syncs with the other dictionary settings. The row reuses the existing "Maximum Output Tokens" and "Provider Default" strings, so nothing new needs translating. Tests that fail without the change (run before the implementation): - xray.test.ts "asks for the output limit set for X-Ray, and the provider default without one": expected [undefined, undefined] to deeply equal [undefined, 8192] - CustomDictionaries.test.tsx "saves an X-Ray output limit of its own": no spinbutton named "X-Ray: Maximum Output Tokens" - custom-dictionary-store.test.ts and settings.test.ts (sync): the value was dropped on load and not packed for sync All pass with the change. Checks run: related suites (xray, dictionaries, custom-dictionary-store, sync settings adapter, CustomDictionaries, XRayView): 37 files, 471 tests passed. pnpm lint and pnpm format:check passed. Real use on dev-web (Chromium, Alice in Wonderland EPUB), against a stub OpenAI-compatible server that caps replies at 2048 tokens when the request has no max_tokens, like the reporter's server: - origin/main sources: request max_tokens null, reply cut at 2048 tokens (finish_reason length), X-Ray kept 24 of 80 characters. - this branch, 8192 typed into the new field: request max_tokens 8192, full reply (finish_reason stop), X-Ray kept all 80. The dictionary's field stayed blank. The value survived a reload. - The settings row was checked in light, dark, e-ink, RTL and at 390x844. Not run: a real llama.cpp server (none installed here), and the on-device Apple Intelligence path, which receives the same limit. Reported by noideaforeal on GitHub. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| readest-app | ||
| readest-calibre-plugin | ||
| readest-crosspoint-plugin | ||
| readest.koplugin | ||