Skip to content

fix(sdk): use ephemeral ports for Parlant servers#341

Open
darvell-thenvoi wants to merge 4 commits into
mainfrom
fix/parlant-port-collision-INT-530
Open

fix(sdk): use ephemeral ports for Parlant servers#341
darvell-thenvoi wants to merge 4 commits into
mainfrom
fix/parlant-port-collision-INT-530

Conversation

@darvell-thenvoi

@darvell-thenvoi darvell-thenvoi commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

What changed

Parlant examples and test fixtures now start in-process Parlant servers with OS-assigned ephemeral ports:

p.Server(
    port=0,
    tool_service_port=0,
    nlp_service=p.NLPServices.openai,
)

This avoids collisions when multiple Parlant agents run at the same time, such as the Tom and Jerry examples.

The generic example runner also now exposes Parlant directly:

  • uv run python examples/run_agent.py --example parlant
  • uv run python examples/run_agent.py --example parlant --streaming

The Parlant docs and runner error message now point repo users at the current uv sync --extra dev setup.

Why

Parlant's default server ports are fixed. Starting more than one in-process Parlant server can make the second process fail to bind. Passing port=0 and tool_service_port=0 lets the OS pick available ports for each server, so the examples and E2E setup do not need hardcoded or manually coordinated port numbers.

Validation

uv run ruff check \
  examples/parlant/*.py examples/run_agent.py \
  src/band/adapters/parlant.py src/band/integrations/parlant/tools.py \
  tests/adapters/test_parlant_adapter.py tests/e2e/adapters/test_parlant.py \
  tests/framework_conformance/test_tool_name_drift.py \
  tests/integrations/parlant/test_tools.py tests/test_run_agent.py

uv run ruff format --check \
  examples/parlant/*.py examples/run_agent.py \
  src/band/adapters/parlant.py src/band/integrations/parlant/tools.py \
  tests/adapters/test_parlant_adapter.py tests/e2e/adapters/test_parlant.py \
  tests/framework_conformance/test_tool_name_drift.py \
  tests/integrations/parlant/test_tools.py tests/test_run_agent.py

uv run --extra dev pytest \
  tests/test_run_agent.py \
  tests/adapters/test_parlant_adapter.py \
  tests/integrations/parlant/test_tools.py \
  tests/framework_conformance/test_tool_name_drift.py -q
# 87 passed, 1 skipped

uv run --extra dev pytest tests/test_run_agent.py -q
# 4 passed

Closes INT-530

@linear

linear Bot commented Jun 3, 2026

Copy link
Copy Markdown

INT-530

@darvell-thenvoi darvell-thenvoi changed the title Fix Parlant example port collisions Port Parlant validation into Band branch Jun 3, 2026
@darvell-thenvoi darvell-thenvoi changed the title Port Parlant validation into Band branch fix(sdk): port Parlant validation into Band branch Jun 3, 2026
@darvell-thenvoi darvell-thenvoi changed the title fix(sdk): port Parlant validation into Band branch fix(sdk): port Parlant validation and use ephemeral ports Jun 3, 2026
@darvell-thenvoi darvell-thenvoi marked this pull request as ready for review June 3, 2026 19:41
@darvell-thenvoi darvell-thenvoi changed the title fix(sdk): port Parlant validation and use ephemeral ports fix(sdk): use ephemeral ports for Parlant servers Jun 3, 2026
Base automatically changed from rename-band-sdk-python to dev June 4, 2026 16:24
@darvell-thenvoi darvell-thenvoi force-pushed the fix/parlant-port-collision-INT-530 branch from c54eb0c to 60f93d3 Compare June 4, 2026 20:47
Base automatically changed from dev to main June 22, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant