Skip to content

add X-Initiator header for GitHub Copilot to reduce premium requests #13016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

ckoehler
Copy link
Contributor

Title

add X-Initiator header for GitHub Copilot to reduce premium requests

Relevant issues

Fixes #12859

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

  • Implement X-Initiator header logic in GithubCopilotConfig.validate_environment()
  • Set header to "agent" when messages contain agent or tool roles, "user" otherwise
  • Reduces unnecessary premium Copilot API usage for non-user calls
Screenshot 2025-07-26 at 14 45 12

…ests

- Implement X-Initiator header logic in GithubCopilotConfig.validate_environment()
- Set header to "agent" when messages contain agent or tool roles, "user" otherwise
- Reduces unnecessary premium Copilot API usage for non-user calls

Fixes BerriAI#12859
Copy link

vercel bot commented Jul 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2025 8:56pm

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

lgtm

@ishaan-jaff ishaan-jaff merged commit 8f7d896 into BerriAI:main Jul 28, 2025
6 checks passed
ZPerling added a commit to ZPerling/litellm that referenced this pull request Jul 29, 2025
…gfuse-logger-fix

* 'main' of https://github.com/BerriAI/litellm:
  bump: version 1.74.9 → 1.74.10
  test: remove o1-preview
  [Bug Fix] The model gemini-2.5-flash with the merge_reasoning_content_in_choices parameter does not work (BerriAI#13066)
  test: skip dbrx claude 3-7 sonnet test - rate limit errors
  [MCP gateway] add url namespacing docs (BerriAI#13063)
  fix scrolling issue (BerriAI#13015)
  feat(langfuse-otel): Add comprehensive metadata support to Langfuse OpenTelemetry integration (BerriAI#12956)
  chore: Improve docs for cost tracking (BerriAI#12976)
  fix: correct CompletionRequest messages type to match OpenAI API spec (BerriAI#12980)
  Properly parse json options for key generation in the UI (BerriAI#12989)
  Remove duplicate test case verifying field filtering logic (BerriAI#13023)
  [Bug Fix] Pass through logging handler VertexAI - ensure multimodal embedding responses are logged  (BerriAI#13050)
  build: bump pip
  docs - openweb show how to include reasoning content (BerriAI#13060)
  fix: add X-Initiator header for GitHub Copilot to reduce premium requests (BerriAI#13016)
  test: update logic to fix for unit tests
update
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.

Reduce Premium Copilot requests
2 participants