feat: pick worktree or current checkout per project - #5766
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Needs human review New feature adding per-project thread environment mode with database migration, orchestration changes, and async thread creation logic. An unresolved comment identifies a potential race condition in the new thread handler. You can customize Macroscope's approvability policy. Learn more. |
Adds an optional defaultThreadEnvMode per project (project.meta.update -> projection column) and an optional defaultThreadEnvMode field in t3.json. New threads resolve: explicit pick > project setting > t3.json > global. No settings UI yet; that ships separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Web: re-check the logical-project draft after the async default resolve so concurrent invocations reuse instead of evicting. Mobile: hold the auto-branch effect until the t3.json default settles so the interim global value never freezes into the draft. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cit options Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the New threads section to Settings -> Projects, and moves the env-mode priority chain into a shared resolver so web and mobile cannot disagree on the order. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
25cb2f2 to
0a99111
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f682eca. Configure here.
## What's Changed * chore: vouch gfsaaser24 by @t3dotgg in pingdotgg/t3code#5761 * chore: vouch saphid by @t3dotgg in pingdotgg/t3code#5763 * fix(server): stop Codex threads with queued follow-ups by @t3dotgg in pingdotgg/t3code#5762 * fix(web): usage page loses the cost quality panel, gains a back button by @t3dotgg in pingdotgg/t3code#5756 * feat(server): agents can now open the images you paste into chat by @t3dotgg in pingdotgg/t3code#5757 * fix(web): pinned reorder no longer reshuffles while writes land by @t3dotgg in pingdotgg/t3code#5767 * feat(web): overhaul project settings into a real settings page by @t3dotgg in pingdotgg/t3code#5768 * fix(web): usage totals no longer jump while devices report in by @t3dotgg in pingdotgg/t3code#5772 * fix(server): settle no longer leaves monitors and dev servers running by @t3dotgg in pingdotgg/t3code#5774 * feat: pick worktree or current checkout per project by @t3dotgg in pingdotgg/t3code#5766 * fix(web): sidebar rows show the branch again, not a truncated plan step by @t3dotgg in pingdotgg/t3code#5776 * feat(server): vp run migrate-dev-db seeds worktree dev dbs with real data by @t3dotgg in pingdotgg/t3code#5773 * feat(web): keep unsent drafts one click away in the sidebar by @t3dotgg in pingdotgg/t3code#5777 **Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260809.1039...v0.0.33-nightly.20260809.1040 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260809.1040

I default to "new worktree" on 90%+ of my projects, but a few work better on the current checkout. The default was one global setting, so the minority projects needed a manual composer flip on every new thread.
Now the default resolves per project:
explicit composer pick > per-project setting > t3.json > global setting
defaultThreadEnvModeviaproject.meta.update(null clears it). Stored in a newprojection_projectscolumn (migration 039).t3.jsonaccepts an optionaldefaultThreadEnvMode("worktree"|"local") for checked-in repo defaults. The published JSON schema picks the field up automatically.@t3tools/shared/threadEnvMode) used by both web and mobile, so the platforms cannot disagree on the order. Web resolves at draft creation through the cached project-file query atom; mobile resolves reactively.Tests: decider/projector round trip (set, omit, clear), shared resolver priority order, t3.json schema decode,
parseT3ProjectFile, plus updated projection and settings-search fixtures. Full repo typecheck, lint, and the affected package suites pass.Change authored by Claude Fable 5 via Claude Code.
🤖 Generated with Claude Code
Note
Medium Risk
Touches orchestration persistence (new column + migration), draft/new-thread timing with async
t3.jsonreads, and concurrent navigation guards; behavior changes for default workspace mode but fields stay optional on the wire for mixed versions.Overview
Adds a layered default for where new threads start: per-project setting →
t3.json→ global server setting, with an explicit composer pick still winning. New threads no longer rely only on the globaldefaultThreadEnvMode.Server & contracts:
defaultThreadEnvModeis persisted on projects viaproject.meta.update(nullable clears the override), projected through decider/projector/SQL (migration 039 onprojection_projects), and exposed on project shells.ThreadEnvModemoves toenvironment.tsto avoid import cycles;t3.jsongains optionaldefaultThreadEnvMode.Shared logic:
@t3tools/shared/threadEnvModecentralizesresolveDefaultThreadEnvModeandisDefaultThreadEnvModeSettledso web and mobile agree;parseT3ProjectFilesupports reading repo defaults without surfacing decode errors.Web: Project settings add a New threads → Workspace control (inherit / worktree / local) with inherited source shown.
useHandleNewThreadresolves defaults asynchronously (cachedt3.jsonread), resets stale stored-draft workspace context to current defaults, and adds race guards around concurrent new-thread navigation.Mobile: New-task flow reads
t3.json, uses the shared resolver, and delays worktree branch auto-selection until the default is settled so a provisional global default is not frozen beforet3.jsonloads.Reviewed by Cursor Bugbot for commit f682eca. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-project default thread workspace mode (worktree or local checkout)
defaultThreadEnvModefield to projects, propagated through the full stack: contracts, event sourcing, projections, DB (migration 039), and API responses.t3.jsonand the global default.resolveDefaultThreadEnvModeis: per-project setting →t3.jsondefaultThreadEnvMode→ global server default.isDefaultThreadEnvModeSettleduntil the project file finishes loading to avoid persisting provisional values.useNewThreadHandlerandNewTaskFlowProviderintroduces guards against race conditions where concurrent route/draft changes could overwrite state.Macroscope summarized f682eca.