fix(gateway): split actor response wait errors#4945
Conversation
Code Review: fix(gateway): split actor response wait errorsOverviewThis PR replaces the generic ServiceUnavailable error with five distinct, semantically precise error types for actor response wait failures in the gateway. It also improves the retry logic and TypeScript client classification, and adds documentation for all new error codes. Strengths
Issues1. Missing newline at end of fileEvery new .json file under engine/artifacts/errors/ ends without a trailing newline. All existing artifacts in that directory include a trailing newline; these should match. 2. actor_ready_timeout inconsistency between Rust and TypeScriptThe Rust helper includes actor_ready_timeout as retryable but the TypeScript counterpart does not. This means guard.actor_ready_timeout is retried by the gateway internal Rust retry loop but not by the TypeScript client. If the intent is for the TS client to retry on it too, add the code; if not, remove it from the Rust list or document why the two diverge. 3. No Rust unit testsThe Rust-side changes are meaningfully testable:
4. Duplicate retryable-codes listThe list of retryable guard codes now lives in three places: Rust (utils.rs), TypeScript (lifecycle-errors.ts), and implicitly in the documentation. A future error addition must be updated in all three simultaneously. A brief inline cross-reference comment would reduce the risk of drift. Minor
SummaryThe core change is solid: cleaner error taxonomy, a real bug fix in the None/break path, and good test coverage on the TypeScript side. The main actionable items before merge are: fix the trailing newlines in the JSON artifacts, resolve the actor_ready_timeout inconsistency between Rust and TypeScript, and consider adding Rust unit tests for the new retry helpers. |
0933767 to
a4663b0
Compare
5ad2b7b to
82f5c9d
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: