feat(FN-2128): merge fusion/fn-2128

This commit is contained in:
Fusion
2026-04-19 07:06:37 -07:00
committed by gsxdsm
parent 7ed7cf3277
commit d47694036f
3 changed files with 30 additions and 10 deletions

View File

@@ -827,7 +827,7 @@ describe("PlanningModeModal", () => {
});
expect(screen.getByText("List your acceptance criteria")).toBeDefined();
expect(screen.getByText("Medium")).toBeDefined();
expect(within(screen.getByTestId("conversation-history")).getByText("Medium")).toBeDefined();
expect(screen.getByText("Must support offline mode")).toBeDefined();
expect(screen.getByText("What should we prioritize next?")).toBeDefined();
});

View File

@@ -2388,24 +2388,39 @@ describe("HeartbeatMonitor", () => {
});
describe("execution", () => {
it("HEARTBEAT_NO_TASK_SYSTEM_PROMPT does not mention task-scoped tools", () => {
it("no-task system prompt does not reference task_log or task_document tools", () => {
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).not.toContain("task_log");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).not.toContain("task_document_write");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).not.toContain("task_document_read");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).not.toContain("task_document");
});
it("no-task system prompt references only available tools", () => {
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("task_create");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("list_agents");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("delegate_task");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("read_messages");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("send_message");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("read_messages");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("memory_search");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("memory_get");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("memory_append");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("heartbeat_done");
});
it("HEARTBEAT_SYSTEM_PROMPT mentions task_log and task_document_write", () => {
it("task-scoped system prompt still references task_log and task_document tools", () => {
expect(HEARTBEAT_SYSTEM_PROMPT).toContain("task_log");
expect(HEARTBEAT_SYSTEM_PROMPT).toContain("task_document_write");
expect(HEARTBEAT_SYSTEM_PROMPT).toContain("task_document tools");
});
it("both prompts include memory boundaries section", () => {
expect(HEARTBEAT_SYSTEM_PROMPT).toContain("## Memory Boundaries");
expect(HEARTBEAT_NO_TASK_SYSTEM_PROMPT).toContain("## Memory Boundaries");
});
it("no-task system prompt processing messages section does not reference task_log", () => {
const processingMessagesSection = HEARTBEAT_NO_TASK_SYSTEM_PROMPT.split("## Processing Messages")[1] ?? "";
expect(processingMessagesSection).not.toContain("task_log");
});
it("creates session with enriched system prompt and expected tools", async () => {

View File

@@ -166,7 +166,7 @@ When sending messages:
* System prompt for no-task heartbeat agent sessions.
* Instructs the agent to perform ambient work only with tools that do not require task context.
*/
export const HEARTBEAT_NO_TASK_SYSTEM_PROMPT = `You are a heartbeat agent running in a short execution window.
export const HEARTBEAT_NO_TASK_SYSTEM_PROMPT = `You are a heartbeat agent running in a short execution window with no task assignment.
Your job:
1. Review your context — check messages, memory, and project state.
@@ -176,7 +176,12 @@ Your job:
5. Call heartbeat_done when finished with an optional summary of what was accomplished.
Keep work lightweight — this is a single-pass ambient check, not a full implementation run.
You have readonly file access plus task_create, list_agents, delegate_task, send_message, read_messages, memory_search, memory_append, and heartbeat_done.
You have readonly file access plus:
- task_create
- list_agents and delegate_task
- memory_search, memory_get, and memory_append
- heartbeat_done
- send_message and read_messages when messaging is enabled for this run (they may not always be available)
## Memory Boundaries
@@ -188,11 +193,11 @@ You may receive an Agent Memory section and a Project Memory section.
## Processing Messages
When you are woken by an incoming message (source includes "wake-on-message"), you should:
1. Use read_messages to check your inbox for unread messages.
1. If read_messages is available, use it to check your inbox for unread messages.
2. Review each message and determine the appropriate action:
- If the message requires a response, use send_message to reply.
- If the message is informational, acknowledge it and respond via send_message if appropriate.
- If the message requests work, create a follow-up task with task_create or handle it directly.
- If the message requires a response and send_message is available, use send_message to reply.
- If the message is informational, acknowledge it and respond via send_message when appropriate.
- If the message requests work, create a follow-up task with task_create.
3. After processing messages, continue with your ambient work.
When sending messages: