Skip to content

fix(assistant): resolve the Claude Code model catalog - #999

Open
jiangjiang248 wants to merge 1 commit into
Tencent:mainfrom
jiangjiang248:fix/claude-code-model-catalog-986
Open

jiangjiang248 wants to merge 1 commit into
Tencent:mainfrom
jiangjiang248:fix/claude-code-model-catalog-986

Conversation

@jiangjiang248

Copy link
Copy Markdown

What changed

Selecting Claude Code in AI chat requests /api/assistant/models?executor=claude-code. The endpoint uses the chat engine ID to look up a catalog keyed by claude, which returns HTTP 400 and leaves the model picker empty.

Share the existing engine-to-catalog mapping with the endpoint and use the resolved key for model family metadata. The regression exercises the Claude Code chat ID alongside the legacy Claude ID, Codex, and an unknown executor.

Fixes #986.

Scope

  • Platform core / API / runner

Compatibility

Both claude-code and claude return the built-in Claude model catalog. Unknown executor IDs return HTTP 400.

Validation

  • Isolated Gin handler regression using the upstream route and static executor catalog: HTTP 400 for claude-code on the base, then pass for the Claude Code and legacy aliases, Codex and an unknown executor with the patch. The isolated test stubs CodeBuddy discovery and Cursor discovery.
  • Linux amd64: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go test -c ./internal/httpapi and go vet ./internal/httpapi with the same target passed.
  • Chatbot: 385 tests passed and the production bundle built. gofmt, git diff --check, public content and Gitleaks checks passed.
  • Linux test execution and public browser acceptance are pending CI. Native Windows compilation of the Go package failed on existing Linux-specific syscall references.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.

AI assistance: Codex prepared the patch and ran the validation above.

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.

[Bug] AI 对话切换 Claude Code 必定 400「不支持的执行器」:assistantEngineClaude 与 executorModelCatalogs 键名不一致

1 participant