feat(FN-3606): correct chat-bound message routing and stabilize merger auto
Merger receives substantial hardening: autostash race-rescue with de-duplication, advisory observer for destructive operations, and subject-line preference for step headlines. The TUI gains a narrow log-split mode on System panel with proper back-navigation to the main pane. Chat header and mobile n Fusion-Task-Id: FN-3606
This commit is contained in:
@@ -716,6 +716,23 @@ describe("createSendMessageTool", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each(["dashboard", "user:dashboard", "User: user:dashboard"])(
|
||||
"infers agent-to-user when type is omitted for dashboard alias '%s'",
|
||||
async (dashboardAlias) => {
|
||||
const mockMessage = createMessage({ toId: "dashboard", toType: "user", type: "agent-to-user" });
|
||||
vi.mocked(messageStore.sendMessage).mockReturnValue(mockMessage);
|
||||
|
||||
await executeTool(tool, {
|
||||
to_id: dashboardAlias,
|
||||
content: "Test",
|
||||
});
|
||||
|
||||
expect(messageStore.sendMessage).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ toId: "dashboard", toType: "user", type: "agent-to-user" }),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("uses provided type when specified and maps recipient type for agent-to-user", async () => {
|
||||
const mockMessage = createMessage({ toType: "user", type: "agent-to-user" });
|
||||
vi.mocked(messageStore.sendMessage).mockReturnValue(mockMessage);
|
||||
|
||||
@@ -1431,7 +1431,9 @@ export function createSendMessageTool(messageStore: MessageStore, fromAgentId: s
|
||||
}
|
||||
|
||||
try {
|
||||
const messageType = params.type ?? "agent-to-agent";
|
||||
const inferredDashboardRecipient = normalizeMessageParticipant(params.to_id, "user");
|
||||
const messageType = params.type
|
||||
?? (inferredDashboardRecipient.id === DASHBOARD_USER_ID ? "agent-to-user" : "agent-to-agent");
|
||||
const recipientType: "user" | "agent" = messageType === "agent-to-user" ? "user" : "agent";
|
||||
const recipient = recipientType === "user"
|
||||
? normalizeMessageParticipant(params.to_id, recipientType)
|
||||
|
||||
Reference in New Issue
Block a user