fix: allow request_header selector in exists conditions for response-stage coprocessor and events#8964
fix: allow request_header selector in exists conditions for response-stage coprocessor and events#8964OriginLeon merged 8 commits intodevfrom
Conversation
The Exists condition validation was rejecting request_header selectors
used in response-stage event conditions (supergraph.response,
router.response, subgraph.response) because RequestHeader is not active
at Stage::Response. However, at runtime these conditions are correctly
pre-resolved by evaluate_request() before any response-time evaluation,
so the validation was overly strict.
Fix: allow selectors active at Stage::Request in Exists conditions even
when the restricted_stage is a response stage. This unblocks the
common pattern of 'exists: { request_header: x }' as a condition for
response events.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 481e8043957caafbfa5502ff ✅ AI Style Review — No Changes DetectedNo MDX files were changed in this pull request. Review Log: View detailed log
|
carodewig
left a comment
There was a problem hiding this comment.
Is the intent behind this to allow request selectors on all stages or only on response stages? There are other stages (ie Stage::Drop, Stage::Error) that this will currently apply to
|
@carodewig The fix was related to allow request selectors specific on response stages, but that was already a behavior that was expected. Would you say it been available on those other stages as something we don't want to allow or possibly problematic? |
|
I think it's fine if that's how it's intended to work, just wanted to make sure. |
…stage coprocessor and events (#8964) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…stage coprocessor and events (#8964) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes a bug where using
exists: { request_header: <name> }as a condition on response-stage coprocessor configurations would cause the router to reject the config at startup with a validation error.The validator was incorrectly rejecting request-stage selectors in
Existsconditions for response-stage configs. The fix allows this combination sinceevaluate_request()always pre-resolves these conditions before they reach the response stage.The same fix also corrects the equivalent behavior in telemetry event conditions.