fix(generation): compute num_ctx in run_assist_generation

This commit is contained in:
2026-04-03 13:35:47 -04:00
parent 9d519054ee
commit 22003788f5
@@ -529,8 +529,10 @@ async def run_assist_generation(
On each retry the accumulated content is reset so the done event On each retry the accumulated content is reset so the done event
always reflects only the successful generation. always reflects only the successful generation.
""" """
from fabledassistant.services.llm import pick_num_ctx
input_chars = sum(len(m.get("content", "")) for m in messages) input_chars = sum(len(m.get("content", "")) for m in messages)
logger.info("Assist generation started: model=%s, input_chars=%d", model, input_chars) num_ctx = pick_num_ctx(messages)
logger.info("Assist generation started: model=%s, input_chars=%d, num_ctx=%d", model, input_chars, num_ctx)
last_exc: BaseException | None = None last_exc: BaseException | None = None
for attempt in range(3): for attempt in range(3):