Sawra/sdk fix ts#90
Conversation
- Introduced RunAgentExecutionError for structured error reporting. - Updated run() and runStream() methods to throw RunAgentExecutionError on failures. - Enhanced error handling in WebSocket clients to utilize RunAgentExecutionError. - Added suggestions for common error scenarios in REST client responses. - Updated README to reflect new error handling practices.
- Updated all SDK versions to 0.1.30 - Generated changelog with git-cliff
|
Caution Review failedThe pull request is closed. WalkthroughVersion bump to 0.1.30 across all SDKs paired with enhanced TypeScript error handling: introduction of Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Client as TypeScript Client
participant REST as REST Client
participant API as Backend API
User->>Client: call run() or runStream()
Client->>REST: makeRequest()
REST->>API: HTTP request
alt Success Response
API-->>REST: 200 OK
REST-->>Client: ApiResponse (data)
Client-->>User: Success result
else Error Response
API-->>REST: 4xx/5xx Error
REST->>REST: buildExecutionError()
REST-->>Client: ApiResponse (error with code, message, suggestion)
Client->>Client: throw RunAgentExecutionError
Client-->>User: RunAgentExecutionError (code, suggestion, details)
end
sequenceDiagram
actor User
participant Client as WebSocket Client
participant WS as WebSocket Connection
participant Backend as Backend Stream
User->>Client: call runStream()
Client->>WS: open connection
WS->>Backend: initiate stream
loop Stream Messages
Backend-->>WS: StreamMessage
WS->>WS: parseStreamMessage()
WS->>WS: handleStatusMessage()
alt Status: continue
WS->>WS: emit data
else Status: complete
WS->>WS: resolveAll()
else Status: error
WS->>WS: buildStreamError()
WS->>WS: rejectAll(RunAgentExecutionError)
end
end
alt Unexpected Close/Error
Backend--X WS: connection error
WS->>WS: buildStreamError(CONNECTION_ERROR)
WS->>WS: rejectAll(RunAgentExecutionError)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
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 |
Summary by CodeRabbit
New Features
RunAgentExecutionError, providing error codes, messages, and actionable suggestions for all error scenarios across REST and WebSocket clientsDocumentation
Chores