fix(core): normalize RPC handler failures - #46946
Open
kitlangton wants to merge 1 commit into
Open
Conversation
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An unexpected RPC handler failure bypasses ordinary Effect error recovery for in-process callers, while HTTP callers receive
rpc.internal. The same call should have a recoverable failure at either entry point.What Changes
{ type: "rpc.internal", message: "RPC call failed" }failures. HTTP maps them to 500; its fallback also logs rather than echoes defects outside handler execution.The existing declared-error encoder stays in place. Valid declared errors, successful results, input/output validation, and interruption retain their behavior.
Same caller, different outcome
For example, inside a scoped
Effect.gen, withrpcobtained fromRpc.Service:The failed handler does not become successful. It becomes an ordinary RPC failure that the caller can choose to recover from, instead of requiring a separate
Effect.catchDefectat each call site.HTTP response for the same handler failure
Scope
Supersedes #46902 with a smaller implementation and only seven regression cases, not the restored RPC test suite. Production changes are confined to
core/src/rpc.tsandserver/src/handlers/rpc.ts.All seven tests were run against unmodified
v2atc992716523and failed for the intended reason:rpc.internal, logged onceUnlike #46902, undeclared-error names also stay in logs rather than the public message.
Verification