Repository navigation
Bind local chat to engine context limits - #80
Conversation
Publish per-slot limits to Assistant and request the selected answer reserve. Count the fully templated prompt through the owned llama engine before generation, with one deadline and cancellation path. Verified: provider, model-contract, and runtime test suites; Assistant shell and cancellation tests; source gates and affected-crate Clippy.
|
@irzhywau ready for your review (security routine). Focus: |
Security review — #80
|
|
@irzhywau thank you, clear and fast. F1: we take your fail-closed option. |
|
@irzhywau F1 is fixed in
|
Change
Assistant reads the selected local offer's per-slot context window and answer limit before it builds a chat turn. The model provider asks its owned llama engine to count the fully templated request, including special tokens, before it starts generation. It rejects a turn when the input and reserved answer exceed the slot. Counting and generation share the run deadline, and Stop can interrupt counting. Runtime admits only the exact token-count route through the local model broker.
The request carries the selected answer limit through the text input hash. Existing run journals keep their execution binding when the new offer metadata appears.
Proof and acceptance are tracked in #96.
Part of #96.