Skip to content

Conversation

@YunKuiLu
Copy link
Contributor

  • Add an AtomicBoolean to DefaultCallResponseSpec and DefaultStreamResponseSpec to track whether the instance has been used
  • Check if the instance has already been used before calling advisorChain.nextCall, and throw an IllegalStateException if it has
  • Add unit tests to confirm that case

Based on issue #3880, we could add checks to detect if methods in DefaultCallResponseSpec and DefaultStreamResponseSpec are called more than once, and throw a clear exception to help with debugging.

- Add an `AtomicBoolean` to DefaultCallResponseSpec and DefaultStreamResponseSpec to track whether the instance has been used
- Check if the instance has already been used before calling `advisorChain.nextCall`, and throw an `IllegalStateException` if it has
- Add unit tests to confirm that case

Signed-off-by: YunKui Lu <[email protected]>
@YunKuiLu YunKuiLu changed the title fix: Make sure that XXXResponseSpec instances can only be used once feat: Make sure that XXXResponseSpec instances can only be used once Aug 12, 2025
@YunKuiLu YunKuiLu changed the title feat: Make sure that XXXResponseSpec instances can only be used once feat: Make sure that Call/StreamResponseSpec instances can only be used once Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants