Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug]: Claude version probe drops CLI stderr, so a broken wrapper shows only "installed but failed to run"

Abierto Apto para principiantes
#22,873 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@juliusmarminge ya está trabajando en esto.

Desde el 21/10/2026.

  • #22878 de @juliusmarminge — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
backend

Línea de trabajo

Empieza en apps/server/src/provider/ClaudeProvider.ts, cerca de la comprobación de versión en las líneas 562–582. Lee cómo gestiona la comprobación las salidas distintas de cero y cómo se generan su advertencia y el mensaje de estado para el usuario; el issue proporciona un comando wrapper que falla y su stderr para reproducir el problema. El trabajo estará terminado cuando la comprobación conserve y muestre un detalle de error útil, mantenga un mensaje alternativo y pasen las comprobaciones relacionadas del proveedor.

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

Descripción

Area

apps/server

Steps to reproduce
  1. Install the Claude CLI wrapper so its postinstall never runs, leaving the placeholder stub it ships with:
    npm i -g --ignore-scripts @anthropic-ai/[email protected]
    
  2. Confirm the CLI fails and explains why:
    $ claude --version; echo "exit=$?"
    Error: claude native binary not installed.
    
    Either postinstall did not run (--ignore-scripts, some pnpm configs)
    or the platform-native optional dependency was not downloaded
    (--omit=optional).
    
    Run the postinstall manually (adjust path for local vs global install):
      node node_modules/@anthropic-ai/claude-code/install.cjs
    
    Or reinstall without --ignore-scripts / --omit=optional.
    exit=1
    
  3. In T3 Code go to Settings → Providers and refresh the probe (the control next to "Checked just now", i.e. server.refreshProviders).
Expected behavior

The provider card and/or the server log carry the CLI's own explanation, at least the first stderr line. The failing CLI already prints the exact fix command, and T3 has that text in hand.

Actual behavior

The card shows only:

Unavailable · Claude Agent CLI is installed but failed to run.

The only record is this warning, which keeps lengths and throws the text away (apps/server/src/provider/ClaudeProvider.ts:565-569):

{
  "name": "checkClaudeProviderStatus",
  "events": [
    {
      "name": "[\n  \"Claude Agent CLI version probe exited with a non-zero status.\",\n  {\n    \"exitCode\": 1,\n    \"stdoutLength\": 0,\n    \"stderrLength\": 383\n  }\n]",
      "attributes": { "effect.logLevel": "WARN" }
    }
  ]
}

Those 383 bytes of stderr were the message quoted in step 2. Since only the length is persisted, no UI surface can recover the cause afterwards. The user-facing message is hardcoded at :580.

Impact

Minor bug or occasional failure

Justification: once a wrapper install is broken, the provider is unusable and the report offers no path to recovery. Every wrapper breakage lands here identically — pnpm installs, --omit=optional, and Chocolatey-style installs as in #22810.

Version or commit

0.1.2-nightly.20261021.3473. Still present on main: apps/server/src/provider/ClaudeProvider.ts:562-582.

Environment

WSL2, Ubuntu 24.04.5 LTS (kernel 6.18.33.2-microsoft-standard-WSL2), Node v24.21.0 via fnm, @anthropic-ai/claude-code 2.1.306 (npm global). T3 host is the WSL distro (Settings header renders "on wsl"). Provider: Claude (claudeAgent); Codex and OpenCode were unaffected on the same host.

Logs or stack traces
$ grep -h "version probe exited" ~/.t3/userdata/logs/server.trace.ndjson | tail -1
{"type":"effect-span","name":"checkClaudeProviderStatus","durationMs":14.466428,"events":[{"name":"[\n  \"Claude Agent CLI version probe exited with a non-zero status.\",\n  {\n    \"exitCode\": 1,\n    \"stdoutLength\": 0,\n    \"stderrLength\": 383\n  }\n]","attributes":{"effect.logLevel":"WARN"}}]}
Workaround

Run the wrapper's postinstall by hand, then refresh the provider probe:

node "$(npm root -g)/@anthropic-ai/claude-code/install.cjs"

The provider flips to Available once claude --version exits 0. This is restating step 2's own advice, which T3 discarded.

Suggested fix
if (version.code !== 0) {
  const detail = firstNonEmptyLine(version.stderr) || firstNonEmptyLine(version.stdout);
  yield* Effect.logWarning("Claude Agent CLI version probe exited with a non-zero status.", {
    exitCode: version.code,
    stderr: truncate(version.stderr, 2000), // keep the text, not just its length
  });
  // message: detail
  //   ? `Claude Agent CLI is installed but failed to run: ${detail}`
  //   : "Claude Agent CLI is installed but failed to run.",
}

Same class of problem as #19571 (closed), which fixed stderr being dropped for turns. The availability probe was not covered by that fix.

Lenguaje dominante
TypeScript
Estrellas
24.8k
Forks
6.4k
Merge medio
1 h 22 min
PR fusionados (30 d)
18

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pingdotgg/t3code

Todos los issues de pingdotgg/t3code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.