Treat thinking as progress in stream timeout; trim replayed history #67
Reference in New Issue
Block a user
Delete Branch "fix/stream-stall-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Long turns failed with "Simba took too long to respond" while the model was still generating. llama-server showed
stop: cancel taskatn_gen = 1287(~30 t/s), withn_tokens = 27262on a 32k slot.Two causes:
TOOL_RESULT_MAX_CHARSonly applied to the Postgres copy.Fix
TTFT_TIMEOUT_SECONDS.blueprints/conversation/context.pytrim_history:[image from an earlier message]placeholder.ToolMessages.stream_requestlogs now includemodel_calls(per call:prefill_ms,ms,prompt_tokens,output_tokens) andmax_prompt_tokens. Tokens come fromstream_usage=Trueon the llama client.Caveat
llama-server sends nothing during prompt prefill, so a cold prefill of a very long prompt still counts as silence. Trimming should keep prompts well below that;
prefill_msin the logs will show if it ever gets close.Test plan
pytest tests/ -q: 284 passed. New tests:make logs | grep stream_requestformax_prompt_tokensandprefill_ms🤖 Generated with Claude Code