Skip to content

Add "Start Thread in New Worktree" - #49141

Merged
rtfeldman merged 136 commits into
mainfrom
AI-34/thread-target-selector-ui
Mar 3, 2026
Merged

Add "Start Thread in New Worktree"#49141
rtfeldman merged 136 commits into
mainfrom
AI-34/thread-target-selector-ui

Conversation

@rtfeldman

@rtfeldman rtfeldman commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Add the thread target selector in the agent panel behind the agent-git-worktrees flag:

Screenshot 2026-03-02 at 11 50 47 PM
  • Add a "Start Thread In..." dropdown to the agent panel toolbar, gated behind AgentV2FeatureFlag
  • Options: "Local Project" (default) and "New Worktree"
  • The "New Worktree" option is disabled when there's no git repository or in collab mode

Closes AI-34

Release Notes:

  • N/A

@rtfeldman rtfeldman self-assigned this Feb 13, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 13, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Feb 13, 2026
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from f0f636c to 8873ffd Compare February 13, 2026 21:56
@rtfeldman
rtfeldman force-pushed the AI-33/agent-worktree-directory-setting-persistence branch from 4a36aa4 to 6f14b31 Compare February 18, 2026 02:39
Base automatically changed from AI-33/agent-worktree-directory-setting-persistence to main February 18, 2026 22:20
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from 8873ffd to c16eddc Compare February 19, 2026 01:09
@rtfeldman rtfeldman changed the title Add thread target selector UI + worktree history labels Add thread target selector UI Feb 20, 2026
@rtfeldman
rtfeldman changed the base branch from main to remove-dead-git-worktree-info February 25, 2026 16:54
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from 37d11ca to dd66851 Compare February 25, 2026 16:58
Base automatically changed from remove-dead-git-worktree-info to main February 25, 2026 17:36
osyvokon and others added 2 commits February 25, 2026 18:15
Also, `ep split train=100` now means 100 lines, not 100 groups (repos or
cursor_paths).


Release Notes:

- N/A
Trying to keep it from reiterating instructions


Release Notes:

- N/A
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from b8bed41 to 89e3e87 Compare February 25, 2026 18:38
Anthony-Eid and others added 15 commits February 25, 2026 19:45
This is a follow-up on #50027

I address my comments by adding a hash map look-up to find the selected
pending commit. I also removed the limitation where we would only retry
finding the pending commit 5 times. The pending selection is removed
when the graph is fully loaded and doesn't contain the pending commit.

This PR also cleans up some internal code structure and starts work to
enable search and propagating git log error messages to the UI.

UI wise I made the git graph item show the repository name instead of
"Git Graph" in Zed.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
This PR removes Preview callouts from documentation for features that
are now in Stable.

Features documented with Preview callouts are now included in the stable
release.

Generated by script/docs-strip-preview-callouts

Release Notes:

- N/A
Documentation updates for Preview release - generated by
docs-suggest-publish

Release Notes:

- N/A
Adds `gpt-5.3-codex` as a built-in model under the OpenAI provider for
BYOK usage.

Model specs:
- 400,000 context window
- 128,000 max output tokens
- Reasoning token support (default medium effort)
- Uses the Responses API (like other codex models)
- Token counting falls back to the gpt-5 tokenizer

Closes AI-59

Release Notes:

- Added support for GPT-5.3-Codex as a bring-your-own-key model in the
OpenAI provider.
Follow-up to #50118.

Release Notes:

- N/A
… setting

The assistant namespace (containing InlineAssist, CopyCode, etc.) was
previously hidden when the agent panel was disabled. This was incorrect
because InlineAssist is independent of the agent panel — a user may
want inline assist without the sidebar button.

Now the assistant namespace is always shown when AI is not globally
disabled, while agent/agents namespaces still track agent_enabled.
Add 'Start Thread In...' dropdown to the agent panel toolbar, gated behind
AgentV2FeatureFlag, with 'Local Project' and 'New Worktree' options. The
'New Worktree' option is disabled when there's no git repo or in collab.

Add WorktreeCreationStatus enum for displaying creation progress/errors.

Render worktree branch labels on ACP history rows using thread metadata.

Tests: test_worktree_branch_from_meta, test_history_row_displays_worktree.
The render path was going through a weak workspace upgrade with a
fallback to false, while the handler used self.project directly.
Use the same direct project access in both paths.
The same relative time formatting logic ("3d", "2h ago", "Just now")
was duplicated in render_history_entry and AcpHistoryEntryElement,
with divergent fallback text for missing timestamps. Extract it into
a single function and unify the fallback to "—".
If all visible items were BucketSeparators (which shouldn't happen in
practice but isn't prevented by the type system), the while loop would
spin forever. Add a max-iteration bound so it terminates gracefully.
set_thread_target was not calling serialize(), so the user's thread
target choice would be lost on restart. Add the missing serialize
call and a round-trip test that verifies NewWorktree survives
serialization and restoration.
SerializedThreadTarget was structurally identical to ThreadTarget with
pure field-by-field From conversions. Derive serde traits on ThreadTarget
directly and remove the redundant type.
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from 1e714e9 to c41fc93 Compare March 2, 2026 17:30
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch 2 times, most recently from 9938d5d to bfcd22a Compare March 2, 2026 18:22
@rtfeldman
rtfeldman force-pushed the AI-34/thread-target-selector-ui branch from bfcd22a to ea5924d Compare March 2, 2026 18:22
rtfeldman added 11 commits March 2, 2026 14:17
- Fix #3: Add catch-all error handling around setup_new_workspace so
  worktree creation status cannot get stuck in Creating
- Fix #8: Store visual-test workspace observer subscription instead of
  detaching it; explicitly drop during teardown
- Fix #9: Delete preserved temp directory after visual test completion
- Fix #10: Add run_git_command helper that checks exit status and
  includes stderr/stdout context in failure messages
- Fix #11: Change two open_new().detach() calls to detach_and_log_err
- Revert unrelated thread_history.rs changes (delete event refactoring,
  format_relative_time extraction, v_flex layout, iteration guard)
- Restore assistant namespace conditional and CopyCode test assertions
  in agent_ui.rs
Merge three redundant types into a single StartThreadIn enum that
serves as both the Action type and the state/serialization type.
Document classify_worktrees, start_worktree_creations, and
await_and_rollback_on_failure to clarify their roles in the New Worktree
creation flow.
@rtfeldman
rtfeldman marked this pull request as ready for review March 3, 2026 04:46
@rtfeldman
rtfeldman enabled auto-merge (squash) March 3, 2026 04:46
@rtfeldman rtfeldman changed the title Add thread target selector UI Add "Start Thread in New Worktree" Mar 3, 2026
@rtfeldman
rtfeldman disabled auto-merge March 3, 2026 05:04
@rtfeldman
rtfeldman enabled auto-merge (squash) March 3, 2026 15:18
@rtfeldman
rtfeldman merged commit 7c9a9d4 into main Mar 3, 2026
43 of 45 checks passed
@rtfeldman
rtfeldman deleted the AI-34/thread-target-selector-ui branch March 3, 2026 15:25
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
Add the thread target selector in the agent panel behind the
`agent-git-worktrees` flag:

<img width="590" height="121" alt="Screenshot 2026-03-02 at 11 50 47 PM"
src="https://github.com/user-attachments/assets/17ee3303-7e01-4e40-bb84-1e7e748a3196"
/>

- Add a "Start Thread In..." dropdown to the agent panel toolbar, gated
behind `AgentV2FeatureFlag`
- Options: "Local Project" (default) and "New Worktree"
- The "New Worktree" option is disabled when there's no git repository
or in collab mode

Closes AI-34

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: morgankrey <morgan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Wuji Chen <chenwuji2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Kasper Nyhus <kanyhus@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Josh Robson Chase <josh@robsonchase.com>
Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com>
Co-authored-by: ozacod <ozacod@users.noreply.github.com>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Lena <241371603+zelenenka@users.noreply.github.com>
Co-authored-by: 0x2CA <2478557459@qq.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
Co-authored-by: Nikhil Pandey <nikhil@nikhil.com.np>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: dancer <144584931+dancer@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
Add the thread target selector in the agent panel behind the
`agent-git-worktrees` flag:

<img width="590" height="121" alt="Screenshot 2026-03-02 at 11 50 47 PM"
src="https://github.com/user-attachments/assets/17ee3303-7e01-4e40-bb84-1e7e748a3196"
/>

- Add a "Start Thread In..." dropdown to the agent panel toolbar, gated
behind `AgentV2FeatureFlag`
- Options: "Local Project" (default) and "New Worktree"
- The "New Worktree" option is disabled when there's no git repository
or in collab mode

Closes AI-34

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: morgankrey <morgan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Wuji Chen <chenwuji2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Kasper Nyhus <kanyhus@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Josh Robson Chase <josh@robsonchase.com>
Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com>
Co-authored-by: ozacod <ozacod@users.noreply.github.com>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Lena <241371603+zelenenka@users.noreply.github.com>
Co-authored-by: 0x2CA <2478557459@qq.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
Co-authored-by: Nikhil Pandey <nikhil@nikhil.com.np>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: dancer <144584931+dancer@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Add the thread target selector in the agent panel behind the
`agent-git-worktrees` flag:

<img width="590" height="121" alt="Screenshot 2026-03-02 at 11 50 47 PM"
src="https://github.com/user-attachments/assets/17ee3303-7e01-4e40-bb84-1e7e748a3196"
/>

- Add a "Start Thread In..." dropdown to the agent panel toolbar, gated
behind `AgentV2FeatureFlag`
- Options: "Local Project" (default) and "New Worktree"
- The "New Worktree" option is disabled when there's no git repository
or in collab mode

Closes AI-34

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: morgankrey <morgan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Wuji Chen <chenwuji2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Kasper Nyhus <kanyhus@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Josh Robson Chase <josh@robsonchase.com>
Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com>
Co-authored-by: ozacod <ozacod@users.noreply.github.com>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Lena <241371603+zelenenka@users.noreply.github.com>
Co-authored-by: 0x2CA <2478557459@qq.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
Co-authored-by: Nikhil Pandey <nikhil@nikhil.com.np>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: dancer <144584931+dancer@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Add the thread target selector in the agent panel behind the
`agent-git-worktrees` flag:

<img width="590" height="121" alt="Screenshot 2026-03-02 at 11 50 47 PM"
src="https://github.com/user-attachments/assets/17ee3303-7e01-4e40-bb84-1e7e748a3196"
/>

- Add a "Start Thread In..." dropdown to the agent panel toolbar, gated
behind `AgentV2FeatureFlag`
- Options: "Local Project" (default) and "New Worktree"
- The "New Worktree" option is disabled when there's no git repository
or in collab mode

Closes AI-34

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: morgankrey <morgan@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: MostlyK <135974627+MostlyKIGuess@users.noreply.github.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: John Tur <john-tur@outlook.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Wuji Chen <chenwuji2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Kasper Nyhus <kanyhus@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Josh Robson Chase <josh@robsonchase.com>
Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com>
Co-authored-by: ozacod <ozacod@users.noreply.github.com>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Lena <241371603+zelenenka@users.noreply.github.com>
Co-authored-by: 0x2CA <2478557459@qq.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Albab Hasan <155961300+Albab-Hasan@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
Co-authored-by: Nikhil Pandey <nikhil@nikhil.com.np>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: dancer <144584931+dancer@users.noreply.github.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.