Skip to content

opencode acp server exits immediately after startup #22795

Closed

Description

@teng2-doudou

opencode ACP Server Bug Report

Bug Description

opencode acp command exits immediately after starting, making it impossible to use as an ACP server.

Environment

  • opencode version: 1.4.3
  • OS: macOS (Darwin)
  • Node.js: v25.6.1

Steps to Reproduce

  1. Run opencode ACP server:
opencode acp --port 18100 --print-logs
  1. Observe the logs:
INFO  service=acp-command setup connection
INFO  service=default directory=/path/to/project disposing instance
  1. Process exits with code 0 immediately after "setup connection"

Expected Behavior

opencode acp should start an ACP server and keep running, listening for ACP client connections.

Actual Behavior

The server starts, sets up the ACP connection, then immediately disposes the instance and exits.

Use Case

Trying to use opencode as an ACP harness with OpenClaw's acpx backend for agent orchestration.

Configuration Used

acpx config (~/.acpx/config.json)

{
  "defaultAgent": "opencode",
  "agents": {
    "opencode": {
      "command": "opencode acp",
      "url": "http://127.0.0.1:18100",
      "cwd": "/path/to/project"
    }
  }
}

OpenClaw ACP config

{
  "acp": {
    "enabled": true,
    "backend": "acpx",
    "defaultAgent": "opencode",
    "allowedAgents": ["opencode"]
  }
}

Additional Context

  • The opencode run command works perfectly for executing tasks
  • Only the opencode acp server mode has this issue
  • Tried different ports, with/without --print-logs, same result

Request

Please fix opencode acp to keep running as a persistent ACP server, or provide documentation on the correct way to use it as an ACP harness.

Activity

  1. added
    core
    on Apr 16, 2026
  2. removed
    core
    on May 3, 2026
  3. rekram1-node commented on May 7, 2026

    @rekram1-node
    Member

    Need more info, this doesnt happen for me and we have extensions like zed ACP that utilize this same command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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