Repository navigation
fix(llm): log a Stop as a stop, not as three errors - #7313
Conversation
Every Stop pressed while the model was still silent wrote three ERROR lines to gaia.log, one each from the Lemonade client, the SDK and the agent loop, so 30 stops buried real failures under 90 errors in a troubleshooting report. A stop is now one INFO line at each layer, and a real streaming failure is still logged as an error. stopped_by_user() recognises a StreamCancelledError or an error raised while handling one; the three log sites use it to pick the level. What is raised, and how the turn ends, is unchanged. Closes #ISSUE
|
Verdict: Approve with suggestions Pressing Stop while the model is still silent now logs one INFO line at each layer instead of three ERROR lines, so troubleshooting reports stop burying real failures under user stops. Only the log level changes; what gets raised and how the turn ends stay the same, and a real streaming failure is still logged as an error. The tests check both.
Real-world evidenceN/A: no evidence bundle was produced for this run. The change only affects log levels and touches no CLI, API, MCP or UI output, so this verdict rests on static review and the PR's unit tests. 🔍 Technical detailsIssues 🟡 Follow-up: Log a Stop on the non-streaming path as a stop too ( 🟢 Strengths
|
A Stop during the busy-server wait also reaches non-streaming calls, where the SDK and the agent loop still logged it as two errors. Both now log it at INFO, as the streaming path does; a real failure stays an error.
|
A Stop on the non-streaming path is now logged as a stop too, and the failed setup check comes from a test race, not this change.
|
A cause chain that loops back must end, and an error raised from another failure while a Stop is being handled must still be logged as an error.
Every Stop pressed while the model was still silent wrote three ERROR
lines to gaia.log, one each from the Lemonade client, the SDK and the
agent loop, so 30 stops buried real failures under 90 errors in a
troubleshooting report. A stop is now one INFO line at each layer, and a
real streaming failure is still logged as an error.
stopped_by_user() recognises a StreamCancelledError or an error raised
while handling one; the three log sites use it to pick the level. What is
raised, and how the turn ends, is unchanged.
Closes #7306
Test plan
python -m pytest tests/unit/test_stop_is_not_an_error.pyand the cancel, retry and streaming suites (178 pass)