Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codeg",
"private": true,
"version": "0.23.0",
"version": "0.23.1",
"packageManager": "pnpm@11.9.0",
"scripts": {
"dev": "next dev --turbopack",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "codeg"
version = "0.23.0"
version = "0.23.1"
description = "Agent Code Generation App"
authors = ["feitao"]
edition = "2021"
Expand Down
23 changes: 20 additions & 3 deletions src-tauri/src/commands/conversations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,17 @@ fn build_scan_result(
/// Scan every local agent's sessions and reconcile them against the DB for the
/// import-picker window. Emits [`IMPORT_SCAN_PROGRESS_EVENT`] once per parser
/// while the walk runs.
///
/// The scan also refreshes the conversations that are ALREADY imported, from
/// the same parse it just did: a title generated after the first import, and
/// the transcript's own last-activity time when the user kept working on the
/// session in the agent's own CLI (see
/// [`import_service::sync_imported_sessions`]). Without this, a re-scan can
/// only ever offer the *new* sessions — the picker does not let you re-select
/// an imported one — so an already-imported conversation would keep the
/// `updated_at` it had at import time forever, and sit in the wrong place in a
/// recency-sorted sidebar. Each refreshed row is broadcast so every window and
/// web client re-sorts live.
pub async fn scan_importable_sessions_core(
conn: &sea_orm::DatabaseConnection,
emitter: &EventEmitter,
Expand Down Expand Up @@ -629,17 +640,23 @@ pub async fn scan_importable_sessions_core(
.map_err(crate::db::error::DbError::from)
.map_err(AppCommandError::from)?;
let mut imported_index: HashMap<(String, String), bool> = HashMap::new();
for row in conv_rows {
let Some(external_id) = row.external_id else {
for row in &conv_rows {
let Some(external_id) = row.external_id.clone() else {
continue;
};
let live = row.deleted_at.is_none();
let entry = imported_index
.entry((row.agent_type, external_id))
.entry((row.agent_type.clone(), external_id))
.or_insert(live);
*entry = *entry || live;
}

// Refresh the already-imported rows in place before answering, then
// broadcast each one so open sidebars re-sort without a refetch.
for id in import_service::sync_imported_sessions(conn, &conv_rows, &summaries).await {
emit_conversation_upsert(emitter, conn, id).await;
}

let folder_rows = load_folder_rows(conn).await?;
Ok(build_scan_result(summaries, &imported_index, &folder_rows))
}
Expand Down
Loading
Loading