Fix HTTP headers to include headers from Step Scope (Step.headers → HttpProbe.headers)#27
Merged
thearyanahmed merged 1 commit intoJun 5, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes a scope mismatch in the blueprint transpiler so that HTTP request headers declared in step scope (headers { ... }) are actually applied by the HTTP probe executor (which reads from HttpProbe.headers).
Changes:
- In
resolve_step, move step-levelheadersintoHttpProbe.headerswhen the step’s probe is HTTP. - Add a regression test ensuring headers end up on
Probe::Http.headersand are removed fromStep.headers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Blueprint
.bpfiles currently define HTTP headers inside step scope using aheaders { ... }block.However, during transpilation those headers are stored only in
Step.headers, whileHttpProbe.headersremains empty.As a result, HTTP probes execute without the intended request headers.
Problem
Given a blueprint like:
headersare parsed from step scope (Step.headers)probe http ...resolves toProbe::Http(HttpProbe { headers: HashMap::new(), ... })crates/blueprint/src/executor/probes/http.rs) sends onlyprobe.headersSo requests are sent without step-defined headers.
Root Cause
Scope mismatch between transpiler and executor:
Step.headersHttpProbe.headersSolution (implemented in this PR)
Adopted Approach 2: move headers from step scope to HTTP probe scope during transpilation.
What changed
In
crates/blueprint/src/transpiler/resolve.rs(resolve_step):headersintoHttpProbe.headersusingstd::mem::takeThis ensures headers defined in step scope are available where execution expects them.
Alternatives considered
Change blueprint syntax/design (define headers inline on probe)
Move headers during transpilation ✅ (chosen)
Inject/override headers at execution time from
StepTests
Added regression test in
crates/blueprint/src/transpiler/resolve.rs:test_http_step_headers_are_moved_into_probe_headersValidates that:
headers { ... }are present inProbe::Http.headersStep.headersis empty after move (no duplication)