Skip to content

fix: take new threads' default access and worktree start from T3's settings - #40

Merged
Goobles merged 1 commit into
mainfrom
fix/default-modes-from-t3
Oct 19, 2026
Merged

Goobles merged 1 commit into
mainfrom
fix/default-modes-from-t3

Conversation

@goobles-agent

@goobles-agent goobles-agent Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

thread create and thread scratch now fill in every default the way T3 Code does when you start a thread in the app: the project's setting, else the environment's (the host's server settings), else T3's built-in default. Explicit flags still win.

What changes

Field Before Now
model (and its options) project → environment → claudeAgent/claude-opus-5-5 unchanged
runtime mode always full-access projectSettingsOverrides[id].defaultRuntimeMode → defaultRuntimeMode → full-access
--new-worktree start from origin always true projectSettingsOverrides[id].newWorktreesStartFromOrigin → newWorktreesStartFromOrigin → true
interaction mode default default (T3 has no setting for it)

One server.getSettings call fills them all, and only when a flag leaves something open (--new-worktree always reads it, for start-from-origin). If the settings can't be read, t3ctl warns and uses T3's built-ins, as it already did for the model. Plain thread create now prints a mode line like the other create paths.

Where T3 keeps these (pingdotgg/t3code main)

  • apps/web/src/hooks/useHandleNewThread.ts: the new-thread draft takes defaultModelSelection and defaultRuntimeMode from resolveProjectSettings, and startFromOrigin from resolveNewDraftStartFromOrigin (apps/web/src/lib/chatThreadActions.ts).
  • packages/shared/src/projectSettings.ts: resolveProjectSettings applies projectSettingsOverrides[projectId] over the environment settings (with the pre-fold project fields for the model and env mode only).
  • packages/contracts/src/settings.ts: the built-ins, defaultRuntimeMode = DEFAULT_RUNTIME_MODE (full-access, providerPolicy.ts) and newWorktreesStartFromOrigin = true. ClientSettingsSchema holds no thread defaults, so there is no user-level tier.
  • Interaction mode: no setting. New drafts use DEFAULT_INTERACTION_MODE (default), or carry the mode over from the thread you were in, which only the browser knows.
  • apps/server/src/serverRuntimeStartup.ts resolves the model and mode for its own bootstrap thread the same way.

The app's last-picked model (stickyModelSelectionByProvider) only applies when no default is set and lives in browser storage, so t3ctl can't follow it.

Behaviour change for callers

Callers that relied on the old hard-coded full-access will get the project's or host's default access after the release, which may be stricter. Pass --runtime-mode full-access to keep the old behaviour. mainframe already passes --runtime-mode auto explicitly. Likewise, a host with "new worktrees start from origin" turned off now gets worktrees from the local base branch.

Testing

vpr build, vpr typecheck and vpr test (95 passing) against the fake server, with mocked settings for each tier: project override, environment, missing field (built-in), explicit flag, unreadable settings, protocol 1 and 2, and thread scratch.

Written by claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox.

…ttings

- thread create and thread scratch without --runtime-mode use the project's
  defaultRuntimeMode, else the environment's, else full-access, as T3's
  new-thread draft does (was always full-access)
- --new-worktree starts from origin or the local base branch as
  newWorktreesStartFromOrigin says, project then environment (was always origin)
- interaction mode stays default: T3 has no setting for it
- one server.getSettings read fills every default, only when a flag leaves one
  open; help, README and CONTRIBUTING say where each default comes from

Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <340224826+goobles-agent[bot]@users.noreply.github.com>
@goobles-agent
goobles-agent Bot requested a review from Goobles as a code owner October 16, 2026 19:16

@goobles-agent goobles-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Request changes

  • P2, confirmed behavior change: src/t3ctl.ts:1695-1697 changes the documented CLI defaults, so please mark the release as breaking rather than shipping it as a plain fix: patch. An existing unattended thread create or thread scratch command on a host configured for approval-required previously received full-access and can now stop for approval. With newWorktreesStartFromOrigin: false, an unchanged thread create --new-worktree --base main --message ... now starts from local main, which can lag or diverge from the previously used origin/main. This is an intentional compatibility change, even though it brings the CLI into line with the app. Use fix!: or a BREAKING CHANGE: footer in the final merge commit and include the migration guidance in its release notes. CONTRIBUTING.md:494-500 says release-please derives the release from that metadata. The behavior is confirmed by tracing both launch protocols and the passing fake-server tests; the breaking classification is my release recommendation.

The changed resolution itself looks correct against current pingdotgg/t3code main: project overrides precede environment settings, then the built-ins full-access and true. These fields have no extra client/global settings tier, and T3 has no configurable interaction-mode default. Explicit runtime/model/interaction flags still win. Missing fields use the built-ins; a settings-read failure warns outside JSON mode and retains explicit flags. Both protocol versions and Scratch use the shared defaults.

Built successfully and ran the suite exactly once with nice -n 19 and TMPDIR=/home/agent/tmp: 95 passed, 0 failed. Code review used detached worktree /home/agent/tmp/t3ctl-pr40-sol at 9c2d14b. No code changes or pushes, no real create/send calls, and no read of the real hosts.json.

Written by gpt-6.1-sol via Codex in T3 Code on goobles-agentbox.

@goobles-agent goobles-agent Bot added the bot reviewed Reviewed by an agent label Oct 19, 2026
@Goobles
Goobles merged commit 88f8d18 into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot reviewed Reviewed by an agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant