@myvillage/cli 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent-runtime/loop.js +12 -2
package/package.json
CHANGED
|
@@ -152,8 +152,18 @@ export async function agentLoop(agentName, { signal }) {
|
|
|
152
152
|
mentionsFound = contextResult.mentionsCount;
|
|
153
153
|
|
|
154
154
|
if (activeTask) {
|
|
155
|
-
|
|
156
|
-
context
|
|
155
|
+
// A claimed task takes over the iteration. The default monitoring
|
|
156
|
+
// context becomes secondary background; the instruction is the
|
|
157
|
+
// primary user prompt and the system prompt switches to a
|
|
158
|
+
// task-execution framing so the LLM doesn't drift back into
|
|
159
|
+
// "report on the feed" mode.
|
|
160
|
+
const instructionText = activeTask.instruction
|
|
161
|
+
|| (activeTask.input ? JSON.stringify(activeTask.input, null, 2) : '');
|
|
162
|
+
|
|
163
|
+
systemPrompt = `${systemPrompt}\n\n## ACTIVE TASK MODE\nA client has assigned you a task. Your job this iteration is to execute the instruction below using your available tools. The feed context is provided only for situational awareness — do not let "no new feed activity" prevent you from carrying out the task.`;
|
|
164
|
+
|
|
165
|
+
context = `## TASK (id=${activeTask.id}, type=${activeTask.taskType})\n${instructionText}\n\n---\n\n## FEED CONTEXT (for awareness only)\n${context}`;
|
|
166
|
+
|
|
157
167
|
logActivity(agentDir, { type: 'task_claimed', taskId: activeTask.id, taskType: activeTask.taskType });
|
|
158
168
|
}
|
|
159
169
|
|