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:
@ -42,12 +42,13 @@ describe("TauriAgentGateway invoke payloads", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("list_agents / read / delete pass top-level args (no request wrapper)", async () => {
|
||||
it("list_agents / read / delete pass top-level args and unwrap read context DTO", async () => {
|
||||
const gw = new TauriAgentGateway();
|
||||
await gw.listAgents("p");
|
||||
expect(invoke).toHaveBeenCalledWith("list_agents", { projectId: "p" });
|
||||
|
||||
await gw.readContext("p", "a");
|
||||
invoke.mockResolvedValueOnce({ content: "# context" });
|
||||
await expect(gw.readContext("p", "a")).resolves.toBe("# context");
|
||||
expect(invoke).toHaveBeenCalledWith("read_agent_context", {
|
||||
projectId: "p",
|
||||
agentId: "a",
|
||||
|
||||
Reference in New Issue
Block a user