1.5 KiB
Everything passes. Let me summarize the review and fix:
Summary
Review Findings
Agent 1 (Code Reuse): No issues found. The GitCloneParams struct is a new minimal type that doesn't duplicate anything. The detect_repo_info + ssh_url_to_https pattern at call sites is the intended usage — callers construct params from existing utilities.
Agent 2 (Code Quality): No issues found. The refactor is clean — it moves detection responsibility to callers (matching the ExeSandbox/SshSandbox pattern), the new struct has only the needed fields, and the test cleanup properly removes the process-global set_current_dir hacks.
Agent 3 (Efficiency): Found one issue — the two Err match arms in clone_result (Err(e) if self.github_app.is_none() and Err(e)) had identical emit-and-fail boilerplate (~15 lines duplicated), differing only in the error message string.
Fix Applied
Merged the two duplicate Err arms into a single Err(e) arm with a conditional error message:
Err(e) => {
let err = if self.github_app.is_none() {
format!("Git clone failed: {e}. If this is a private repository, ...")
} else {
format!("Failed to clone repo into Daytona sandbox: {e}")
};
self.emit(SandboxEvent::GitCloneFailed { url, error: err.clone() });
// ... single copy of emit + return
}
This eliminated ~11 lines of duplicated code. Also fixed a missing trailing newline introduced by the agent. Build, clippy, and fmt all pass clean.