Before submitting
Area
apps/web / apps/server (not sure which side owns the branch PR badge)
Steps to reproduce
-
In a project, work on a long-lived branch (dev in my case) and open a PR from it while in a T3 Code chat that lands on main (my PR 206, dev into main).
-
Merge the PR.
-
Now carry on work in separate branches as normal workflow suggests, so new PRs land on dev after they get merged (i.e. feature branch -> dev).
-
Start a new chat in the same project, merged PR (PR 206), still on dev, even though there are PRs merged more recently into it
Expected behavior
New chats should not show the old merged PR on long lived branches, or there should be a way to dismiss it. A PR that is already merged, and whose head commit is no longer the branch tip, should not be treated as the branch's current PR.
Actual behavior
Every new chat on dev shows the merged PR badge (206) next to the branch picker (screenshot below). It persists across chats and there is no way to clear it.
It is not really linked to the chat:
list_thread_pull_requests (agent MCP tool) returns an empty list for the chat.
- In
state.sqlite, the thread row has linked_pull_request_json = NULL but branch_pull_request_json set to PR 206. Both threads on dev carry it: the one where the PR was opened (Sep 27) and a brand new one created Oct 2.
Possibly related: linking a PR to a new chat fails
When I tried to link the PR to the new chat, I got:
Orchestration command invariant failed (thread.pull-request.link): Thread '3ba0ec46-b6af-4fb4-9e0f-f91cae842438' does not exist for command 'thread.pull-request.link'.
The thread does exist now (it has a thread.created event and a projection_threads row). But the server trace shows both failed link attempts (18:55:53 and 19:15:45 UTC) happened before that thread's thread.created event (19:16:05 UTC). So it looks like the link action is offered on a draft chat that has not been created on the server yet, and the command fails in requireThread.
Impact
Minor bug or occasional failure
Version or commit
0.0.42 (AUR t3code-bin)
Environment
Arch Linux (kernel 7.2.6), desktop app, Cursor agent provider
Logs or stack traces
OrchestrationCommandInvariantError: Orchestration command invariant failed (thread.pull-request.link): Thread '3ba0ec46-b6af-4fb4-9e0f-f91cae842438' does not exist for command 'thread.pull-request.link'.
at invariantError (file:///opt/t3code-bin/resources/app.asar/apps/server/dist/bin.mjs:74866:9)
at requireThread (file:///opt/t3code-bin/resources/app.asar/apps/server/dist/bin.mjs:74898:16)
at file:///opt/t3code-bin/resources/app.asar/apps/server/dist/bin.mjs:76243:26
at next (<anonymous>)
at orchestration.command.thread.pull-request.link (file:///opt/t3code-bin/resources/app.asar/apps/server/dist/bin.mjs:77426:11)
Screenshots
Merged PR badge next to the branch picker, shown in every new chat on dev (attached in a comment below).
Workaround
None found.
Before submitting
Area
apps/web / apps/server (not sure which side owns the branch PR badge)
Steps to reproduce
In a project, work on a long-lived branch (
devin my case) and open a PR from it while in a T3 Code chat that lands onmain(my PR 206,devintomain).Merge the PR.
Now carry on work in separate branches as normal workflow suggests, so new PRs land on
devafter they get merged (i.e. feature branch -> dev).Start a new chat in the same project, merged PR (PR 206), still on
dev, even though there are PRs merged more recently into itExpected behavior
New chats should not show the old merged PR on long lived branches, or there should be a way to dismiss it. A PR that is already merged, and whose head commit is no longer the branch tip, should not be treated as the branch's current PR.
Actual behavior
Every new chat on
devshows the merged PR badge (206) next to the branch picker (screenshot below). It persists across chats and there is no way to clear it.It is not really linked to the chat:
list_thread_pull_requests(agent MCP tool) returns an empty list for the chat.state.sqlite, the thread row haslinked_pull_request_json = NULLbutbranch_pull_request_jsonset to PR 206. Both threads ondevcarry it: the one where the PR was opened (Sep 27) and a brand new one created Oct 2.Possibly related: linking a PR to a new chat fails
When I tried to link the PR to the new chat, I got:
The thread does exist now (it has a
thread.createdevent and aprojection_threadsrow). But the server trace shows both failed link attempts (18:55:53 and 19:15:45 UTC) happened before that thread'sthread.createdevent (19:16:05 UTC). So it looks like the link action is offered on a draft chat that has not been created on the server yet, and the command fails inrequireThread.Impact
Minor bug or occasional failure
Version or commit
0.0.42 (AUR
t3code-bin)Environment
Arch Linux (kernel 7.2.6), desktop app, Cursor agent provider
Logs or stack traces
Screenshots
Merged PR badge next to the branch picker, shown in every new chat on
dev(attached in a comment below).Workaround
None found.