Repository navigation
Rewinding a thread doesn't rewind the sandbox: a checkpointer that keeps them in sync #7519
Victor (victorperr)
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.
Hi all,
I built a sandbox backend for Deep Agents and would like feedback from the people who know the backend protocol best.
The problem. LangGraph checkpoints save graph state, not the sandbox's files. So when you rewind a Deep Agents thread, the agent thinks it is back at step 3 while its sandbox is still at step 10. And two branches started from the same checkpoint end up editing the same files.
Repo langchain-space
It adds a
SpaceCheckpointerthat wraps any LangGraph saver. Each checkpoint stores the id of an immutable snapshot of the sandbox. A run started from an older checkpoint continues in a new sandbox forked from that snapshot. Usage is the normalcreate_deep_agentcall:It runs on SPACE (Perplexity's open-source Firecracker sandboxes) and also on LangSmith sandboxes. It also includes
fork_and_select: try N fixes in parallel forks and keep the one whose tests pass.It is tested on real SPACE microVMs in CI.
Questions for maintainers
saver.backendroutes each call to the right thread's sandbox by readingget_config(). That works, but is it the pattern you'd recommend? Or is a hook that receives the run's config/runtime planned?langchain-testslags deepagents 0.7.langchain-tests1.1.9 still expects relativeglobpaths, directories inglobresults, andwriterefusing existing files. 0.7 changed all three, which is why 7 tests are markedxfail(strict=True). Should I open a PR updating the suite?Happy to hear where the design is wrong, too.
thank you very much
All reactions