Repository navigation
Releases
v0.1.12
Reasoning effort can be passed through, dropped, or remapped per model from the CodeArts login page.
Passthrough stays on by default. glm-5.3 none and minimal are sent as low, because ModelArts rejects those two values. Other efforts and other enabled models are unchanged. The choice is stored on the auth file and kept when the STS credential refreshes.
ModelArts.81001 is returned as HTTP 400, including on a stream close, so CPA does not cool the credential after a parameter error.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.11
STS refresh now follows half the credential lifetime instead of a 10–20 minute loop.
A two-hour CodeArts token is refreshed about 60 minutes before it expires. A token already in that second half, or an expired one, waits two minutes. Refresh failures are no longer reported as HTTP 401, so CPA retries instead of leaving the auth unauthorized.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.10
STS refresh no longer hits CodeArts about once a second after a token is due.
A healthy token now waits a random 10–20 minutes. A token inside that window is refreshed two minutes before it expires. An expired token, or one with less than two minutes left, waits two minutes. Logging in again keeps prefix, disabled, and the other fields CPA and CPAMP already set on the same auth file.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.9
Register the InferHub model id instead of the CodeArts display name.
Agent detail stores DeepSeek-V4.1-Flash-1017 in model_name and deepseek-v4.1-flash in model_parameters.model_id. Discovery preferred the display name, and InferHub rejected every chat as InferHub.001001005.400. CPA then reported AI_TRANSPORT_FAILED and auth_unavailable. The registered id is now used.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin, restart CPA, and rediscover models. The old display name is not a valid model id.
v0.1.8
Cap oversized max_tokens and fold tool schema constraints before InferHub.
Kimi-K3 and DeepSeek-V4.1-Flash-1017 were rejected with InferHub.001001005.400. The client sent max_completion_tokens of 1048576 or 393216, and tool schemas still contained const, pattern, length, numeric, and anyOf constraints. Values above the model output limit are now capped, or omitted when no limit is known. Tool schemas keep type, description, properties, required, and items; enum, const, and anyOf values are written into the description.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.7
Store updated_at as an RFC3339 string so CPA can parse the auth file.
v0.1.6 wrote a unix number. CPA 8.0.47 unmarshals updated_at as time.Time and rejected the file, so model discovery had no credential and the model list stayed empty. Existing numeric files still parse and are rewritten on the next login or refresh.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin, restart CPA, then log in again.
v0.1.6
Flatten chat messages and tool schemas before sending them to InferHub.
v0.1.5 still forwarded content arrays, developer roles, strict JSON schemas, and object-shaped tool arguments. InferHub rejected those as InferHub.001001005.400. Each message and function definition is now rebuilt from the fields the upstream accepts.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.5
Rewrite outbound chat bodies so InferHub accepts them.
Named tool_choice objects, unpaired tool history, and unknown OpenAI fields were forwarded unchanged and rejected as InferHub.001001005.400. The plugin now rebuilds the body and returns that rejection as HTTP 400 instead of retrying it as a benefit miss.
Binaries: codearts-linux-arm64.so, codearts-linux-amd64.so. Replace the plugin and restart CPA.
v0.1.4
修复
- 华为码道可能返回
data:{"text":"..."}。插件现在把它收成一条 OpenAI JSON;流式响应则发出不带data:前缀的 JSON 块。这修复了 CPA 解析时报出的Unexpected token 'd', "data:{"tex"... is not valid JSON。 - SSE 事件里的
error_code会作为上游错误返回,不再当成正文转发。
文件
codearts-linux-arm64.socodearts-linux-amd64.so
用 golang:1.26-bookworm 编译。替换后需要重启 CPA 进程。
v0.1.3
修复 CPA 模型前缀仍被发给华为码道的问题。
配置了 prefix: codearts 时,CPA 可能已经把请求模型改成 GLM-5.3,但请求体里仍是 codearts/GLM-5.3。v0.1.2 只改了请求模型,码道按请求体返回 404。0.1.3 会把两处都改成裸名;前缀没有随请求传过来时,单层的 <前缀>/<模型> 也会去掉。
Linux 插件 codearts.so 0.1.3,源码是 450a3ed(PR #24,包含已合并的 PR #23)。在 golang:1.26-bookworm 容器里用 CGO 编译。本机 arm64 容器和 amd64 容器的 go test ./internal/... 都通过。测试机 8.155.129.3 没有可用的 SSH 登录,amd64 改为在本机 Docker 的 linux/amd64 平台编译。
codearts-linux-arm64.so:本机 Docker,linux/arm64codearts-linux-amd64.so:本机 Docker,linux/amd64
SHA256
- arm64
a757e94269cb50895b2e3f3694ca94540c856494850dfca9a9d4cb16fc1c4d7a - amd64
32a384e782ce6b291423db09ee24dfc40d9820806b502b7b2b96540f981d4be3
动态库只依赖 libc.so.6。把对应架构的文件放到 CPA 的 plugins/linux/<arch>/codearts.so,然后重启进程,dlopen 才会换上新文件。