docker/edge/dispatcher.sh: switch dynamic .claude mounts to shared CLAUDE_CONFIG_DIR #643

Closed
opened 2026-04-10 18:54:51 +00:00 by dev-bot · 0 comments
Collaborator

Context

docker/edge/dispatcher.sh builds dynamic docker run commands for ephemeral agent containers. Six call sites currently mount ${runtime_home}/.claude into the spawned containers, with the same cross-container OAuth lock race as in the static compose services.

Issue #641 introduces the shared CLAUDE_CONFIG_DIR convention. This issue propagates it into dispatcher.sh.

Files to change

  • docker/edge/dispatcher.sh — six -v ${runtime_home}/.claude:/home/agent/.claude constructions, located approximately at lines 446-450, 631-635, 756-760, 957-961.

Specification

At each of the six call sites:

  1. Replace the conditional .claude mount:

    if [ -d "${runtime_home}/.claude" ]; then
      cmd+=(-v "${runtime_home}/.claude:/home/agent/.claude")
    fi
    

    with:

    if [ -d "${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}" ]; then
      cmd+=(-v "${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}:${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}")
      cmd+=(-e "CLAUDE_CONFIG_DIR=${CLAUDE_CONFIG_DIR:-/var/lib/disinto/claude-shared/config}")
    fi
    
  2. Keep the .claude.json ro mount as-is (the block immediately following each .claude mount). It's a settings file, not OAuth tokens.

  3. Do not introduce a new helper function for this; six call sites is fine to touch directly. (If a helper feels warranted in passing, that's a follow-up — not this issue.)

Definition of done

  • All six call sites updated
  • Shellcheck passes (the repo has a .shellcheckrc)
  • disinto run <some-action-id> smoke test: spawned container has CLAUDE_CONFIG_DIR in env and the shared dir is mounted at the expected path
  • No ${runtime_home}/.claude:/home/agent/.claude mount construction remains

Out of scope / do not touch

  • lib/agent-sdk.sh external flock wrapper (vision issue)
  • docker-compose.yml (separate backlog issue)
  • docker/agents/entrypoint.sh creds detection (separate backlog issue)
  • The .claude.json ro mount

Dependencies

Blocked by #641 (disinto init bootstraps CLAUDE_CONFIG_DIR). Do not start until lib/env.sh exports the env vars.

## Context `docker/edge/dispatcher.sh` builds dynamic `docker run` commands for ephemeral agent containers. Six call sites currently mount `${runtime_home}/.claude` into the spawned containers, with the same cross-container OAuth lock race as in the static compose services. Issue #641 introduces the shared `CLAUDE_CONFIG_DIR` convention. This issue propagates it into dispatcher.sh. ## Files to change - `docker/edge/dispatcher.sh` — six `-v ${runtime_home}/.claude:/home/agent/.claude` constructions, located approximately at lines **446-450**, **631-635**, **756-760**, **957-961**. ## Specification At each of the six call sites: 1. **Replace** the conditional `.claude` mount: ```bash if [ -d "${runtime_home}/.claude" ]; then cmd+=(-v "${runtime_home}/.claude:/home/agent/.claude") fi ``` **with**: ```bash if [ -d "${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}" ]; then cmd+=(-v "${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}:${CLAUDE_SHARED_DIR:-/var/lib/disinto/claude-shared}") cmd+=(-e "CLAUDE_CONFIG_DIR=${CLAUDE_CONFIG_DIR:-/var/lib/disinto/claude-shared/config}") fi ``` 2. **Keep** the `.claude.json` ro mount as-is (the block immediately following each `.claude` mount). It's a settings file, not OAuth tokens. 3. **Do not** introduce a new helper function for this; six call sites is fine to touch directly. (If a helper feels warranted in passing, that's a follow-up — not this issue.) ## Definition of done - [ ] All six call sites updated - [ ] Shellcheck passes (the repo has a `.shellcheckrc`) - [ ] `disinto run <some-action-id>` smoke test: spawned container has `CLAUDE_CONFIG_DIR` in env and the shared dir is mounted at the expected path - [ ] No `${runtime_home}/.claude:/home/agent/.claude` mount construction remains ## Out of scope / do not touch - `lib/agent-sdk.sh` external flock wrapper (vision issue) - `docker-compose.yml` (separate backlog issue) - `docker/agents/entrypoint.sh` creds detection (separate backlog issue) - The `.claude.json` ro mount ## Dependencies **Blocked by #641** (disinto init bootstraps CLAUDE_CONFIG_DIR). Do not start until `lib/env.sh` exports the env vars.
dev-bot added the
backlog
label 2026-04-10 18:54:51 +00:00
dev-bot self-assigned this 2026-04-10 20:43:04 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-10 20:43:04 +00:00
dev-bot removed their assignment 2026-04-10 20:49:13 +00:00
dev-bot removed the
in-progress
label 2026-04-10 20:49:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#643
No description provided.