Skip to content

feat: add request headers for tracking (x-notte-request-origin, x-not…#42

Merged
giordano-lucas merged 2 commits intomainfrom
feat/add-request-headers
Feb 4, 2026
Merged

feat: add request headers for tracking (x-notte-request-origin, x-not…#42
giordano-lucas merged 2 commits intomainfrom
feat/add-request-headers

Conversation

@giordano-lucas
Copy link
Member

@giordano-lucas giordano-lucas commented Feb 4, 2026

…te-sdk-version)

Add two headers to all API requests:

  • x-notte-request-origin: "cli"
  • x-notte-sdk-version: CLI version string

Greptile Overview

Greptile Summary

This PR adds request tracking headers to all API requests made by the CLI. Two headers are now included: x-notte-request-origin (set to "cli") and x-notte-sdk-version (set to the CLI version string).

Changes:

  • Modified NewClientWithURL to accept a version parameter
  • Updated resilientTransport to store and set the version in request headers
  • Updated GetClient() in root.go to pass the Version variable
  • Updated all test calls to include the new version parameter

Observations:

  • The implementation is clean and follows existing patterns
  • Tests have been updated to compile with the new signature but don't verify the new headers are actually set
  • Empty string is passed as version in NewClient() (when not using NewClientWithURL directly)

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward and add tracking headers to API requests. The implementation is clean, follows existing patterns, and all tests pass with updated signatures. Score is 4 instead of 5 due to missing test coverage for the new headers.
  • No files require special attention - consider adding test coverage for tracking headers in client_test.go

Important Files Changed

Filename Overview
internal/api/client.go Added version parameter and tracking headers (x-notte-request-origin, x-notte-sdk-version) to all API requests
internal/api/client_test.go Updated test calls to include version parameter, but no tests verify the new tracking headers
internal/cmd/root.go Updated GetClient() to pass Version variable to API client constructor

…te-sdk-version)

Add two headers to all API requests:
- x-notte-request-origin: "cli"
- x-notte-sdk-version: CLI version string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 4, 2026

Additional Comments (1)

internal/api/client_test.go
Missing test coverage for new tracking headers. TestResilientTransport_AddsAuthHeader should also verify x-notte-request-origin and x-notte-sdk-version headers are set.

Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/api/client_test.go
Line: 62:88

Comment:
Missing test coverage for new tracking headers. `TestResilientTransport_AddsAuthHeader` should also verify `x-notte-request-origin` and `x-notte-sdk-version` headers are set.

How can I resolve this? If you propose a fix, please make it concise.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@giordano-lucas giordano-lucas merged commit 3ddf56b into main Feb 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant