Skip to content

Commit e2108e5

Browse files
committed
fix (tasks): planner fixes
1 parent 0249a38 commit e2108e5

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

src/client/components/tasks/TaskDetailsContent.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,20 @@ const TaskDetailsContent = ({
396396
<SwarmDetailsSection swarmDetails={displayTask.swarm_details} />
397397
)}
398398

399+
{/* --- Researched Context (if planning) --- */}
400+
{displayTask.status === "planning" && displayTask.found_context && (
401+
<div>
402+
<label className="text-sm font-medium text-neutral-400 block mb-2">
403+
Researched Context
404+
</label>
405+
<div className="bg-neutral-800/50 p-3 rounded-lg text-sm text-neutral-300 whitespace-pre-wrap border border-neutral-700/50">
406+
<ReactMarkdown className="prose prose-sm prose-invert">
407+
{displayTask.found_context}
408+
</ReactMarkdown>
409+
</div>
410+
</div>
411+
)}
412+
399413
{/* --- META INFO & ASSIGNEE --- */}
400414
<div className="grid grid-cols-2 gap-6">
401415
<div>

src/server/workers/planner/prompts.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
{retrieved_context}
1111
1212
**Core Directives:**
13-
1. **CRITICAL: USE THE RETRIEVED CONTEXT:** The "Retrieved Context" section contains vital information gathered by a research agent. You **MUST** use this information (e.g., email addresses, document contents, specific details) to create your plan. Do not ask for information that is already provided in the context.
14-
2. **CRITICAL: HANDLE CHANGE REQUESTS:** If the context includes `chat_history` and `previous_result`, you are modifying a previous task. Your new plan **MUST** use information from `previous_result` (like a `document_id` or `url`) to **MODIFY** the existing entity. **DO NOT** create a new one unless explicitly asked. The user's latest message in `chat_history` is your primary instruction.
15-
3. **Use Memory for Personalization:** If the user's request is personal or lacks details not found in the retrieved context or previous results (e.g., "email my manager"), your plan's **FIRST STEP** MUST be to call the `memory` tool to retrieve the necessary context.
16-
4. **Analyze the Goal:** After checking context and memory, deeply understand the user's objective.
17-
5. **Think Step-by-Step:** Deconstruct the goal into a logical sequence of steps.
18-
6. **Be Resourceful:** Use the provided list of tools creatively. A single action item might require multiple tool calls.
19-
7. **Anticipate Information Gaps:** If crucial information is still missing after checking all context, the first step should be to use a tool to find it (e.g., `internet_search` for public information, `gpeople` for contacts).
20-
8. **Output a Clear Plan:** Your final output must be a single, valid JSON object containing a concise description of the overall goal and a list of specific, actionable steps for the executor.
13+
1. **CRITICAL: USE THE RETRIEVED CONTEXT:** The "Retrieved Context" section contains vital information gathered by a research agent. You **MUST** use this information to inform your plan, but **DO NOT** copy the context directly into your plan steps.
14+
2. **Executor Has Context:** The executor agent who will follow your plan will also receive the full 'Retrieved Context'. Therefore, your plan steps should be high-level instructions (e.g., 'Summarize the key findings from the context') rather than copy-pasting the context itself into the plan.
15+
3. **Decompose the Goal:** Break down complex goals into smaller, sequential steps. For example, instead of one step 'Create a document with sections A, B, and C', create separate steps: 'Create the document', 'Add section A to the document', 'Add section B to the document', and 'Add section C to the document'.
16+
4. **CRITICAL: HANDLE CHANGE REQUESTS:** If the context includes `chat_history` and `previous_result`, you are modifying a previous task. Your new plan **MUST** use information from `previous_result` (like a `document_id` or `url`) to **MODIFY** the existing entity. **DO NOT** create a new one unless explicitly asked. The user's latest message in `chat_history` is your primary instruction.
17+
5. **Use Memory for Personalization:** If the user's request is personal or lacks details not found in the retrieved context or previous results (e.g., "email my manager"), your plan's **FIRST STEP** MUST be to call the `memory` tool to retrieve the necessary context.
18+
6. **Analyze the Goal:** After checking context and memory, deeply understand the user's objective.
19+
7. **Think Step-by-Step:** Deconstruct the goal into a logical sequence of steps.
20+
8. **Be Resourceful:** Use the provided list of tools creatively. A single action item might require multiple tool calls.
21+
9. **Anticipate Information Gaps:** If crucial information is still missing after checking all context, the first step should be to use a tool to find it (e.g., `internet_search` for public information, `gpeople` for contacts).
22+
10. **Output a Clear Plan:** Your final output must be a single, valid JSON object containing a concise description of the overall goal and a list of specific, actionable steps for the executor.
2123
2224
**Tool Usage Guidelines:**
2325
- `internet_search`: Use ONLY for searching for public, factual information on the web. DO NOT use it to find personal information like calendars or contacts.

0 commit comments

Comments
 (0)