Land release blocker fixes and workspace cleanup
This commit is contained in:
@@ -4,6 +4,25 @@
|
||||
**Path:** `crates/llm/src/lib.rs:143-166`, `:317-321`
|
||||
**Source:** [2026-04-22 code review](../code-review-2026-04-22.md)
|
||||
**Labels:** release-blocker, major, llm
|
||||
**Status:** RESOLVED (2026-04-22)
|
||||
|
||||
## Resolution
|
||||
|
||||
`LlmEngine::generate` still tokenises the whole prompt up front, but it
|
||||
now runs a dedicated prompt-budget preflight before creating the llama
|
||||
context. The chosen behaviour is an early typed failure rather than
|
||||
silent truncation:
|
||||
|
||||
- If `prompt_tokens + max_tokens + 64 reserve tokens` exceeds the
|
||||
8192-token cap, generation returns
|
||||
`EngineError::PromptTooLong { prompt_tokens, max_tokens, available_prompt_tokens, context_window }`.
|
||||
- Prompts that fit exactly within the available budget still proceed and
|
||||
allocate an 8192-token context as before.
|
||||
|
||||
Regression tests:
|
||||
|
||||
- `prompt_preflight_rejects_oversized_prompt_tokens`
|
||||
- `prompt_preflight_keeps_prompts_within_budget`
|
||||
|
||||
## Problem
|
||||
|
||||
|
||||
Reference in New Issue
Block a user