fix(agents): unwrap read_agent_context DTO content (#140)

Le contexte projet d'un agent s'affichait "[object Object]" et se
vidait à la réouverture du panneau : read_agent_context renvoie déjà
{content} côté backend, mais les gateways front traitaient la réponse
comme une string brute. Les deux gateways (Tauri + HTTP) unwrap
maintenant .content ; type AgentContextDocument ajouté au domaine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 14:35:36 +02:00
parent cf61060ffb
commit 863d9b7277
10 changed files with 135 additions and 6 deletions

View File

@ -16,6 +16,7 @@ import { Channel, invoke } from "@tauri-apps/api/core";
import type {
Agent,
AgentContextDocument,
EffortSelection,
ResumableAgent,
TerminalSession,
@ -117,7 +118,10 @@ export class TauriAgentGateway implements AgentGateway {
}
readContext(projectId: string, agentId: string): Promise<string> {
return invoke<string>("read_agent_context", { projectId, agentId });
return invoke<AgentContextDocument>("read_agent_context", {
projectId,
agentId,
}).then((res) => res.content);
}
async updateContext(