Skip to content

[codex] feat(docker): add portable agent environment - #6583

Closed
mtdewwolf wants to merge 5 commits into
pingdotgg:mainfrom
mtdewwolf:codex/add-docker-deployment
Closed

[codex] feat(docker): add portable agent environment#6583
mtdewwolf wants to merge 5 commits into
pingdotgg:mainfrom
mtdewwolf:codex/add-docker-deployment

Conversation

@mtdewwolf

@mtdewwolf mtdewwolf commented Aug 14, 2026

Copy link
Copy Markdown

Problem

T3 Code does not have a first-party container deployment for a persistent remote environment. A container also cannot see provider CLIs or subscription login state installed on the host, and copying those credentials into an image or repository would expose them through the build context or image history.

Changes

  • add a multi-stage, non-root Docker image that builds the T3 server and web client and installs Codex, Claude Code, Cursor Agent, and OpenCode
  • add a Compose service with a stable environment hostname, a separately mounted workspace, and a persistent home volume for runtime-created T3 and provider state
  • document browser pairing, subscription login inside the container, networking, permissions, configuration, and destructive volume removal
  • ignore provider login databases, auth files, SSH material, environment files, and package-manager credentials in both Git and Docker build contexts
  • add Dockerfile defense-in-depth checks that fail a build if known credential paths reach the builder
  • add focused configuration tests and a Docker E2E workflow for pull requests and main

Verification

  • vp test run scripts/docker-config.test.ts
  • vp run --filter @t3tools/scripts typecheck
  • targeted vp fmt ... --check
  • docker compose -f compose.yaml config --quiet
  • node scripts/docker-e2e.ts
    • injects synthetic provider credentials into the local build context and verifies Docker excludes them
    • builds the production server and web client from source
    • verifies the runtime image is non-root and contains no credential paths or secret-valued environment entries
    • starts the real Compose service and checks the environment descriptor and web client
    • verifies workspace write-through, stable environment identity, and provider-state persistence across forced container recreation
    • verifies the Docker socket is not mounted and removes all synthetic state afterward
  • scanned all staged blobs for credential-like values; no findings

Generated with GPT-5.6 Sol in the Codex harness through T3 Code.

Note

Add portable Docker agent environment with multi-stage build and E2E tests

  • Adds a Dockerfile with a multi-stage build: a builder stage compiles web and server bundles, a runtime stage runs as non-root (node) on port 3773 with optional provider CLIs and a healthcheck.
  • Adds compose.yaml that binds a named volume for /home/node state and a configurable workspace bind mount, so docker compose up starts the full stack.
  • Adds .dockerignore that excludes host credentials, caches, and build artifacts to prevent secret leakage into images.
  • Adds a comprehensive E2E test in scripts/docker-e2e.ts that validates build isolation, provider binary presence, container readiness, credential persistence across recreation, and workspace write-through.
  • Adds repository-level config tests in scripts/docker-config.test.ts and a CI workflow in .github/workflows/docker.yml that runs these on relevant file changes.

Macroscope summarized ef54db0.


Note

Medium Risk
New deployment surface and build-time fetches (npm globals, Cursor installer) affect supply chain and how secrets might leak via image layers; mitigated by ignore rules, builder checks, and E2E canary tests rather than changes to core auth/runtime code paths.

Overview
Adds a first-party Docker distribution so T3 Code can run headless in an isolated container with bundled provider CLIs and persistent state.

A multi-stage Dockerfile builds the server and web client, deploys production artifacts, and ships a non-root runtime (node) on port 3773 with optional global installs for Codex, Claude Code, OpenCode, and Cursor Agent. The builder fails the build if credential paths (.env, provider auth files, SSH, etc.) appear in the build context.

compose.yaml wires a t3 service with a t3-home volume for /home/node (T3 + provider logins) and a bind-mounted workspace at /workspace, plus env knobs for hostname, bind address, and provider install toggles.

Security hardening extends .dockerignore and .gitignore for machine-local credentials; docs (docs/user/docker.md) cover pairing, in-container provider login, and networking.

CI and tests: scripts/docker-config.test.ts asserts ignore rules, compose shape, and Dockerfile invariants; scripts/docker-e2e.ts (and pnpm test:docker) builds with synthetic credential canaries, verifies they never land in the image, exercises the real Compose stack (health, web client, volume persistence across recreate, no Docker socket), and .github/workflows/docker.yml runs that E2E on relevant path changes.

Reviewed by Cursor Bugbot for commit ef54db0. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 158c1c68-3a73-44b2-9eda-9d8142f0b22c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 14, 2026
Comment thread scripts/docker-e2e.ts Outdated
@mtdewwolf
mtdewwolf marked this pull request as ready for review August 18, 2026 21:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5bb220272

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +10 to +12
- package.json
- pnpm-lock.yaml
- apps/server/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Trigger Docker E2E for every build input

The workflow watches pnpm-lock.yaml but omits pnpm-workspace.yaml and patches/**, even though the Dockerfile copies both before installation. A change to workspace dependency/build configuration or to a patch applied during pnpm install can therefore break the image while this Docker E2E job is skipped; include all direct build inputs in both the pull-request and push path filters.

Useful? React with 👍 / 👎.

Comment thread scripts/docker-e2e.ts
@macroscopeapp

macroscopeapp Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a complete Docker deployment environment with Dockerfile, Compose orchestration, CI workflow, E2E testing, and documentation (~800 new lines). New deployment infrastructure of this scope warrants human review to verify security configurations, credential handling, and operational correctness.

You can add or adjust custom eligibility rules. Learn more.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ef54db0. Configure here.

- packages/**
- scripts/docker-config.test.ts
- scripts/docker-e2e.ts
- .github/workflows/docker.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI skips Docker build script inputs

Medium Severity

The Docker E2E path filters omit scripts/lib/** and the root Vite config even though the image build loads those files when packing the server and building the web client. Changes there can ship a broken image without this workflow running.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ef54db0. Configure here.

@t3dotgg

t3dotgg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

Closing this PR after an automated pass over open pull requests. Adds a new unsupported distribution or deployment system that increases ongoing maintenance.

@t3dotgg t3dotgg closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants