fix(providers): centralize stream request headers#59542
Merged
Conversation
Contributor
Greptile SummaryThis PR centralizes stream/websocket request-header merging into a new Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/provider-request-config.ts
Line: 114-116
Comment:
**Implicit `defaults-win` when `precedence` is omitted**
When `precedence` is `undefined`, the ternary falls through to the `defaults-win` branch silently. All current call sites explicitly pass the parameter, so there's no current bug, but this undocumented default could surprise a future caller who omits it expecting a neutral merge. A short JSDoc comment (or an explicit default in the parameter list) would lock in the intent.
```suggestion
// When precedence is omitted, defaults-win is the conservative choice:
// attribution/default headers cannot be silently overridden by callers.
return params.precedence === "caller-wins"
? mergeProviderRequestHeaders(mergedDefaults, params.callerHeaders)
: mergeProviderRequestHeaders(params.callerHeaders, mergedDefaults);
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/provider-st..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
25 tasks
25 tasks
ngutman
pushed a commit
that referenced
this pull request
Apr 3, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
steipete
pushed a commit
to duncanita/openclaw
that referenced
this pull request
Apr 4, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 24, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Nachx639
pushed a commit
to Nachx639/clawdbot
that referenced
this pull request
Jun 17, 2026
* fix(providers): centralize stream request headers * Update src/agents/provider-request-config.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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
resolveProviderRequestHeadersinsrc/agents/provider-request-config.tsand migrated OpenAI stream attribution, OpenRouter stream attribution, Kilocode stream defaults, and OpenAI websocket headers onto that shared seam.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
git blame, prior PR, issue, or refactor if known): this continues the provider request-policy/request-config work from refactor(providers): add internal request config seam #59454 and the shared HTTP seam from fix(providers): centralize media request shaping #59469.Regression Test Plan (if applicable)
src/agents/provider-request-config.test.ts,src/agents/openai-ws-connection.test.ts,src/agents/pi-embedded-runner/extra-params.openai.test.ts,src/agents/pi-embedded-runner/proxy-stream-wrappers.test.ts,src/agents/pi-embedded-runner/extra-params.kilocode.test.tsUser-visible / Behavior Changes
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
resolveProviderRequestHeaders(...), and targeted tests/build/check all pass.Evidence
Human Verification (required)
pnpm testand live provider traffic.Review Conversations
Compatibility / Migration
Risks and Mitigations
defaults-winandcaller-winsbehavior.