Before submitting#
Area#
apps/server
Steps to reproduce#
- In Settings → Auto-settle, enable Auto-settle merged threads ("Settle a thread when its pull request merges."). Disable inactivity auto-settle so only merge-based settlement is active.
- In a project using Local mode (root checkout,
worktreePath === null), start Thread A on branch feat/example, open a PR, and explicitly link that PR to Thread A.
- Before Thread A's PR merges, create Thread B in the same project in Local mode (so it shares the root checkout on
feat/example) with 0 linked PRs, and send a message / start activity so Thread B is saved on the server and idle on that branch.
- Merge Thread A's PR (with
mergedAt >= Thread B's latest activity).
Expected behavior#
Only Thread A should auto-settle. Thread B never created or linked that PR, so it should remain active.
Actual behavior#
Both Thread A and Thread B are automatically moved to Settled when Thread A's PR merges.
In apps/server/src/orchestration-v2/ThreadSettlementService.ts:
- Thread A settles via its explicit
pullRequests link and is excluded from lookupCandidates.
- The merge event resweeps
lookupCandidates (threads with no visible explicit pullRequests). Thread B falls into the ["branch", workspaceRoot, "feat/example"] lookup group (or resolves via branchPullRequest), picks up Thread A's merged PR, and passes pullRequestSettles because mergedAt >= latest(createdAt, latestUserAuthoredMessageAt).
- Explicit PR ownership on a sibling thread is not checked before attributing that PR to Thread B.
Impact#
Minor bug or occasional failure
Version or commit#
0.1.12-nightly.20261121.5038
Environment#
macOS 27.3 (arm64), T3 Code (Nightly) 0.1.12-nightly.20261121.5038
Workaround#
Pinning Thread B, manually disabling auto-settle on Thread B in advance, or setting the project's default environment mode to Worktree.