You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix transformers /tasks failures: bigger budget, empty-answer salvage, and chat-message run logs (#48)
Every recent huggingface/transformers /tasks job was failing with "LLM returned unparseable output (finish_reason=None)" — 20/20 in a row. Investigation showed two compounding causes, and fixing them surfaced a logging gap and some UI rough edges. This PR bundles the whole fix.
Root cause
Budget too small. Tasks run in strict mode (every tool call counts). 30 tool calls wasn't enough for a repo the size of transformers — the agent spent its whole budget exploring and never emitted a patch.
No salvage for empty final answers. When the budget was exhausted, serge forced one tool-free final turn and handed its output straight to the parser. That turn came back empty with finish_reason=None (the provider truncating a huge-context stream), so it surfaced as "unparseable output". The existing salvage only handled finish_reason="length".
Changes
Salvage empty / None-finish final answers (reviewer.py): both final-answer paths now re-ask once for the JSON only when the answer is empty or hit the output-token limit, bounded by _MAX_TRUNCATION_RETRIES.
Raise the task tool budget 30 → 80 (prod.yaml) so large-repo fixes can converge.
Log chat messages in the run transcript: _run_agentic_loop emits a chat event per turn (assistant content, reasoning length, finish_reason, tool-call names/args) plus truncated tool results — so unparseable-output-class failures are debuggable after the fact. chat, not message (the SSE default type). Persisted via PERSIST_EVENT_KINDS (token/reasoning still dropped).
Web UI: assistant patch/review answers render human-readably (📝 title + body + "patch: N lines", or summary + inline-comment count) instead of raw JSON; tool results collapse to a single line with a size hint (full content stays in stored history); fixed doubled console lines on SSE reconnect via seq + Last-Event-ID resumption; widened the shared page container 960 → 1200px.
0 commit comments