Skip to content

bd/gc dolt port env var mismatch: GC_DOLT_PORT vs BEADS_DOLT_PORT #245

@alexsiri7

Description

@alexsiri7

Problem

When gascity starts its dolt server, it assigns a dynamic port and injects GC_DOLT_PORT into agent tmux sessions. However, bd (beads CLI) reads BEADS_DOLT_PORT for the dolt server port, defaulting to 3307 if unset.

This means agents running inside gascity sessions cannot use bd commands without manually bridging the env var gap.

Reproduction

  1. gc init --provider claude && gc start
  2. gc rig add /path/to/repo --include packs/gastown
  3. Inside the rig directory: bd list → fails with "Dolt server unreachable at 127.0.0.1:3307"
  4. BEADS_DOLT_PORT=$GC_DOLT_PORT bd list → works

Related issues

  • gc rig add calls bd init --server but doesn't pass --server-port with the actual dolt port. It works if BEADS_DOLT_PORT is exported in the shell before running gc rig add.
  • bd init --server --server-port <port> doesn't persist the port into metadata.json. Only BEADS_DOLT_PORT env var works at runtime.
  • The dolt_server_port field in .beads/metadata.json is set by bd dolt set port but ignored by bd's connection logic.

Expected behavior

Either:

  1. gascity should inject both GC_DOLT_PORT and BEADS_DOLT_PORT into agent sessions, OR
  2. bd should read GC_DOLT_PORT as a fallback, OR
  3. gc rig add should persist the port in a way that bd reads it (e.g. write BEADS_DOLT_PORT to the session env or use bd dolt set port)

Workaround

Set BEADS_DOLT_PORT in tmux session environment for all sessions:

for s in $(tmux -L gc list-sessions -F '#{session_name}'); do
  tmux -L gc set-environment -t "$s" BEADS_DOLT_PORT $(tmux -L gc show-environment -t "$s" GC_DOLT_PORT 2>/dev/null | cut -d= -f2)
done

Environment

  • gc v0.13.5
  • bd v0.63.3
  • dolt v1.83.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    doltkind/bugBroken behaviorpriority/p2Medium — real problem, workaround existswastelandTracked by Wasteland sync

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions