fix(agent): preserve streamed replies after model failures (#6494)
* fix(agent): preserve streamed replies after model failures * test(webui): settle lazy imports and async settings saves * test(agent): synchronize estimation checks at the operation boundary * docs(webui): explain retained replies after stream failures
This commit is contained in:
1 parent
b6536bfc5e
commit
219c8bb2bc
31 files changed
+462
-27
No files matched your search
@@ -161,3 +161,18 @@ def test_encode_turn_end_projects_complete_wire_contract() -> None:
|
||||
"failure_attempts": 4,
|
||||
"failure_message": "Connection refused",
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("preserved", [False, True])
|
||||
def test_encode_recovery_state_reports_reply_preservation(preserved: bool) -> None:
|
||||
payload = encode_recovery_state(
|
||||
"chat-1",
|
||||
RecoveryStateEvent(
|
||||
status="awaiting_user", recovery_id="recovery-1",
|
||||
reason="model_request_failed", failure_error_kind="connection",
|
||||
reply_preserved=preserved,
|
||||
),
|
||||
)
|
||||
assert payload["reply_preserved"] is preserved
|
||||
assert payload["status"] == "awaiting_user"
|
||||
assert payload["failure_error_kind"] == "connection"
|
||||
Reference in new issue
Block a user