Repository navigation
Settle on merge: wake the agent and let it settle the thread if its task is done, instead of settling automatically #25577
PastaPastaPasta
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server (
ThreadSettlementService,PullRequestWatchReactor,t3-codeMCP)Problem
"Auto-settle merged threads" (
sidebarAutoSettleOnMerge, on by default) treats a merge as proof that the thread's task is done. Often it isn't. The PR is one step of a larger task: tag a release, deploy, run a data repair, verify production, open the next PR in a stack, or report back to an orchestrator. A merge rule can't tell these cases apart. The agent can, because it knows what it was asked to do.What happens today (main @
210b2e7c6a):pullRequestSettlessees a merge newer than the last user message, and therun.updatedsweep (L641) settles the thread as soon as the turn completes.runOnSettle, and detaches the provider session.A real case: the agent merged a PR, said it would tag and deploy once main CI passed, and ended its turn. The thread settled. The tag, deploy, DB repair and production check sat undone for two days, until I went looking.
The workarounds each fix one symptom and add a cost:
unsettledon't stick: pins fill the pinned list, a snooze only defers, and the next message clearsunsettle.Proposal
Replace the programmatic settle-on-merge with an agent-judged one. When a linked PR merges, wake the thread's agent once and let it decide whether the task is done.
closednotice. For example: "Pull request #N (url) merged. If the task you were given is now complete, callt3_thread_organizewithaction: "settle"and end your turn. If work remains (deploy, release, more PRs, reporting back), continue it and don't settle."t3_thread_organize→settlealready arms "settle when this turn ends" for the calling agent (settleThread), so no new settle primitive is needed.sidebarAutoSettleAfterDays) still applies as the backstop.Setting shape: make
sidebarAutoSettleOnMergea three-way mode (ask-agent/immediate/off), global with the existing per-project override. I'd suggestask-agentas the default for threads with a live agent session, withimmediatekept for people who want today's behaviour. Merges on threads with no agent session (user-created, never run) could keep settling immediately.Why this, rather than the narrower proposals
Cost: one extra short agent turn per merged PR on threads that were going to settle anyway. Since the agent's answer is usually "done, settle", this turn should be cheap. The setting keeps
immediatefor anyone who doesn't want to pay it.Related
watch_pull_requestends silently on merge. That's the wake this proposal would add. [Bug]: watch_pull_request ends silently, so the thread never hears of the author's push or reply #22183 is the same silent ending without a merge.All reactions