Skip to content

managed workers strand on non-default engine ports: spawn chain doesn't forward the manager port, and several worker builds ignore the injected engine URL #526

Description

@paulefde

Summary

Running the engine on a non-default iii-worker-manager port (anything
other than 49134) strands most managed registry workers in a
connect-retry loop against ws://127.0.0.1:49134. Three separate links in
the spawn chain contribute:

  1. The engine spawns iii-worker worker-manager-daemon without passing
    --engine, so the daemon dials its default ws://127.0.0.1:49134
    even though env (III_URL, III_ENGINE_URL) points at the real port.
  2. iii-worker start --port documents that "the engine passes its
    configured iii-worker-manager port when auto-spawning external workers so
    non-default manager ports don't silently break connectivity" — but on the
    daemon-mediated spawn path the port never reaches the worker process.
  3. Several current worker builds ignore the engine URL the spawn chain
    injects and fall back to the compiled-in default. Observed on engine
    0.21.6 (macOS arm64): harness@1.3.3, session-manager@1.0.5,
    context-manager@1.0.4, iii-directory@1.0.3, web@1.2.2,
    queue@0.2.2 all retry 49134; llm-router@1.1.1,
    provider-anthropic@1.1.1, provider-openai@1.1.1 (rebuilt against the
    0.21.6 SDK on 2026-07-14) connect correctly. Manually launching
    ~/.iii/workers/harness with III_WS_URL=ws://127.0.0.1:<port> connects
    fine, so the binaries are port-capable — they just never receive the
    value they read.

Reproduction (engine 0.21.6, macOS arm64)

  1. config.yaml with iii-worker-manager: { port: 3034 } (any non-default)
    plus registry workers including harness and session-manager.
  2. Start the engine. llm-router and the providers register; harness,
    session-manager, web, queue, context-manager, iii-directory
    log iii_sdk::iii: failed to connect; retrying error=IO error: Connection refused until their startup deadline, then die (harness exits
    with configuration::get failed after 3 attempts).
  3. ps shows the daemon as iii-worker worker-manager-daemon with no
    --engine argument, while its environment carries the correct
    III_URL/III_ENGINE_URL.

Expected

A non-default manager port should propagate through the entire spawn chain:
engine → daemon (--engine) → worker process (whatever env/flag the worker
build reads), with the worker builds honoring the injected URL rather than
the compiled default.

Why it matters

Multi-worktree / multi-engine dev setups remap ports per checkout by
design; today any such setup silently loses the whole managed-worker fleet
except the three newest builds. Our current workaround is a local TCP proxy
aliasing 49134 to the real engine port plus a wrapper script that appends
--engine to the daemon spawn — both of which we would love to delete.

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