Ensure thinking payloads fall through to standard prose formatting

This commit is contained in:
2026-06-15 16:02:33 -07:00
parent abf3856686
commit fe6351d7b4

View File

@@ -1744,7 +1744,10 @@ export async function POST(request: Request) {
} catch {
const fallback = buildHealthStatus({
loopBreakReason,
hitRoundCap: maxToolRounds > 0 && round >= maxToolRounds,
// If the loop was forcibly aborted by the user typing a new message mid-flight,
// we don't want to falsely claim we hit the tool-round cap. We only hit the cap
// if aborted is false.
hitRoundCap: !aborted && maxToolRounds > 0 && round >= maxToolRounds,
lastError: extractLastToolFailure(messages),
toolCount: assistantToolCalls.length,
});