Skip to content

acp: http_bind config field ignored, server always binds to default port #3290

@bug-ops

Description

@bug-ops

Description

When starting the ACP HTTP server via config autostart ([acp] transport = \"http\" or transport = \"both\"), the http_bind field from [acp] is silently ignored. The server always binds to the hardcoded default 127.0.0.1:9800.

Reproduction Steps

  1. Set in config: [acp]\ntransport = \"http\"\nhttp_bind = \"127.0.0.1:9811\"
  2. Run: cargo run --features full -- --config <config>
  3. Observe: server starts on 127.0.0.1:9800, not 9811

Expected Behavior

Server binds to the address specified in [acp] http_bind.

Actual Behavior

Server always binds to 127.0.0.1:9800 (hardcoded default in run_acp_http_server).

Root Cause

In src/runner.rs, when run_acp_http_server is called via autostart path (AcpTransport::Http / AcpTransport::Both), bind_override is passed as None (lines 206, 228). Inside run_acp_http_server (src/acp.rs:1348):

let bind_addr = bind_override.map_or_else(|| "127.0.0.1:9800".to_owned(), str::to_owned);

app.config().acp.http_bind is loaded into the AcpConfig struct (field exists, deserialized correctly), but is never consulted when determining the bind address. The config field is only displayed in /acp status output — never actually applied.

The CLI path (--acp-http --acp-http-bind <addr>) works correctly because it passes the CLI override explicitly; the autostart path has no equivalent.

Fix

In run_acp_http_server, fall back to app.config().acp.http_bind when bind_override is None:

let bind_addr = bind_override
    .map(str::to_owned)
    .unwrap_or_else(|| app.config().acp.http_bind.clone());

Environment

  • Feature flags: acp-http
  • Relevant code: src/acp.rs:1348, src/runner.rs:200-210, crates/zeph-config/src/ui.rs:317

Logs / Evidence

CI-604 live session: config had http_bind = "127.0.0.1:9811", server started and accepted connections only on port 9800. Confirmed by curl http://127.0.0.1:9811/health → connection refused, curl http://127.0.0.1:9800/health → 200 OK.

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions