Repository navigation
Description
What happened
Since updating to the latest nightly, sending a message to a Claude thread that is waiting on a long-running background Bash command (a test run) fails almost every time with:
Claude is still running background agents or commands, and this model or setting change would end them. Wait for them to finish, or press Stop, then send the message again.
Nothing was changed in the composer: model, effort, fast mode, and permission mode were all the same as on the previous turn.
Diagnosis
The real change was the project's repository list, not a model or setting.
Since #35925 ("a project covers several repositories"), claudeEffectiveQueryPolicyKey includes turnInput.runtimePolicy.workspace (apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, ~L3690 and ~L13116). That workspace is recomputed on every turn by RuntimePolicy → WorkspaceFolders.forThread → projectFolders → discoverFolders. It scans the project's first two folder levels for nested repos and drops those listed in t3.json ignoreRepositories. When folders is empty, workspace is left out entirely (RuntimePolicy.ts ~L208).
So any change to the discovered repos after the Claude process opened changes queryPolicyKey. That includes editing t3.json, cloning or removing a nested repo, or editing a .code-workspace file. Both reuse branches in startTurn then miss, and the code falls through to the replacement check. If liveProcessRunsBackgroundWork is true, it throws ClaudeBackgroundWorkBlocksQueryReplacementError. The process keeps its old key, so every later send fails the same way until the background work ends or the user presses Stop. With no background work, the process is silently replaced on every repository-list change instead.
What happened on this machine:
- Run 403 opened the Claude process at 16:04 UTC. Discovery found six gitignored vendored checkouts under
vendor/. - At 16:08 UTC,
t3.jsonwas written with those six repos inignoreRepositories. That was the workaround for Auto-discovered gitignored vendor repos break worktree creation when a checkout hook links them (path_already_exists) #40406. Discovery now returns[], soworkspaceis omitted from the key. - At 17:51 UTC, run 404 used the same model selection (
claude-fable-5-2, effort high, fastMode false) while a background test command was running. It was refused with the error above.
The error message makes this hard to diagnose, because it blames a model or setting change the user never made.
Steps to reproduce
- Have a project whose root contains a nested git repo one or two levels down, for example
vendor/foo/.git, not listed int3.json. - Start a Claude thread and send a message, so the Claude process opens.
- Ask the agent to start a long-running background Bash command (
run_in_background, e.g.sleep 600) and end its turn. - Add
t3.jsonwith{"ignoreRepositories": ["vendor/foo"]}. Removing or adding a nested repo works too. - Send any follow-up message without touching the composer. It is refused with the "model or setting change" error, and every later send fails the same way until the command exits or you press Stop.
Version
0.1.12-nightly.20261121.5051 (the desktop app's version and the local server's serverVersion). I see no relevant change on main since that tag.
Environment
macOS (Darwin 27.2.0, arm64), T3 Code (Nightly) desktop app with a local server, Node v24.22.1, provider claudeAgent.
Evidence
Server trace (server.trace.ndjson), span ClaudeAdapterV2.startTurn, 17:51:42 UTC:
ProviderAdapterTurnStartError: Failed to start run run:thread:c0e3c266-…:ordinal:404 on claudeAgent provider thread …
[cause]: ClaudeBackgroundWorkBlocksQueryReplacementError: Claude is still running background agents or commands, and this model or setting change would end them. …
orchestration_v2_projection_runs shows identical modelSelection on runs 403 (completed 16:05 UTC), 404 (failed 17:51 UTC) and 405:
{"instanceId":"claudeAgent","model":"claude-fable-5-2","options":[{"id":"effort","value":"high"},{"id":"fastMode","value":false}]}
The project row's updated_at is 16:08:55 UTC, and the t3.json mtime is 16:08:15 UTC. Both fall between run 403 and run 404. The server process ran the whole time, from 15:56 UTC, so this was the same live Claude process.
Related issues
- Auto-discovered gitignored vendor repos break worktree creation when a checkout hook links them (path_already_exists) #40406 (closed): worktree creation broke on auto-discovered gitignored vendor repos. Its
t3.jsonworkaround is what changed the repository list here. fix(server): skip gitignored repositories when discovering folders #40429 (skip gitignored repositories in discovery) will change discovery results again for projects like this one. - [Bug]: Claude is still running background agents or commands, and this model or setting change would end them. Wait for them to finish, or press Stop, then send the message again. #16073 (closed by fix(server): changing Claude effort no longer fails while background agents run #19341): the same error for model, effort, or fast mode changes, which are now applied live. This report is a different trigger: the workspace part of the reuse key, with no selection change.
- [Bug]: A send that would release a session's background work is refused, though the same message queued behind a turn is accepted #32296 (open): direct sends are refused where queued sends are accepted, for provider switches. Same guard, but a different cause.
Possible directions:
- Don't let repository-list changes force a replacement while background work runs. Apply the change at the next natural restart, or grant new roots live where possible.
- Name the actual difference in the error (here: "the project's repositories changed").
Fix applied or workaround
Nothing was changed on the machine. Workaround: once the background command finishes (or after pressing Stop), send one message. Claude restarts with the new repository list, and later sends work again.
Filed by
Claude Code (Claude Opus 5.5, claude-opus-5-5) via t3 triage.
Activity
hahasagined commentedon Nov 22, 2026
Same refusal on
0.1.12-nightly.20261121.5051(Linux, background service), on a project that does not editt3.json. Here the trigger is other agent threads cloning repos into the shared project root, so the discovered folders change several times an hour and any thread with background work gets refused.What happened, all times UTC 2026-11-22. The Claude thread had a guarded deploy command and a Monitor running in the background:
<project>/one-thread-per-task-20261122/k3s, two levels below the project root, so discovery picks it up.ClaudeAdapterV2.startTurnfailed withClaudeBackgroundWorkBlocksQueryReplacementErrorand the run was marked failed.<project>/daily-review-inputs-20261122/k3s.Two side effects that make this worse than the message suggests:
pendingBackgroundTasksstill lists the command and Monitor that the process reported as completed at 11:46:52–56 (task_updatedstatus completed, thenbackground_tasks_changedwithtasks: []).Project shape that makes this frequent: a single non-git project root with about 590 nested git checkouts at depth 1–2. Agents create a dated work folder and clone into it for nearly every task, so the repository list changes constantly. Putting them all in
ignoreRepositoriesis not practical, because new names appear all the time.Suggestion: keep the workspace out of the replacement decision, or only add new folders as extra dirs, for a process that has live background work. Also ingest provider events from a process that no T3 run owns, so roster clears and self-started turns are not lost.
Written by Claude Opus 5.5 (Claude Code in T3) on behalf of the reporter, following the
t3 triageplaybook.