Summary
Add an "Open PR" action to a thread that can be pressed at any time, including while a turn is running, with an option to merge once CI passes. It replaces typing "open a PR, merge when CI passes" into the conversation by hand.
Behaviour
A split button in the thread header with two actions:
- Open PR (host) — the default.
- When the thread is idle it runs immediately. While a turn is running it is armed: a visible, cancellable pending chip; it runs when the thread next becomes idle (turn ended, no pending approvals or input). It never commits half-written edits. If the turn ended in an error or was interrupted, the chip waits with "Run now" / "Cancel".
- Steps: commit (message generated the same way as today's commit dialog), push / publish the branch, create the PR against the base (worktree
base, else the default branch), title and body generated from the diff, then link it to the thread as created. Reuse an existing open PR for the branch instead of creating a duplicate.
- Merge when CI passes (checkbox, remembered per project): use the forge's native auto-merge, never a Tcode-side CI watcher — GitHub
gh pr merge --auto (requires auto-merge enabled on the repo), GitLab auto-merge / merge when pipeline succeeds, Gitea/Forgejo merge_when_checks_succeed on the merge API (neither tea nor fj exposes it; call the API), Azure DevOps auto-complete. Bitbucket: no native equivalent known; the option is disabled there. Verify each before shipping.
- Failures surface as toasts and on the PR badge; a failing CI is shown on the linked PR, and the user decides whether to ask the agent to fix it.
- Ask agent to open PR.
- Puts a visible, editable message into the composer ("Open a pull request for these changes and merge it once CI passes"); while running it goes into the existing message queue. The agent does the work with its own tools, including fixing a failing CI.
- Nothing hidden is injected: the message is the user's message (Principle 1). The resulting PR is found by the branch-PR lookup after the turn.
Dependencies
Forge detection and linked PRs (#532). Title/body generation should share the owner of commit-message generation (generate_commit_message, crates/runtime/src/app/git.rs).
Related work
guivieiras/tcode has unmerged queued-message work (attached composer drawer 219d046, edit/remove actions c58bf81) that the "Ask agent" path would use.
Summary
Add an "Open PR" action to a thread that can be pressed at any time, including while a turn is running, with an option to merge once CI passes. It replaces typing "open a PR, merge when CI passes" into the conversation by hand.
Behaviour
A split button in the thread header with two actions:
base, else the default branch), title and body generated from the diff, then link it to the thread ascreated. Reuse an existing open PR for the branch instead of creating a duplicate.gh pr merge --auto(requires auto-merge enabled on the repo), GitLab auto-merge / merge when pipeline succeeds, Gitea/Forgejomerge_when_checks_succeedon the merge API (neitherteanorfjexposes it; call the API), Azure DevOps auto-complete. Bitbucket: no native equivalent known; the option is disabled there. Verify each before shipping.Dependencies
Forge detection and linked PRs (#532). Title/body generation should share the owner of commit-message generation (
generate_commit_message,crates/runtime/src/app/git.rs).Related work
guivieiras/tcode has unmerged queued-message work (attached composer drawer 219d046, edit/remove actions c58bf81) that the "Ask agent" path would use.