Skip to content

devcontainer: Implement remote support for git checkpoint operations#48896

Open
oliverbarnes wants to merge 6 commits intozed-industries:mainfrom
oliverbarnes:fix-agent-checkpoint-in-devcontainer
Open

devcontainer: Implement remote support for git checkpoint operations#48896
oliverbarnes wants to merge 6 commits intozed-industries:mainfrom
oliverbarnes:fix-agent-checkpoint-in-devcontainer

Conversation

@oliverbarnes
Copy link
Contributor

Closes #47907

Implements the four git checkpoint operations (create, restore, compare, diff) that had been stubbed out for remote repositories, and related test infrastructure.

Testing steps:

  1. Open a project with a .devcontainer configuration and connect to the Dev Container
  2. Open an Agent thread and ask the agent to make a code change
  3. After the agent completes, verify the "Restore from checkpoint" button appears (previously missing in Dev Container sessions)
  4. Click "Restore from checkpoint" and confirm the file reverts to its prior state

Release Notes:

  • Added support for git checkpoint operations in remote/Dev Container sessions, restoring the "Restore from checkpoint" button in Agent threads.

Add request handlers for create, restore, compare, and diff checkpoint
operations on remote repositories. Define protobuf messages for each
operation and wire them through the entity request system. Implement
diff_checkpoints for FakeGitRepository and add integration tests
covering the full remote round-trip.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 10, 2026
@oliverbarnes oliverbarnes changed the title Implement remote support for git checkpoint operations devcontainer: Implement remote support for git checkpoint operations Feb 11, 2026
@oliverbarnes
Copy link
Contributor Author

oliverbarnes commented Feb 12, 2026

After latest merges I'm getting a panic when testing manually and opening the devcontainer. Looking into it

@oliverbarnes
Copy link
Contributor Author

oliverbarnes commented Feb 12, 2026

Seems to be independent from this PR and to happen upstream, on main. I've created an issue and am working on a fix for it: #49055

KyleBarton pushed a commit that referenced this pull request Feb 13, 2026
…ce entity lease (#49058)

Closes #49055

**Heads up**: This might be a naïve solution. I ran into the issue after
merging latest main into
#48896, and confirming that it
was unrelated to that PR and incoming from upstream.

Agent one-shot the fix, it works and tests pass. But I'm still wrapping
my head around the changes that led to the bug. I figured the breakage
is bad enough (I couldn't open devcontainers at all) to submit a
possibly naïve fix.

## Fix 

Hoists the `find_devcontainer_configs` call out of `new_dev_container`
and into the call site, where we already have a direct `&mut Workspace`
reference that doesn't go through the entity map. The computed configs
are passed into `new_dev_container` as an argument.

## What was happening

After #48800 ("Re-add MultiWorkspace"), `with_active_or_new_workspace`
nests a `Workspace` entity lease inside a `MultiWorkspace` entity lease.
The `OpenDevContainer` handler was also changed from async to sync in
the same PR, so `RemoteServerProjects::new_dev_container` now runs while
`Workspace` is leased. Inside `new_dev_container`, a
`WeakEntity<Workspace>::read_with` call tries to read `Workspace`
through the entity map, finds it already leased, and panics.

Release Notes:

- Fixed a panic when opening the dev container modal via the
`OpenDevContainer` action.
@oliverbarnes
Copy link
Contributor Author

@cole-miller I just merged in latest main with the fix and double-checked the checkpoint is still working on devcontainers here. Ready for review again :)

One question about review process - when something like this comes up (an upstream bug breaks an open PR under review), would it be better to set it as draft again until the PR is back working again?

@secondl1ght
Copy link

@cole-miller will you be able to review this PR this week?

@secondl1ght
Copy link

@oliverbarnes I am not sure if the Zed team still reviews contributor PRs. 🤔

@oliverbarnes
Copy link
Contributor Author

@secondl1ght they do, I've been in touch with them over Discord and they're still welcoming PRs and reviewing them, once they get to it.

There's a flood of PRs, most likely because of AI as with other OSS projects, and they're figuring out how to deal with the surge.

I'm part of the problem :) I've myself submitted more PRs in a short period of time than I usually would have, because agents.

It's not an easy one to tackle, so we need to be patient

@secondl1ght
Copy link

@oliverbarnes do you want to resolve conflicts and pull the latest?

@oliverbarnes
Copy link
Contributor Author

oliverbarnes commented Mar 2, 2026

@oliverbarnes do you want to resolve conflicts and pull the latest?

@secondl1ght I think I'll wait until the solution is validated by the team before doing so. Hydrating the open PRs and resolving upstream conflicts has been quite an amount of work due to how long the PRs have been taking to get a review. No criticism implied, I'd just rather resolve conflicts in one last batch, addressing any issues with the solution if they are raised.

Thanks for staying on top of it!

@secondl1ght
Copy link

secondl1ght commented Mar 2, 2026

OK sadly I lose hope for this one then 😢 unless @cole-miller responds, but he was assigned a few weeks ago. It is a really frustrating one because users who pay Zed for AI features cannot have this super important restore checkpoint functionality... this is their main source of revenue, but if it doesn't work then we can't continue paying for it. 🤷🏼‍♂️

…in-devcontainer

# Conflicts:
#	crates/proto/proto/git.proto
#	crates/proto/proto/zed.proto
#	crates/remote_server/src/remote_editing_tests.rs
@oliverbarnes
Copy link
Contributor Author

Alright, alright... :) Went ahead and fixed the conflicts. They weren't so bad in the end

…in-devcontainer

# Conflicts:
#	crates/proto/proto/zed.proto
#	crates/remote_server/src/remote_editing_tests.rs
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore from checkpoint button no longer appearing in Agent thread when using Dev Containers

3 participants