feat(domain,application,infrastructure,backend,web-server,app-tauri,frontend): persistance et reprise des conversations de CLI custom par agent — index durable <projet>/.ideai/conversations/custom-index.json borné aux conversations non vides par agent (conversation_id logique, titre dérivé de la première invite, created/updated_at_ms), port CustomConversationIndex + adaptateur FsCustomConversationIndex, persistence des messages utilisateur et finals agent dans le log de conversation existant, DTO/commandes app-tauri et routes web-server pour lister/rouvrir, CustomAgentChatView: ouverture par défaut sur une nouvelle conversation, menu reprise d'une conversation passée ou nouvelle conversation, replay de l'historique sauvegardé (user+finals) à la réouverture, affichage normal des nouveaux messages après reprise, /clean ouvre une nouvelle conversation, aucune entrée créée si la conversation courante est vide, injection de l'historique dans le contexte agent différée au premier nouveau message après reprise — #363 (QA verte: git diff --check, cargo fmt --all -- --check, cargo tests ciblés infrastructure/application/web-server/app-tauri/backend, npm run typecheck, tests frontend ciblés et CustomAgentChatView, npm run build)

This commit is contained in:
2026-09-16 23:20:31 +02:00
parent 83b78f438f
commit 943c4525d7
30 changed files with 1794 additions and 109 deletions

View File

@ -918,6 +918,44 @@ async fn global_idea_cli_preference_applies_to_a_new_human_launch() {
assert_eq!(f.pty.spawn_count(), 0);
}
#[tokio::test]
async fn explicit_custom_chat_gets_a_fresh_logical_conversation_without_persisting_it() {
let f = launch_fixture(
structured_profile(pid(9)),
FakeFactory::new(500, Some("engine-conv")),
);
let mut input = launch_input(f.agent.id);
input.require_structured = true;
let output = f.launch.execute(input).await.unwrap();
let assigned = output
.assigned_conversation_id
.as_deref()
.and_then(|raw| Uuid::parse_str(raw).ok())
.map(ConversationId::from_uuid)
.expect("fresh logical conversation id");
assert_eq!(assigned, ConversationId::from_uuid(Uuid::from_u128(1)));
assert_ne!(
assigned,
ConversationId::for_project_pair(
project_id(),
ConversationParty::User,
ConversationParty::agent(f.agent.id),
),
"each explicit custom chat is a distinct logical thread"
);
assert_eq!(
f.structured.custom_conversation_id(&sid(500)),
Some(assigned)
);
assert_eq!(
f.structured.take_pending_resume_preamble(&sid(500)),
None,
"a fresh chat has no resume context"
);
}
#[tokio::test]
async fn explicit_native_tui_overrides_the_global_idea_cli_preference() {
let f = launch_fixture_with_preference(DefaultAgentTerminalInterface::IdeaCli);