Import external agent sessions in background#20284
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1ea81e3e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if selected_session_paths.insert(canonical_path) { | ||
| selected_sessions.push(session); | ||
| } |
There was a problem hiding this comment.
Preserve canonical path through background import
The request is validated against a canonical path, but the canonical value is discarded and the original path is queued for background work. Because import now runs later, that path can be retargeted (e.g., symlink swap) before prepare_validated_session_imports reads it, enabling import of a different file than was validated.
Useful? React with 👍 / 👎.
| Err(error) => { | ||
| tracing::warn!( | ||
| error = %error.message, | ||
| path = %pending_session_import.source_path.display(), | ||
| "external agent session import failed" | ||
| ); | ||
| } |
There was a problem hiding this comment.
Report session import failures instead of silently succeeding
After moving session imports to a background task, errors from import_external_agent_session are only logged and never propagated. The client already got ExternalAgentConfigImportResponse {} and later a completion notification, even when imports fail (e.g., config load/start-thread errors). Previously this path used ? and failed the request.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary:
Verification: