Repository navigation
feat(protocol): preserve embedded host errors - #922
Draft
afourniernv wants to merge 1 commit into
Draft
afourniernv wants to merge 1 commit into
afourniernv wants to merge 1 commit into
Conversation
Signed-off-by: Alex Fournier <afournier@nvidia.com>
This branch has not been deployed
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.
What
Adds
LlmClientError::Hostfor errors owned by an embedded Rust host.The original error stays boxed so the host can recover its native type. Switchyard records it as a host error without putting the source text into telemetry.
Why
An embedded client sometimes needs to pass a host error through Switchyard and recover it at the outer boundary.
General(String)loses the type, whileFfidescribes a different boundary.Notes for reviewers
Start with
crates/protocol/src/client.rs. The remaining changes keep the new category safe and consistent in libsy, client-call telemetry, and runner failure summaries.This adds one variant to the existing
#[non_exhaustive]LlmClientErrorenum. No existing methods, variants, or signatures change. The error is terminal unless the host maps it to one of Switchyard's existing retryable categories.Related: #912 adds a separate runner-construction API for embedded hosts. The two PRs can merge independently.
Validated with:
cargo fmt --all --checkcargo test -p switchyard-libsy boxed_sources_are_reduced_to_their_classcargo test -p switchyard-llm-client --test observability host_error_source_is_redacted_from_the_client_call_spancargo test -p switchyard-runner failure::testscargo test -p switchyard-llm-client fallback_only_accepts_context_policy_and_unavailable_failures