Land release blocker fixes and workspace cleanup
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

This commit is contained in:
2026-04-23 00:16:09 +01:00
parent d7363cc913
commit 9b0067b4c0
36 changed files with 1529 additions and 418 deletions

View File

@@ -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