fix: enable UI retry when Bedrock returns early 503 error (#94)

- Add error prop to ChatInput to detect error state
- Update isDisabled logic to allow retry when there's an error
- Pass combined error (SDK error + streamingError) to ChatInput

When Bedrock returns 503 ServiceUnavailableException before streaming
starts, AI SDK's onError fires but status may not transition to "ready".
This fix ensures the input is re-enabled when an error occurs, allowing
users to retry their request.
This commit is contained in:
Dayuan Jiang
2025-12-05 16:22:38 +09:00
committed by GitHub
parent 95160f5a21
commit c805277a76
2 changed files with 6 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
const lastMessagePartsRef = useRef(0);
useEffect(() => {
// Clear streaming error and reset refs when status changes to ready
// Clear streaming error when status changes to ready
if (status === "ready") {
setStreamingError(null);
lastMessageCountRef.current = 0;
@@ -498,6 +498,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
onFileChange={handleFileChange}
showHistory={showHistory}
onToggleHistory={setShowHistory}
error={error || streamingError}
/>
</footer>
</div>