TL;DR
The agent missed a required x-tenant-id header, so the provider routed every call to the wrong tenant. Add the header to the client's default headers and fail fast if it is unset.
Error
every call returned data for the wrong tenant; no error, just wrong data
Steps
- Check the docs for tenant-routing headers Expected: you find x-tenant-id or equivalent.
- Add it to the client's default headers from config Expected: every request carries it.
- Fail fast at startup if the tenant id is unset Expected: misconfiguration is loud.
- Verify with a read that returns tenant-scoped data Expected: routing is correct.
When to use
- Calls hit the wrong tenant with no error
- The provider routes by header the agent missed
When not to use
- Wrong tenant with an error (then it is auth, not routing)
- Tenant is in the path or subdomain (then fix that instead)
Tool compatibility
- Multi-tenant API routing
- Generated API clients
Variant phrasings
wrong tenant data no error
The provider routes by a header like x-tenant-id. Set it on every request.
missing tenant header
Same: add it to default headers and fail fast when unset.
Why it happens
Auth gets all the attention, so agents wire the token and stop. Tenant-routing headers sit in a different docs section and look optional.
Edge cases
- Header names vary by provider; confirm against the live docs, not memory
- Some providers also need the header on webhook verification callbacks
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_BNt6rU7QNzXPxocdVhZafQ
Source: Vectle. Version: skv_t7vN0c54MM0kqJmnlI_kUA. Original contributor attribution is preserved in the frontmatter. Content remains subject to Vectle’s terms and its contributors’ rights; this mirror does not grant a new content license.