feat: introduce session restoration and resume functionality for agent sessions#760
feat: introduce session restoration and resume functionality for agent sessions#760floreks wants to merge 4 commits into
Conversation
…t sessions - Implement `CodexRestorer` for restoring and resuming Codex sessions - Add `OpencodeRestorer` for handling Opencode session states - Create `GeminiRestorer` for managing Gemini session restoration - Develop `ClaudeRestorer` for Claude CLI session management - Define `HTTPArchiveStore` for downloading and handling archives - Establish a `Command` interface for executing commands - Provide `RestoreOptions` and `PreparedSession` structures - Integrate new command into CLI for resuming agent runs
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
- Upgrade `golang` version in `gen-client-mocks.sh` to 1.26.4 - Update mockery version in generated mock files to v2.53.6 - Refactor `ConsoleClient` mock functions to handle `AgentRunMinimalFragment` - Change `foundManifest` to `foundManifestError` in `archive.go` error handling logic
- Disable `goconst` linter due to issues with newer version - Add a TODO note for fixing and re-enabling the rule later
- Add `ValidateRepository` method in `Repository` interface - Implement logic to skip branch checkout prompt if already checked out - Refactor `promptRepoPath` to verify current repository before prompting - Add comprehensive test coverage for repository path prompting and validation logic.
| @@ -0,0 +1,221 @@ | |||
| package agents | |||
There was a problem hiding this comment.
Is there a reason we don't use the polly tar functions here?
| if provider != "" && !provider.IsValid() { | ||
| return fmt.Errorf("%s is not a valid AgentRuntimeType", decoded.Provider) | ||
| } | ||
| *m = SessionManifest{ |
There was a problem hiding this comment.
is this idiomatic? Seems super weird to just reinitialize against the pointer.
Summary
This pull request introduces a new
agentscommand group to the CLI, enabling users to list and resume Plural agent runs, including restoring local sessions from uploaded data. The implementation includes a new command structure, supporting services, and comprehensive tests for the resume functionality. Additionally, several dependencies are updated ingo.mod.New agents command and resume functionality:
agentscommand group with aresumesubcommand to list and restore/resume Plural agent runs locally, including interactive selection of runs and pull requests. (cmd/command/agents/agents.go,cmd/command/agents/resume.go) [1] [2]Servicetype that handles session restoration, user interaction, and display formatting for agent runs and prompts. (cmd/command/agents/resume.go)agentscommand in the main CLI application. (cmd/command/plural/plural.go) [1] [2]Dependency updates:
go.mod, includinggithub.com/pluralsh/console/go/client,github.com/pluralsh/console/go/controller,github.com/fatih/color,google.golang.org/grpc,k8s.io/api,k8s.io/client-go, and others, to newer versions. (go.mod) [1] [2] [3] [4] [5] [6] [7]Labels
Test Plan
Locally w/ plrl-dev-aws agent runs for codex/gemini/claude/opencode
Checklist