anthropics / anthropics/claude-code
[BUG] CLAUDE_CODE_SUBAGENT_MODEL Inheritance Issue
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
When the main session is configured to a local model via ANTHROPIC_API_KEY routing, CLAUDE_CODE_SUBAGENT_MODEL set to the local model name, claude-code-guide/named subagents still fail with claude-haiku-4-5-20251001 not found, while subagent_type: "fork" correctly inherits the local model
### What Should Happen?
The subagent should inherit the model the main session is using. The parameter is set for inheritance but it still defaults to Haiku
### Error Messages/Logs
```shell
Agent "Claude Code hooks guide" failed: Agent terminated early due to an API error: There's an issue with the selected model
(claude-haiku-4-5-20251001). It may not exist or you may not have access to it. Run /model to pick a different model. (error type
model_not_found, HTTP 404, model sent to the API: claude-haiku-4-5-20251001)
```
### Steps to Reproduce
Issue a prompt that will call a subagent while the model is set to a local model. The subagent will fail saying it has an API Error with the selected model (Claude-haiku-4-5-20251001.
### Claude Model
Other
### Is this a regression?
I don't know
### Last Working Version
_No response_
### Claude Code Version
2.1.263
### Platform
Anthropic API
### Operating System
macOS
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
_No response_
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start by reproducing the failure with a local model, CLAUDE_CODE_SUBAGENT_MODEL, and a named subagent, then compare it with subagent_type: "fork", which reportedly inherits correctly. Trace where the main-session model is selected for each subagent path; done means named subagents use the configured model instead of defaulting to claude-haiku-4-5-20251001.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- ai, api, cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100