Make x-notte-request-origin header configurable via env var#23
Merged
giordano-lucas merged 2 commits intomainfrom Apr 11, 2026
Merged
Make x-notte-request-origin header configurable via env var#23giordano-lucas merged 2 commits intomainfrom
giordano-lucas merged 2 commits intomainfrom
Conversation
- Add NOTTE_REQUEST_ORIGIN env var to override the default "cli" origin - Add WithRequestOrigin client option and thread it through resilientTransport - Add test for custom request origin header
Member
Author
|
@greptile review |
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.
Greptile Summary
This PR makes the
x-notte-request-originheader configurable via theNOTTE_REQUEST_ORIGINenvironment variable, adding aWithRequestOriginclient option and threading it throughresilientTransport. The change is clean, well-tested, and follows the existing options pattern.Confidence Score: 5/5
Safe to merge — the only finding is an unused exported constant, which is a minor cleanup concern.
All changes are correct, the options pattern is properly followed, empty-env-var edge case is handled, and a targeted test is included. The single P2 finding (unused
DefaultRequestOriginconstant) does not affect runtime behavior.internal/config/config.go —
DefaultRequestOriginconstant is exported but unreferenced.Important Files Changed
requestOriginfield,WithRequestOriginoption, and threads it throughresilientTransport. Implementation is correct and consistent with the existing options pattern.DefaultRequestOriginandEnvRequestOriginconstants, butDefaultRequestOriginis never referenced —client.gohardcodes"cli"independently.NOTTE_REQUEST_ORIGINenv var and conditionally appliesWithRequestOrigin; correctly skips the option when the env var is unset or empty.TestResilientTransport_CustomRequestOriginthat verifies the custom origin header is sent; test is clear and well-structured.NOTTE_REQUEST_ORIGINenv var; value shown (cli) matches the hardcoded default.Prompt To Fix All With AI
Reviews (3): Last reviewed commit: "update sdk" | Re-trigger Greptile