Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First stab at crude and simple workspace recovery hooks #4063

Conversation

Boostrix
Copy link
Contributor

@Boostrix Boostrix commented May 9, 2023

This was born out of the frustration of agpt crashing on me with 100+ files in a directory and not knowing a thing about those artifacts afterwards (or its previous actions/search results). Have played with different schemes and also have different ideas on disk, this one seemed like the most straightforward option to actually extend it easily.

NOTE: This is NOT a proper persistence scheme (no pickle for #822, #1176, #1531, #3382, #3933 etc), it's just a way to keep track of past actions and xref those with artifacts and action results (more akin to #3542). For now, the motivation is to have sufficient metadata to prime the new agent/instance and provide it with enough context to make heads and tails of the original workspace.

Using a JSON based set of "workspace history" files, I've been able to get restarted agents to properly use scripts generated during previous sessions by other agents, which is rather promising and more than I was hoping for. But obviously, that requires a ton of context.

so, just a stub for now - just to keep people in the loop and get some more feedback/ideas and hopefully help.

also, please don't bother about the python code - it's more important to me to have something functional rather than something beautiful or elegant. So, ideas and suggestions are welcome - but styling is going to be subject to whoever is gonna review/integrate or even just use this. :-)

The basic idea is workable (seeing massive reuse of artifacts here when interrupting/resuming an agent), but can obviously be extended to make it much more useful (at the cost of adding a ton of meta data). This is proof of concept, mainly to gather feedback/ideas and help. If anybody has a better scheme in mind, please speak up ! For now this is only supposed to be better than the status quo, which is a ... pity.

Background

as mentioned in another comment here, what's key to make this work at this point without a major re-arch, is encoding statefulness of different actions/commands. The best results I have locally seen is when I am using the result of an action and hashing that for the origin of the action (command + params): basically a recursive chain of cause / effect

Changes

Documentation

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

…anism, based on dumping actions to a file to have suitable pointers upon resumption of a

 session regarding artifacts from previous runs. The basic idea is workable (seeing massive reuse of artifacts here when interrupting/resuming an agent), but can obviously be extended to make it much more useful. This is proof of concept, mainly to gather feedback/ideas and help. If anybody has a better scheme in
 mind, please speak up ! For now this is only supposed to be better than the status quo.
@vercel
Copy link

vercel bot commented May 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 9, 2023 9:00pm

@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts function: state management size/l
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants