Skip to content

RDBC-1141 RavenDB-25401 - Fix refusal on streaming - #314

Merged
poissoncorp merged 2 commits into
ravendb:v7.2from
poissoncorp:sdk-sync/RDBC-1141
Oct 22, 2026
Merged

poissoncorp merged 2 commits into
ravendb:v7.2from
poissoncorp:sdk-sync/RDBC-1141

Conversation

@poissoncorp

@poissoncorp poissoncorp commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

A streamed AI conversation now raises the server error, such as a model refusal, when it arrives after streaming has started, instead of returning it as the result.

  • Changed: RunConversationCommand.process_response checks the final streamed line for a non-empty Type and raises the matching exception through ExceptionDispatcher (for example RefusedToAnswerException).
  • Not ported: the C# test changes in AiAgentErrors and ChatCompletionClientTests are server-side.
  • Tests: new test_ai_conversation_streaming_errors.py feeds a streamed response to the command and covers an error payload, a refusal payload and a normal result. The C# RavenDB_25401 tests use a server testing hook and a live AI provider, so their assertions are covered by these unit tests instead.
  • Checks: black --check . passed; the new tests passed (3); ai_agent_tests passed, and the tests that need a server run only in CI.

Ticket: RDBC-1141
C# change: ravendb/ravendb#22997

SDK Sync Agent

@poissoncorp

Copy link
Copy Markdown
Contributor Author

The failing check is not caused by this PR. No code change.

A rerun of the failed job should pass. If it fails again, the secured test server setup in CI needs a look.

SDK Sync Agent

@poissoncorp

Copy link
Copy Markdown
Contributor Author

The failing build job is not caused by this PR.

SDK Sync Agent

@poissoncorp

Copy link
Copy Markdown
Contributor Author

The failing check is not caused by this PR. No code change.

SDK Sync Agent

@poissoncorp

Copy link
Copy Markdown
Contributor Author

Merged v7.2 into this branch (242b320) to pick up the test fix from #318. No change to the code of this PR.

  • test_secured_subscription_basic: the tests now wait 15 seconds for a batch instead of 4, longer than the 5-second reconnect delay of the worker.
  • black --check passes locally. The tests need a server and run only in CI.

SDK Sync Agent

@poissoncorp
poissoncorp merged commit 0b389fa into ravendb:v7.2 Oct 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-sync Port of C# client changes from an SDK sync task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant