Skip to content

fix(codearts): use credit-only model catalog - #554

Merged
caigee-cmd merged 1 commit into
caigee-cmd:mainfrom
guyu233:fix/codearts-credit-only
Nov 20, 2026
Merged

caigee-cmd merged 1 commit into
caigee-cmd:mainfrom
guyu233:fix/codearts-credit-only

Conversation

@guyu233

@guyu233 guyu233 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Since the 2026-10 upstream change, Huawei Cloud CodeArts bills every model through the credit channel. This PR aligns the adapter:

  • Do not query the retired free-benefit gateway (/api/v1/gateway/config, /api/v1/benefit/claim, balance) and never send maas_type: benefit.
  • Use GET /v1/model/builtin as the authoritative catalog; agent-center models remain only as a fallback.
  • Reject unknown client model ids locally (404 model_not_available) before sending a billable chat request.
  • Daily check-in claims only campaigns the server explicitly marks claimable; no hardcoded campaign ids and no retired confirm endpoint.

Remote-image inlining (from #548) and canonical model validation from main are preserved.

Test plan

  • go build ./...
  • go test ./internal/providers/codearts ./internal/app (architecture boundaries pass)
  • python scripts/release-notes.py validate

- Do not query the retired free-benefit gateway or send maas_type: benefit.

- Reject unknown model ids locally before a billable request.

- Claim only server-eligible daily credit campaigns.

- Preserve remote-image inlining and strict canonical model routing from main.
@caigee-cmd
caigee-cmd merged commit 2d133a8 into caigee-cmd:main Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants