fix(ai-openrouter): keep root metadata out of requests#748
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR fixes a regression where OpenRouter's text adapter was forwarding root-level observability metadata to the wire request, causing validation failures on structured metadata. The fix removes the root metadata from the request body, restricts observability metadata to middleware/devtools consumers, and enables structured e2e tests to verify the corrected behavior. ChangesOpenRouter root metadata observability fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
Fixes #735.
chat()metadata into OpenRouter chat-completions requestmetadata.modelOptions.metadata.Test plan
corepack pnpm run build:allcorepack pnpm --filter @tanstack/ai-openrouter test:libcorepack pnpm --filter @tanstack/ai-openrouter test:typescorepack pnpm --filter @tanstack/ai-openrouter test:eslintcorepack pnpm --filter @tanstack/ai-e2e exec playwright test tests/chat.spec.ts -g "openrouter root metadata"corepack pnpm --filter @tanstack/ai-e2e buildFull
pnpm run test:prwas not run locally.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
New Features
Tests