fix(cli): support mode when importing agents - #4743
Open
keithpk wants to merge 2 commits into
Open
Conversation
Contributor
|
| Filename | Overview |
|---|---|
| packages/cli/src/commands/agent/import.ts | Adds the --mode option and forwards it as modeId in the import request. |
| packages/client/src/daemon-client.ts | Extends the import client input and wire request with the optional mode. |
| packages/protocol/src/messages.ts | Adds an optional, backward-compatible modeId field to the import request schema. |
| packages/server/src/server/agent/import-sessions.ts | Propagates the requested mode through fresh-import and archived-record restoration paths. |
| packages/server/src/server/agent/agent-manager.ts | Applies the mode to stored provider configuration and introduces named import and unarchive contracts. |
Sequence Diagram
sequenceDiagram
participant CLI as paseo import
participant Client as DaemonClient
participant Protocol as import_agent_request
participant Import as Import session handler
participant Manager as AgentManager
participant Provider as Provider session
CLI->>Client: importAgent(modeId?)
Client->>Protocol: import_agent_request(modeId?)
Protocol->>Import: normalized request
alt Archived Paseo record exists
Import->>Manager: unarchiveSnapshot(modeId?)
Manager->>Manager: persist updated config
else Fresh provider import
Import->>Manager: importProviderSession(modeId?)
Manager->>Provider: importSession(storedConfig)
end
Manager->>Provider: open configured session
Reviews (2): Last reviewed commit: "refactor(server): name import parameter ..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4731.
paseo importnow accepts--mode <mode>, matchingpaseo agent run --mode. The requested mode is carried through the client and optional protocol field into the daemon's import path, where it configures both fresh imports and restores of archived Paseo records before the provider session opens.Regression coverage
The CLI regression test failed before the fix because the import call omitted
modeId:After the fix:
Focused coverage for each layer:
End-to-end QA
Built the server/client stack, started an isolated daemon on
127.0.0.1:16731, and imported a real Claude Code session that had previously run in Always Ask mode:Relevant fields from the complete JSON output:
Then exercised the first tool call from the imported session:
The isolated daemon was stopped and the probe file removed after QA.
Repository checks:
Protocol compatibility
modeIdis optional onimport_agent_request. Older clients continue sending the existing shape, which the new daemon accepts; older daemons accept the new request because their Zod object schema strips the unknown optional field. No response shape changed.Platforms