Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| ### Handling append failures <a id="append-failures"/> | ||
|
|
||
| When appending without awaiting, it is possible for an intermediate append to fail while subsequent appends succeed. This creates a gap in the streamed response. For example, if a rate limit is exceeded, a single append may be rejected while the following tokens continue to be accepted. |
There was a problem hiding this comment.
| When appending without awaiting, it is possible for an intermediate append to fail while subsequent appends succeed. This creates a gap in the streamed response. For example, if a rate limit is exceeded, a single append may be rejected while the following tokens continue to be accepted. | |
| The examples above append successive tokens to a response message by pipelining the append operations - that is, the agent will publish an append operation without waiting for prior operations to complete. This is necessary in order to avoid the append rate being capped by the round-trip time from the agent to the Ably endpoint. However, this means that the agent does not await the outcome of each append operation, and that can result in the agent continuing to submit append operations after an earlier operation has failed. For example, if a rate limit is exceeded, a single append may be rejected while the following tokens continue to be accepted. | |
| The agent needs to obtain the outcome of each append operation, and take corrective action in the event that any operation failed for some reason. A simple but effective way to do this is simply to ensure that, if streaming of a response fails for any reason, then the message is updated with the final complete response text once it is available. This means that although the streaming experience is disrupted in the case of failure, there is no consistency problem with the final result once the response completes. |
|
|
||
| When appending without awaiting, it is possible for an intermediate append to fail while subsequent appends succeed. This creates a gap in the streamed response. For example, if a rate limit is exceeded, a single append may be rejected while the following tokens continue to be accepted. | ||
|
|
||
| To detect failures, keep a reference to each append operation and check for rejections after the stream completes: |
There was a problem hiding this comment.
| To detect failures, keep a reference to each append operation and check for rejections after the stream completes: | |
| To detect append failures, keep a reference to each append operation and check for rejections after the stream completes: |
|
|
||
| ### Handling publish failures <a id="publish-failures"/> | ||
|
|
||
| When publishing without awaiting, it is possible for an intermediate publish to fail while subsequent publishes succeed. This creates a gap in the streamed response. For example, if a rate limit is exceeded, a single token may be rejected while the following tokens continue to be accepted. |
There was a problem hiding this comment.
I suggest updating this text in a similar way to proposed above
20df5cb to
01ab0f8
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d347b2f to
eb190d3
Compare
Description
Context: https://ably.atlassian.net/browse/AIT-238
Overall the questions I think need to be answers in these docs sections are: