fix(broker): treat blank nested sessionRef as absent in bridge
Merged
KH
3mo ago+57+57+01234567890123456789-1-1-0123456789
Summary
Follow-up to #1477 addressing one post-merge coderabbit finding.
attestation.session_ref.is_none()inbroker_payload_from_actiondid not cover the case where the nestedsessionRefinsidemetadata.attestationis a blank/whitespace string (e.g." "). A dispatcher that sends{"sessionRef":" "}inside the attestation block would suppress a valid top-levelsession_ref, leaving theSession-Idcommit trailer unset.- Replaces bare
is_none()with the same blank-aware check used byspawner.rs::is_valid_attestation_value: trims the nested value and treats an empty result as absent, allowing the top-level alias to fill the field. - Adds
blank_nested_session_ref_is_treated_as_absenttest to cover this branch directly.
Test plan
-
cargo test -p agent-relay-broker --lib -- relaycast::bridge::tests::blankโ 3 tests pass (blank_nested, blank_session_ref_falls_through, blank_session_id_falls_through) - Full suite:
cargo test -p agent-relay-broker --libโ 895 tests pass, 0 failures
๐ค Generated with Claude Code