Skip to content

Sidecar ports, worktree sidecars, a shared cache and depends_on scoping - #2

Merged
rtibbles merged 2 commits into
mainfrom
sidecar-ports
Nov 20, 2026
Merged

rtibbles merged 2 commits into
mainfrom
sidecar-ports

Conversation

@rtibbles

@rtibbles rtibbles commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A target's x-agent.ports key may name a sidecar ("gcs:4443"); its host port is published on 127.0.0.1 and handed to the target in env. The gateway listens on each forward's host port, so the same port on the target and a sidecar can't collide.
  • worktree_sidecars: [lod] mounts the worktree and git dirs into a sidecar and runs it as the invoking user.
  • cache: /path is one volume per namespace, repo and target, shared by every instance; no stop, purge or reap removes it, and status prints its name.
  • A target with depends_on starts only the sidecars it names; ports and worktree_sidecars must name one of them.

References

Reviewer guidance

  • Unit tests and the podman live suite pass; the Docker variants are unrun (no usable Docker here), so rootful Docker's --user worktree sidecars and cache chown are unexercised.
  • Check the cache name (ac-<ns>-cache-<repo>-<target>-<hash>) and that --local keys it on the worktree path, never sharing the published cache.

AI usage

Claude Code wrote this to a design I approved; verified by unit tests and the podman live suite.

🤖 Generated with Claude Code

https://claude.ai/code/session_013PjXpd9XvF5sFr4aVpnjZj

A `ports` key may name a sidecar (`"gcs:4443"`): the host port is
published on 127.0.0.1, the gateway forwards it to that sidecar, and the
target gets it in `env`. The gateway now listens on each forward's host
port, so the same port number on the target and a sidecar can't collide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013PjXpd9XvF5sFr4aVpnjZj
- `worktree_sidecars: [lod]` mounts the worktree and git dirs into a
  sidecar and runs it as the invoking user, like the target.
- `cache: /path` is one volume per namespace, repo and target, shared by
  every instance; no stop, purge or reap removes it.
- A target with `depends_on` starts only the sidecars it names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013PjXpd9XvF5sFr4aVpnjZj
@rtibbles rtibbles changed the title Forward a sidecar's port from a target's x-agent.ports Sidecar ports, worktree sidecars, a shared cache and depends_on scoping Nov 20, 2026
@rtibbles
rtibbles merged commit c22adf7 into main Nov 20, 2026
4 checks passed
@rtibbles
rtibbles deleted the sidecar-ports branch November 20, 2026 22:25
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