Skip to content

Claude Code process exits with code 1 when using GLM (CN) provider #307

Description

@weidong1826

Bug Report

Description

CodePilot fails to start Claude Code process when using the GLM (智谱 AI) provider. The Claude Code CLI works
perfectly when run directly from the terminal, but crashes (exit code 1) when spawned by CodePilot.

Environment

  • CodePilot Version: 0.38.1
  • Claude Code CLI Version: 2.1.23
  • OS: Windows 10 (10.0.19045)
  • Shell: Git Bash (MINGW64)
  • Provider: GLM (CN) - 智谱 AI

Configuration

{
  "ANTHROPIC_AUTH_TOKEN": "a65b503df7724ea28c22677102d9d1b9.viG4oyw6J8n1WSO6",
  "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
  "API_TIMEOUT_MS": "3000000",
  "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
}

Error Logs

[error] [claude-client] Stream error: {
  "message": "Claude Code process exited with code 1",
  "stack": "Error: Claude Code process exited with code 1\n    at t3.getProcessExitError (C:\\Program
Files\\CodePilot\\resources\\standalone\\.next\\server\\chunks\\[root-of-the-server]__6432b538._.js:11:5518)\n    at
ChildProcess.r (C:\\Program
Files\\CodePilot\\resources\\standalone\\.next\\server\\chunks\\[root-of-the-server]__6432b538._.js:11:8008)\n    at
Object.onceWrapper (node:events:623:26)\n    at ChildProcess.emit (node:events:520:35)\n    at
ChildProcess._handle.onexit (node:internal/child_process:294:12)"
}

Warning

[error] (node:12308) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to
security vulnerabilities, as the arguments are not escaped, only concatenated.

Diagnosis Results

The built-in diagnosis shows everything is OK:

  • ✅ CLI found at C:\Users\Administrator\AppData\Roaming\npm\claude.cmd
  • ✅ Auth resolved (api_key style)
  • ✅ Provider "GLM (CN)" is reachable (Status: 200)
  • ✅ Network connectivity OK

Verification

Running claude -p "hello" directly in terminal works perfectly:

$ claude -p "hello"
Hello! How can I help you with your software engineering tasks today?

Expected Behavior

CodePilot should successfully spawn the Claude Code process and maintain the connection.

Actual Behavior

The Claude Code process exits immediately with code 1, and the session cannot be established.

Additional Context

  • Full doctor log attached: codepilot-doctor-2026-03-16.json
  • The issue appears to be related to how CodePilot spawns child processes, possibly related to the DEP0190 warning
    about shell argument handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-confirmation等用户确认最新版是否仍复现old-version旧版本反馈,需最新版复测

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions