You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 77e422f
Browse filesBrowse the repository at this point in the historyBrowse files
fix: _isGrokXAI() false-positive substring match breaks token usage for domains containing "x.ai" (Zoo-Code-Org#1484)
* fix: _isGrokXAI false-positive substring match breaks token usage for domains containing 'x.ai'
FixesZoo-Code-Org#1483
The _isGrokXAI() method used urlHost.includes('x.ai') which matches any
domain containing 'x.ai' as a substring (e.g. box.ai, fox.ai, max.ai).
This false-positive causes stream_options:{include_usage:true} to be
omitted, so the API never returns usage data and the token bar shows 0.
Fix: Use exact host match (api.x.ai) or subdomain match (*.x.ai) instead
of substring includes.
Added tests for false-positive scenarios and valid x.ai domain detection.
AI-assisted: developed with Zoo Code/GLM-5.2, reviewed and verified by the contributor.
* Address CodeRabbit review: use URL.hostname, bracket notation, remove changeset
* test: add O3+Grok stream_options coverage for handleO3FamilyMessage
---------
Co-authored-by: Elliott de Launay <edelauna@gmail.com>
0 commit comments