Repository navigation
feat: send x-vapi-client with a run id on every Vapi request - #85
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scott-lowe-vapi
marked this pull request as ready for review
October 30, 2026 02:13
dhruva-vapi
approved these changes
Oct 30, 2026
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.

Value
V.A.L.U.E. tier: small — a behavior change: every Vapi API request carries one more header. No blast-radius path.
applyruns per org", "how many requests and writes a run makes" and "which runs failed" have no answer.[client] api requestPostHog event per request, with org, route, status andclient_run_id. Either PR can merge first: the API falls back to the User-Agent until this ships, and ignores the header until that ships.What changes
src/user-agent.tsaddsvapiClientGet(), which buildsx-vapi-client: gitops/<version>; command=<command>; run=<run id>[; ci]. Command and CI detection are shared withuserAgentGet(), so the two always agree.VAPI_GITOPS_RUN_IDby the first process exactly asVAPI_GITOPS_COMMANDis.npm run apply's pull and push share one id. An inherited value the API would reject is replaced.fetchcalls, plusVapiConnection(sim, check, promote, rollback, the org pin check) via a newvapiClientfield. The GitHub status call doesn't get it.how-it-works.mdsays what the header contains and that the run id identifies nothing about the user.AGENTS.mdadds it to the every-request rule.Evidence
vapiClientHeaderParsefrom #25115:gitops/1.0.0; command=cli; run=bc14384b-…; ci→{"client":"gitops","version":"1.0.0","command":"cli","runId":"bc14384b-…","ci":true}tests/user-agent-coverage.test.tsnow also requiresx-vapi-clienton every Vapifetchinsrc/(GitHub's excluded). Itsapi.tstest checks the header arrives at a real local server withcommand=applyand a UUID run id.tests/user-agent.test.tspins the format, CI marker, the rejected-run-id case, and that the process pins a UUID. The sim run-create test checks the header arrives too.Testing plan
npm run buildandnpm test(579 tests) pass.🤖 Generated with Claude Code