GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: added configurable base directory. by mcking-07 · Pull Request #826 · pingdotgg/t3code

Conversation

@mcking-07

@mcking-07 mcking-07 commented Mar 10, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What Changed

Added a configurable base directory for T3 Code data storage via:

  • T3CODE_BASE_DIR environment variable
  • --base-dir CLI flag

The base directory defaults to ~/.t3, with the following paths now relative to baseDir:

  • userdata -> application state and SQLite database
  • worktrees -> git worktree directories (existing, now uses baseDir)

Path precedence:

  • baseDir: CLI (--base-dir) > env (T3CODE_BASE_DIR) > default (~/.t3)
  • stateDir: CLI (--state-dir) > env (T3CODE_STATE_DIR) > default (<baseDir>/userdata)

Note: If stateDir is set explicitly (via CLI or env), it takes full priority and can be anywhere, independent of baseDir.

Changes include:

  • Add baseDir to ServerConfigShape
  • Add resolveBaseDir() for base directory resolution
  • Update resolveStateDir() to accept baseDir parameter
  • Add --base-dir flag to CLI (server + dev-runner)
  • Add T3CODE_BASE_DIR env var support
  • Update all test layers to include baseDir

Why

Previously, all T3 Code data (worktrees, userdata, etc.) was hardcoded to ~/.t3. This change introduces T3CODE_BASE_DIR (--base-dir CLI flag) to allow users to customize the base directory.

This enables:

  • Storing data in a custom location (not ~/.t3)
  • Using different drives/volumes (external SSD, network mount, etc.)
  • CI/headless environments with non-standard paths
  • For users who prefer not to have a .t3 folder in their home directory cough myself cough

Fixes #748


Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Replace --state-dir/T3CODE_STATE_DIR with --home-dir/T3CODE_HOME as the configurable base directory

  • Introduces a baseDir concept (~/.t3 by default) from which all server paths (stateDir, dbPath, attachmentsDir, logsDir, worktreesDir, etc.) are deterministically derived via a new deriveServerPaths util in config.ts.
  • Renames the CLI flag from --state-dir to --home-dir and the env var from T3CODE_STATE_DIR to T3CODE_HOME across the server, desktop app, dev runner, and documentation.
  • All internal consumers (attachment resolution, SQLite path, terminal log path, worktree path, telemetry) now read pre-derived paths from ServerConfig instead of constructing paths by joining stateDir at call sites.
  • ServerConfig.layerTest is updated to accept a prefix option and create a temp base directory, replacing explicit stateDir arguments throughout the test suite.
  • Risk: T3CODE_STATE_DIR is no longer read; existing overrides using that env var will silently have no effect.

Macroscope summarized 1b462fd.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mohammed Muzammil Anwar and others added 2 commits March 10, 2026 23:18
Mohammed Muzammil Anwar
feat: add configurable base directory (~/.t3) with `T3CODE_BASE_DIR…
076e2b5
…` env and --base-dir flag.
@mcking-07
feat: add configurable base directory (~/.t3) with `T3CODE_BASE_DIR…
bef33cb
…` env and --base-dir flag.
Copilot AI review requested due to automatic review settings March 10, 2026 18:12
@coderabbitai

coderabbitai Bot commented Mar 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Run ID: 6e656027-8c0a-4f2d-97e2-b39053dffd4b

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Mar 10, 2026
Copilot started reviewing on behalf of mcking-07 March 10, 2026 18:13
View session
Copilot AI reviewed Mar 10, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Adds a configurable “base directory” for T3 Code data storage (~/.t3 by default), exposing it via T3CODE_BASE_DIR and a --base-dir CLI flag, and updates the server/dev-runner/test harnesses so state/worktrees paths become relative to this base.

Changes:

  • Introduce baseDir into server config and CLI/env resolution with documented precedence (--base-dir > T3CODE_BASE_DIR > default).
  • Move worktree location under <baseDir>/worktrees and make default state dir relative to base (<baseDir>/userdata).
  • Update dev-runner + extensive test layers/harnesses to pass and use baseDir.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
turbo.json Adds T3CODE_BASE_DIR to turbo global env passthrough.
scripts/dev-runner.ts Adds base dir flag/env support and resolves derived dev state dir.
scripts/dev-runner.test.ts Updates dev-runner env tests for new base dir behavior.
apps/server/src/wsServer.test.ts Extends test server options to include baseDir.
apps/server/src/telemetry/Layers/AnalyticsService.test.ts Updates test config layer to pass baseDir.
apps/server/src/provider/Layers/CodexAdapter.test.ts Updates ServerConfig.layerTest calls for new signature.
apps/server/src/os-jank.ts Adds resolveBaseDir + updates resolveStateDir to be base-dir aware.
apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts Updates ServerConfig.layerTest calls for new signature.
apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts Updates harness to manage temp base dirs and pass baseDir.
apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts Updates projection pipeline test layers to include baseDir and temp dir cleanup.
apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts Updates ServerConfig.layerTest calls for new signature.
apps/server/src/orchestration/Layers/CheckpointReactor.test.ts Updates ServerConfig.layerTest calls for new signature.
apps/server/src/main.ts Adds --base-dir + T3CODE_BASE_DIR env parsing and resolves base/state dirs with precedence.
apps/server/src/git/Layers/GitManager.test.ts Provides ServerConfig layer to satisfy GitCore’s new dependency.
apps/server/src/git/Layers/GitCore.ts Moves default worktrees directory under <baseDir>/worktrees.
apps/server/src/git/Layers/GitCore.test.ts Provides ServerConfig layer for GitCore tests.
apps/server/src/git/Layers/CodexTextGeneration.test.ts Updates test layer creation to pass baseDir/stateDir.
apps/server/src/config.ts Adds baseDir to ServerConfigShape and updates layerTest signature.
apps/server/integration/OrchestrationEngineHarness.integration.ts Updates integration harness to pass base dir into test config layer.
apps/desktop/src/main.ts Derives desktop state dir from T3CODE_BASE_DIR and forwards it to backend env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread scripts/dev-runner.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/desktop/src/main.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/git/Layers/CodexTextGeneration.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Mohammed Muzammil Anwar and others added 2 commits March 11, 2026 00:01
Mohammed Muzammil Anwar
fix: use path.join for constructing state directory path for consiste…
68c2267
…ncy.
@mcking-07
Merge branch 'pingdotgg:main' into main
dc8a93b
@juliusmarminge

juliusmarminge commented Mar 10, 2026

Copy link
Copy Markdown
Member

i feel like we have too many flags already 😆, would be down to just have T3_HOME and everything relative to that one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcking-07

mcking-07 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

nice, much cleaner... let me confirm the plan,

removing

  • --base-dir and --state-dir CLI flags
  • T3CODE_BASE_DIR env var
  • T3CODE_STATE_DIR env var

introducing

  • single T3_HOME (or T3CODE_HOME?) env var
  • --t3-home CLI flag (optional, for convenience)
  • defaults to ~/.t3
  • fixed structure:
    • $T3_HOME/userdata/ — SQLite, logs, app state
    • $T3_HOME/worktrees/ — git worktrees

quick question on naming... should I go with T3_HOME (shorter) or T3CODE_HOME (consistent with T3CODE_PORT, T3CODE_HOST, etc.)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge

juliusmarminge commented Mar 10, 2026

Copy link
Copy Markdown
Member

quick question on naming... should I go with T3_HOME (shorter) or T3CODE_HOME (consistent with T3CODE_PORT, T3CODE_HOST, etc.)?

T3CODE_HOME sounds good. as for cli flag we don't need to have the t3- prefix. just --home-dir (or does that cuas confusion thinking it'll override OS.homedir() ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcking-07

mcking-07 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

T3CODE_HOME 👍

or does that cuas confusion thinking it'll override OS.homedir()

--home-dir works for me. it should be clear enough given the context. alternative: --data-dir if you want to avoid any confusion?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mohammed Muzammil Anwar
feat: simplify base directory config to single T3CODE_HOME env var …
b76be31
…and `--home-dir` flag.
@mcking-07

mcking-07 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

@juliusmarminge, i have updated the PR to use the simplified approach we discussed:

changes made:

  • removed T3CODE_BASE_DIR, T3CODE_STATE_DIR env vars and --base-dir, --state-dir flags
  • introduced T3CODE_HOME env var and --home-dir flag

behavior:

  • defaults to ~/.t3
  • all paths are derived from it:
    • dev - dev-runner state (for development mode)
    • userdata - app state, sqlite, logs
    • worktrees - git worktrees
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@binbandit

binbandit commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Can we update the pr title based on the current solution please

mcking-07 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcking-07 mcking-07 changed the title feat: add configurable base directory (~/.t3) with T3CODE_BASE_DIR env and --base-dir flag. Fixes #748 feat: add configurable base directory (~/.t3) with T3CODE_HOME env and --home-dir flag. Fixes #748 Mar 10, 2026
@binbandit

binbandit commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Lets change the title to: feat: added configurable base directory -- short sharp clean.

mcking-07 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcking-07 mcking-07 changed the title feat: add configurable base directory (~/.t3) with T3CODE_HOME env and --home-dir flag. Fixes #748 feat: added configurable base directory. Mar 11, 2026
Mohammed Muzammil Anwar and others added 2 commits March 11, 2026 22:12
Mohammed Muzammil Anwar
enhance state directory resolution to handle dev mode.
b1cb068
@mcking-07
Merge branch 'main' into main
e245aeb
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Mar 13, 2026
@maria-rcks
maria-rcks requested a review from juliusmarminge March 15, 2026 19:53
mcking-07 added 2 commits March 19, 2026 01:54
@mcking-07
Merge branch 'main' into main
6de5527
@mcking-07
Merge branch 'main' into main
721a51a
@juliusmarminge

juliusmarminge commented Mar 20, 2026

Copy link
Copy Markdown
Member

description is outdated?

Note: If stateDir is set explicitly (via CLI or env), it takes full priority and can be anywhere, independent of baseDir.

looks to me like we replace stateDir, correct?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mohammed Muzammil Anwar
fix(tests): add baseDir option to makeHarness function to claude adap…
517c1ef
…ter tests.
@mcking-07

mcking-07 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

description is outdated?

yes, description is outdated, #826 (comment) would be updated description...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
remove state dir and add derivation helpers
1dca637
@github-actions github-actions Bot removed the size:L 100-499 changed lines (additions + deletions). label Mar 20, 2026
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Mar 20, 2026
juliusmarminge added 2 commits March 20, 2026 14:42
@juliusmarminge
simp
cd906ee
@juliusmarminge
nit
4200a39
@juliusmarminge

juliusmarminge commented Mar 20, 2026

Copy link
Copy Markdown
Member

@macroscope-app review this

macroscopeapp[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 2 commits March 20, 2026 14:59
@juliusmarminge
cool
5d09b38
@juliusmarminge
lint
1b462fd
@juliusmarminge
juliusmarminge merged commit 9e29c9d into pingdotgg:main Mar 20, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

aaditagrawal pushed a commit to aaditagrawal/t3code that referenced this pull request Mar 21, 2026
@mcking-07 Mohammed Muzammil Anwar
@juliusmarminge @aaditagrawal
feat: added configurable base directory. (pingdotgg#826)
d10016d
Co-authored-by: Mohammed Muzammil Anwar <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
@aaditagrawal aaditagrawal mentioned this pull request Mar 21, 2026
Upstream sync: provider registry, configurable base dir, UI fixes aaditagrawal/t3code#30
Merged
7 tasks
apexsloth pushed a commit to apexslothforks/t3code that referenced this pull request Mar 26, 2026
@mcking-07 Mohammed Muzammil Anwar
@juliusmarminge @apexsloth
feat: added configurable base directory. (pingdotgg#826)
5f3895e
Co-authored-by: Mohammed Muzammil Anwar <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
youpele52 referenced this pull request in youpele52/bigbud Jun 17, 2026
@mcking-07 Mohammed Muzammil Anwar @juliusmarminge
feat: added configurable base directory. (#826)
efd5cd9
Co-authored-by: Mohammed Muzammil Anwar <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
dcherrera pushed a commit to dcherrera/t3code that referenced this pull request Jul 7, 2026
@mcking-07 Mohammed Muzammil Anwar @juliusmarminge
feat: added configurable base directory. (pingdotgg#826)
79b09d8
Co-authored-by: Mohammed Muzammil Anwar <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Aug 18, 2026
@mcking-07 Mohammed Muzammil Anwar @juliusmarminge
feat: added configurable base directory. (pingdotgg#826)
9fdca5a
Co-authored-by: Mohammed Muzammil Anwar <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
@repparw repparw mentioned this pull request Sep 8, 2026
Honor XDG Base Directory paths on Linux #10810
Closed
@tannerpolley tannerpolley mentioned this pull request Oct 24, 2026
Repository orchestration keeps issues suspended after Resume ("Issue relationships are unreadable") once GitHub access is back tannerpolley/t3code#158
Closed
rynfar added a commit to rynfar/t3code that referenced this pull request Nov 20, 2026
@rynfar
fix(native): route multi-env PR follow-ups, per-env cursors, and zero…
6e541dc
…-slice fallback

Addresses all 3 blocking findings from PR #450 re-review (`pingdotgg#826`):
1. Preserve owning `environment_id` in `merge_fleet_list_results` (`entry_environments`) and route all PR follow-up reads, writes, HTTP diff fetches, and streams (`DetailView`, `CodeTab`, `GuideTab`, `LinkPreviewController`, `mutations`, `fetch_stats`, `fetch_options`, `refresh_from_host`, `ensure_row_stack`, `run_intent_prefetch`, `quick_action`) through `connections.destination(owner, ...)`. Gate `PullRequestsPage::sync` and `follow_refreshes` on fleet connectivity when fleet environments are present.
2. Track per-environment pagination cursors (`next_cursors_by_env`) and `truncated_envs` so `load_more` sends each server only its own cursors and skips servers with no remaining cursor or regrowth.
3. Prevent `fetch()` in fleet mode from falling through to the active `client_handle()` when zero fleet slices are dispatched (e.g. scoping to a project on an offline environment), and recover transiently errored fleet environments on reconnect, explicit Retry, or TTL expiry.
rynfar added a commit to rynfar/t3code that referenced this pull request Nov 20, 2026
@rynfar
feat(native): restore PR and diff parity for DF-PANEL, PR-PAGE, PR-DE…
84d4176
…TAIL (#450)

* feat(native): restore PR and diff parity for DF-PANEL, PR-PAGE, PR-DETAIL

* fix(native): address PR #450 review findings (fleet PR dedupe, rollback, clippy)

Addresses all 5 blocking findings from PR #450 review:
- Fix clippy warnings across workspace (`--all-targets -- -D warnings`): `is_multiple_of(3)` in `diff/fold.rs`, `CodeTabInit`, `LoadWithheldCallback`, `FleetInventory`, and `.flatten().flatten()` in `detail.rs`.
- Wire multi-environment fleet PR queries, unreachable-environment failover (`pingdotgg#34088`), and cross-server URL deduplication (`pingdotgg#37704`) into `PullRequestsPage`, with GPUI test coverage.
- Synchronously roll back optimistic batch label and reviewer mutations (and `Held` cache) on write failure before follow-up refresh.
- Clear sticky `DiffPanel::revealed_path` across external PR, connection, thread, and scope switches.
- Add Forgejo/Gitea `/pulls/` anchor routing (`pingdotgg#37703`) and pinned-first project filter ordering (`pingdotgg#29871`).

* fix(native): route multi-env PR follow-ups, per-env cursors, and zero-slice fallback

Addresses all 3 blocking findings from PR #450 re-review (`pingdotgg#826`):
1. Preserve owning `environment_id` in `merge_fleet_list_results` (`entry_environments`) and route all PR follow-up reads, writes, HTTP diff fetches, and streams (`DetailView`, `CodeTab`, `GuideTab`, `LinkPreviewController`, `mutations`, `fetch_stats`, `fetch_options`, `refresh_from_host`, `ensure_row_stack`, `run_intent_prefetch`, `quick_action`) through `connections.destination(owner, ...)`. Gate `PullRequestsPage::sync` and `follow_refreshes` on fleet connectivity when fleet environments are present.
2. Track per-environment pagination cursors (`next_cursors_by_env`) and `truncated_envs` so `load_more` sends each server only its own cursors and skips servers with no remaining cursor or regrowth.
3. Prevent `fetch()` in fleet mode from falling through to the active `client_handle()` when zero fleet slices are dispatched (e.g. scoping to a project on an offline environment), and recover transiently errored fleet environments on reconnect, explicit Retry, or TTL expiry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@juliusmarminge juliusmarminge Awaiting requested review from juliusmarminge

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add env var for configurable base or root directory

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mcking-07 @juliusmarminge @binbandit
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.