Skip to content

session/prompt fails silently when session limit is reached #146

@xenodium

Description

@xenodium

Hi folks! Thank you for building claude-code-acp. Big fan. It's been working great with agent-shell. From time to time, I run into a snag...

When Claude Code's Session limit is reached for the current subscription, the session/prompt request fails silently. That is, stopReason is end_turn and no output givent. There are no errors reported anywhere, as far as I can see (including stderr). Should I be looking elsewhere, so I can surface this issue to users?

Below is the entire exchange between agent-shell and claude-code-acp, including a tiny bit of stderr. Lemme know if there's anything else I can provide.

initialize

{
  "jsonrpc": "2.0",
  "method": "initialize",
  "id": 1,
  "params": {
    "protocolVersion": 1,
    "clientCapabilities": {
      "fs": {
        "readTextFile": true,
        "writeTextFile": true
      }
    }
  }
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": 1,
    "agentCapabilities": {
      "promptCapabilities": {
        "image": true,
        "embeddedContext": true
      },
      "mcpCapabilities": {
        "http": true,
        "sse": true
      }
    },
    "agentInfo": {
      "name": "@zed-industries/claude-code-acp",
      "title": "Claude Code",
      "version": "0.10.0"
    },
    "authMethods": [
      {
        "description": "Run `claude /login` in the terminal",
        "name": "Log in with Claude Code",
        "id": "claude-login"
      }
    ]
  }
}

session/new

{
  "jsonrpc": "2.0",
  "method": "session/new",
  "id": 2,
  "params": {
    "cwd": "path/to/project/dir/",
    "mcpServers": []
  }
}
Spawning Claude Code process: /opt/homebrew/Cellar/node/24.8.0/bin/node /opt/homebrew/lib/node_modules/@zed-industries/claude-code-acp/node_modules/@anthropic-ai/claude-agent-sdk/cli.js --output-format stream-json --verbose --input-format stream-json --permission-prompt-tool stdio --allowedTools mcp__acp__Read --disallowedTools Read,Write,Edit --mcp-config {"mcpServers":{"acp":{"type":"sdk","name":"acp"}}} --setting-sources user,project,local --permission-mode default --allow-dangerously-skip-permissions --include-partial-messages
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "sessionId": "019a5e9b-8ff5-711f-ba7b-23a10043da78",
    "models": {
      "availableModels": [
        {
          "modelId": "default",
          "name": "Sonnet",
          "description": "Sonnet 4.5 · Smartest model for daily use · $3/$15 per Mtok"
        },
        {
          "modelId": "haiku",
          "name": "Haiku",
          "description": "Haiku 4.5 · Fastest model for simple tasks"
        }
      ],
      "currentModelId": "default"
    },
    "modes": {
      "currentModeId": "default",
      "availableModes": [
        {
          "id": "default",
          "name": "Always Ask",
          "description": "Prompts for permission on first use of each tool"
        },
        {
          "id": "acceptEdits",
          "name": "Accept Edits",
          "description": "Automatically accepts file edit permissions for the session"
        },
        {
          "id": "plan",
          "name": "Plan Mode",
          "description": "Claude can analyze but not modify files or execute commands"
        },
        {
          "id": "bypassPermissions",
          "name": "Bypass Permissions",
          "description": "Skips all permission prompts"
        }
      ]
    }
  }
}
{
  "jsonrpc": "2.0",
  "method": "session/update",
  "params": {
    "sessionId": "019a5e9b-8ff5-711f-ba7b-23a10043da78",
    "update": {
      "sessionUpdate": "available_commands_update",
      "availableCommands": [
        {
          "name": "compact",
          "description": "Clear conversation history but keep a summary in context. Optional: /compact [instructions for summarization]",
          "input": {
            "hint": "<optional custom summarization instructions>"
          }
        },
        {
          "name": "init",
          "description": "Initialize a new CLAUDE.md file with codebase documentation",
          "input": null
        },
        {
          "name": "pr-comments",
          "description": "Get comments from a GitHub pull request",
          "input": null
        },
        {
          "name": "review",
          "description": "Review a pull request",
          "input": null
        },
        {
          "name": "security-review",
          "description": "Complete a security review of the pending changes on the current branch",
          "input": null
        }
      ]
    }
  }
}

session/prompt

{
  "jsonrpc": "2.0",
  "method": "session/prompt",
  "id": 3,
  "params": {
    "sessionId": "019a5e9b-8ff5-711f-ba7b-23a10043da78",
    "prompt": [
      {
        "type": "text",
        "text": "hello"
      }
    ]
  }
}
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "stopReason": "end_turn"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions