Use INSERT OR REPLACE for archived worktree records

Richard Feldman created

The archived_git_worktrees table has a unique index on worktree_path.
A plain INSERT would fail if the same path was archived again. Using
INSERT OR REPLACE ensures the old record is replaced with the new
archive state.

Change summary

crates/agent_ui/src/thread_metadata_store.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/agent_ui/src/thread_metadata_store.rs 🔗

@@ -710,7 +710,7 @@ impl ThreadMetadataDb {
         self.write(move |conn| {
             let mut stmt = Statement::prepare(
                 conn,
-                "INSERT INTO archived_git_worktrees(\
+                "INSERT OR REPLACE INTO archived_git_worktrees(\
                      worktree_path, main_repo_path, branch_name, commit_hash\
                  ) VALUES (?, ?, ?, ?)",
             )?;