anthropics / anthropics/claude-code

[BUG] CLAUDE_CODE_SUBAGENT_MODEL Inheritance Issue

Abierto
#92,715 0 comentarios 0 reacciones 0 asignados Ver en GitHub
api:anthropic area:agents bug platform:macos
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

### 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_

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
ai, api, cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.