fix(tts/xiaomi): support Token Plan TTS endpoint#79185
Conversation
Switch Xiaomi TTS auth from api-key header to standard Bearer auth to support Token Plan (Orbit) endpoint. Backward compatible with pay-as-you-go endpoint which also accepts Bearer auth. Closes openclaw#77692
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 5:06 PM ET / 21:06 UTC. Summary PR surface: Source +22, Tests +69, Docs +10. Total +101 across 5 files. Reproducibility: yes. at source level. Current main and Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Rebase or replace the branch with a narrow Xiaomi TTS fix that either inherits the supported Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main and Is this the best way to solve the issue? No. The PR is a useful start, but the best fix must align endpoint and credential selection with the supported Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 010b61746379. Label changesLabel justifications:
Evidence reviewedPR surface: Source +22, Tests +69, Docs +10. Total +101 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Adding one current data point from the linked issue because this PR is marked stale / waiting on author. The issue is still valid as of 2026-05-31. From the live AMS Token Plan repro in #77692, I think the mergeable shape should be:
So I would not close #77692 as stale: the current PR is close, but still needs the rebase/config alignment called out by ClawSweeper. |
|
@kidding1412 thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
Summary
Fix Xiaomi MiMo TTS for Token Plan users by:
Authorization: Bearer <key>instead of theapi-keyheadermodels.providers.xiaomi.baseUrlfor Xiaomi TTS whenmessages.tts.providers.xiaomi.baseUrlis not configuredbaseUrloverrides for users who need speech to use a different endpointtoken-plan-cnandtoken-plan-amsThis handles the Token Plan failure mode where
tp-...keys must call the matching regional Token Plan endpoint instead of the default pay-as-you-go endpoint.Closes #77692
Real behavior proof
Behavior or issue addressed: Xiaomi MiMo TTS with a Token Plan key should call the regional Token Plan endpoint and synthesize audio successfully instead of returning
401 Invalid API Keyfrom the default pay-as-you-go endpoint.Real environment tested: Local Mac mini OpenClaw checkout using a real Xiaomi MiMo Token Plan key against
https://token-plan-cn.xiaomimimo.com/v1. The key was kept local and was not pasted into the PR, issue, logs, or code.Exact steps or command run after this patch:
Evidence after fix: Copied live terminal output from the local run, with secrets redacted:
Observed result after fix: Both live Xiaomi TTS paths succeeded with the real Token Plan endpoint: MP3 audio-file synthesis and Opus voice-note synthesis. The run used
token-plan-cnand did not hit the default pay-as-you-go endpoint.What was not tested:
token-plan-amswas not live-tested in this run. Unit coverage verifiesmodels.providers.xiaomi.baseUrlinheritance and explicit TTSbaseUrlprecedence; the live run usedXIAOMI_BASE_URLto targettoken-plan-cn.Verification
npx [email protected] test extensions/xiaomi/speech-provider.test.tsnpx [email protected] exec oxfmt --check --threads=1 CHANGELOG.md docs/providers/xiaomi.md docs/tools/tts.md extensions/xiaomi/speech-provider.ts extensions/xiaomi/speech-provider.test.tsgit diff --checknpx [email protected] vitest run --config test/vitest/vitest.live.config.ts extensions/xiaomi/xiaomi.live.test.tshttps://token-plan-cn.xiaomimimo.com/v1https://api.xiaomimimo.com/v1npx [email protected] check:changedpassed the extension production typecheck but failed in the broader extension test typecheck on unrelated existing test files underextensions/diffs,extensions/irc,extensions/line,extensions/nextcloud-talk, andextensions/qqbot.