groove-dev 0.27.2 → 0.27.4
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/CHANGELOG.md +28 -0
- package/CLAUDE.md +0 -7
- package/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/daemon/src/introducer.js +39 -10
- package/node_modules/@groove-dev/daemon/src/journalist.js +20 -12
- package/node_modules/@groove-dev/daemon/src/process.js +4 -2
- package/node_modules/@groove-dev/daemon/test/journalist.test.js +30 -0
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/daemon/src/introducer.js +39 -10
- package/packages/daemon/src/journalist.js +20 -12
- package/packages/daemon/src/process.js +4 -2
- package/packages/gui/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.27.4 — Fix rotated agents abandoning mid-task work (2026-04-12)
|
|
4
|
+
|
|
5
|
+
**The bug I introduced in v0.27.1.** The rotation handoff brief told agents: *"Wait for the user's next message, then answer it directly."* That instruction was intended to prevent "Resuming after rotation" announcements — but for an agent that was mid-task when rotation fired (e.g., a planner planning, a backend writing code), it said: *stop the work, wait for the user.* The user gave a direct feature request, the planner burned 3M tokens exploring before rotation, the new planner read "wait for next message" and delivered nothing.
|
|
6
|
+
|
|
7
|
+
**Fix**
|
|
8
|
+
- Rewritten handoff brief flips the instruction: *"Finish what you were doing. The user is waiting for YOUR output. Produce it. No preamble, no announcement."*
|
|
9
|
+
- Explicitly calls out common mid-task states: "If you were a planner about to output a plan, output the plan now. If you were a builder about to make edits, make the edits."
|
|
10
|
+
- Recent User Messages section is now labeled "what they've been asking for — deliver this."
|
|
11
|
+
- Memory API contribution note de-emphasized (no longer prompts agents to proactively POST to `/api/memory/*` — it's opt-in, not a requirement).
|
|
12
|
+
|
|
13
|
+
**Regression test added** to lock the fix: any brief containing "wait for the user's next message" now fails CI.
|
|
14
|
+
|
|
15
|
+
## v0.27.3 — Planner sees ready-to-resume teammates (2026-04-12)
|
|
16
|
+
|
|
17
|
+
Fixes a Mode 1 / Mode 2 detection bug where a planner spawned duplicate agents instead of routing work to existing teammates.
|
|
18
|
+
|
|
19
|
+
**The bug**
|
|
20
|
+
When a team is created with empty prompts (the "spawn the team first, then assign tasks" pattern), the builders complete in a few seconds (no task to do → return). Their status flips to `completed`. Later, when the planner spawns and looks at its intro context, the team section only listed `running`/`starting` agents — so the planner saw "you are the only agent on this project right now" and went Mode 1, spawning duplicates instead of routing to the existing ready-to-resume team.
|
|
21
|
+
|
|
22
|
+
Not a regression from v0.27.x — this has been brittle for any empty-prompt team flow. Surfaced now.
|
|
23
|
+
|
|
24
|
+
**Fix**
|
|
25
|
+
- Introducer's team section now includes **recent completed teammates** alongside active ones, scoped to the same `teamId` with a 1-hour freshness window. Shown as "ready to resume" with an explicit note: *"Teammates marked 'ready' are part of your team. They finished their last task and will resume their session when assigned new work. If you're a planner, route new tasks to them by role — do NOT spawn duplicates."*
|
|
26
|
+
- Planner role prompt (`process.js`) updated: Mode 2 detection now references the intro context's Team section directly, not just `AGENTS_REGISTRY.md`. Explicitly instructs: *"Teammates listed as 'ready to resume' are REAL agents. They WILL pick up new work when routed. NEVER spawn a new agent of a role that already exists."*
|
|
27
|
+
|
|
28
|
+
**What this means for you**
|
|
29
|
+
The flow that felt perfect — spawn the team, then iterate with the planner task-by-task — now works regardless of whether the builders are actively running or resting between tasks.
|
|
30
|
+
|
|
3
31
|
## v0.27.2 — Drop velocity trigger (2026-04-12)
|
|
4
32
|
|
|
5
33
|
Following up on v0.27.1: the role-multiplier fix addressed the planner but left the same false-positive class live for any agent doing heavy exploration on a large codebase. Dropping velocity-based rotation entirely rather than papering over it further.
|
package/CLAUDE.md
CHANGED
|
@@ -263,10 +263,3 @@ Audit-driven release. Multi-agent orchestration system with 7 coordination layer
|
|
|
263
263
|
- Dashboard: routing donut, cache panel, context health gauges
|
|
264
264
|
- Monitor/QC agent mode (stay active, loop)
|
|
265
265
|
- Distribution: demo video, HN launch, Twitter content
|
|
266
|
-
|
|
267
|
-
<!-- GROOVE:START -->
|
|
268
|
-
## GROOVE Orchestration (auto-injected)
|
|
269
|
-
Active agents: 0
|
|
270
|
-
See AGENTS_REGISTRY.md for full agent state.
|
|
271
|
-
**Memory policy:** Ignore auto-memory. Do not read or write MEMORY.md. GROOVE manages all context.
|
|
272
|
-
<!-- GROOVE:END -->
|
|
@@ -16,10 +16,30 @@ export class Introducer {
|
|
|
16
16
|
generateContext(newAgent, options = {}) {
|
|
17
17
|
const { taskNegotiation } = options;
|
|
18
18
|
const agents = this.daemon.registry.getAll();
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
|
|
20
|
+
// Team awareness must include completed teammates, not just running ones.
|
|
21
|
+
// Agents that finished an empty-prompt standup (common pattern: spawn the
|
|
22
|
+
// team upfront, then direct them task-by-task) sit in `completed` status
|
|
23
|
+
// until resumed. Hiding them from the new agent's context makes planners
|
|
24
|
+
// falsely conclude "I'm alone" and spawn duplicate roles.
|
|
25
|
+
//
|
|
26
|
+
// Scope to the same team so one team's agents don't leak into another's
|
|
27
|
+
// context. Completed teammates get a 1-hour freshness cutoff so truly
|
|
28
|
+
// stale ones don't clutter the intro.
|
|
29
|
+
const COMPLETED_WINDOW_MS = 60 * 60 * 1000;
|
|
30
|
+
const sameTeam = (a) =>
|
|
31
|
+
a.id !== newAgent.id &&
|
|
32
|
+
(!newAgent.teamId || a.teamId === newAgent.teamId);
|
|
33
|
+
const activeOthers = agents.filter((a) =>
|
|
34
|
+
sameTeam(a) && (a.status === 'running' || a.status === 'starting')
|
|
35
|
+
);
|
|
36
|
+
const recentCompleted = agents.filter((a) => {
|
|
37
|
+
if (!sameTeam(a)) return false;
|
|
38
|
+
if (a.status !== 'completed') return false;
|
|
39
|
+
const ts = a.lastActivity ? new Date(a.lastActivity).getTime() : 0;
|
|
40
|
+
return Date.now() - ts < COMPLETED_WINDOW_MS;
|
|
41
|
+
});
|
|
42
|
+
const others = [...activeOthers, ...recentCompleted];
|
|
23
43
|
|
|
24
44
|
const lines = [
|
|
25
45
|
`# GROOVE Agent Context`,
|
|
@@ -42,8 +62,17 @@ export class Introducer {
|
|
|
42
62
|
if (others.length === 0) {
|
|
43
63
|
lines.push('You are the only agent on this project right now.');
|
|
44
64
|
} else {
|
|
45
|
-
|
|
65
|
+
const activeCount = activeOthers.length;
|
|
66
|
+
const readyCount = recentCompleted.length;
|
|
67
|
+
const parts = [];
|
|
68
|
+
if (activeCount > 0) parts.push(`${activeCount} active`);
|
|
69
|
+
if (readyCount > 0) parts.push(`${readyCount} ready to resume`);
|
|
70
|
+
lines.push(`## Team (${others.length} teammate${others.length > 1 ? 's' : ''} — ${parts.join(', ')})`);
|
|
46
71
|
lines.push('');
|
|
72
|
+
if (readyCount > 0) {
|
|
73
|
+
lines.push(`**Teammates marked "ready" are part of your team.** They finished their last task and will resume their session when assigned new work. If you're a planner, route new tasks to them by role — do NOT spawn duplicates.`);
|
|
74
|
+
lines.push('');
|
|
75
|
+
}
|
|
47
76
|
|
|
48
77
|
// Collect all files created by teammates for the project files section
|
|
49
78
|
const allTeamFiles = [];
|
|
@@ -51,7 +80,8 @@ export class Introducer {
|
|
|
51
80
|
for (const other of others) {
|
|
52
81
|
const scope = other.scope?.length > 0 ? other.scope.join(', ') : 'unrestricted';
|
|
53
82
|
const dir = other.workingDir ? ` — dir: ${other.workingDir}` : '';
|
|
54
|
-
|
|
83
|
+
const statusLabel = other.status === 'completed' ? 'ready to resume' : other.status;
|
|
84
|
+
lines.push(`- **${other.name}** (${other.role}) — scope: ${scope}${dir} — ${statusLabel}`);
|
|
55
85
|
|
|
56
86
|
// Get files this agent created/modified
|
|
57
87
|
const files = this.daemon.journalist?.getAgentFiles(other) || [];
|
|
@@ -141,10 +171,9 @@ export class Introducer {
|
|
|
141
171
|
lines.push(discoveries);
|
|
142
172
|
}
|
|
143
173
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
lines.push(`- \`POST /api/memory/constraints\` — declare a project rule you discovered`);
|
|
174
|
+
// Contributing to memory is opt-in. Only mention if the agent
|
|
175
|
+
// explicitly needs to record something — no proactive prompting.
|
|
176
|
+
// (Optional: `POST /api/memory/discoveries` or `POST /api/memory/constraints`)
|
|
148
177
|
}
|
|
149
178
|
}
|
|
150
179
|
|
|
@@ -706,14 +706,23 @@ export class Journalist {
|
|
|
706
706
|
`You are **${agent.name}** (role: ${agent.role}). This is an internal context refresh — `,
|
|
707
707
|
`the conversation with the user is ongoing and must feel seamless to them. They cannot see this brief.`,
|
|
708
708
|
``,
|
|
709
|
-
`## CRITICAL:
|
|
709
|
+
`## CRITICAL: Finish What You Were Doing`,
|
|
710
|
+
``,
|
|
711
|
+
`The previous session was mid-work when this refresh happened. YOUR JOB IS TO COMPLETE THAT WORK.`,
|
|
712
|
+
``,
|
|
713
|
+
`- If Recent User Messages show an unanswered request, deliver the answer.`,
|
|
714
|
+
`- If Recent Tool Calls show exploration/planning/building in progress, finish it and deliver the output.`,
|
|
715
|
+
`- If you were a planner about to output a plan, output the plan now.`,
|
|
716
|
+
`- If you were a builder about to make edits, make the edits.`,
|
|
710
717
|
``,
|
|
711
718
|
`Do NOT announce a restart, rotation, or resumption. Do NOT greet the user. Do NOT say `,
|
|
712
|
-
`"resuming", "
|
|
713
|
-
`
|
|
714
|
-
`
|
|
719
|
+
`"resuming", "let me check state again", "here's where I was", or anything that signals a `,
|
|
720
|
+
`break. Do NOT ask "what would you like me to do" — the user already told you. Do NOT `,
|
|
721
|
+
`just wait — the user is waiting for YOUR output.`,
|
|
722
|
+
``,
|
|
723
|
+
`From the user's perspective, the conversation never paused. Act accordingly.`,
|
|
715
724
|
``,
|
|
716
|
-
conversationSummary ? `## Recent User Messages (what they've been asking for)\n\n${conversationSummary}\n` : '',
|
|
725
|
+
conversationSummary ? `## Recent User Messages (what they've been asking for — deliver this)\n\n${conversationSummary}\n` : '',
|
|
717
726
|
recentChain ? `## Rotation History (recent)\n\n${recentChain}\n` : '',
|
|
718
727
|
`## Your Identity`,
|
|
719
728
|
`- Role: ${agent.role}`,
|
|
@@ -722,21 +731,20 @@ export class Journalist {
|
|
|
722
731
|
agent.workingDir ? `- Working directory: ${agent.workingDir}` : '',
|
|
723
732
|
``,
|
|
724
733
|
`## Session State`,
|
|
725
|
-
`- Tokens used: ${agent.tokensUsed}`,
|
|
726
|
-
`- Tool calls: ${entries.filter((e) => e.type === 'tool').length}`,
|
|
734
|
+
`- Tokens used before refresh: ${agent.tokensUsed}`,
|
|
735
|
+
`- Tool calls completed: ${entries.filter((e) => e.type === 'tool').length}`,
|
|
727
736
|
``,
|
|
728
|
-
toolSummary ? `### Recent tool calls\n${toolSummary}\n` : '',
|
|
737
|
+
toolSummary ? `### Recent tool calls (what you were doing)\n${toolSummary}\n` : '',
|
|
729
738
|
resultSummary ? `### Last results\n${resultSummary}\n` : '',
|
|
730
739
|
errorSummary ? `### Unresolved errors\n${errorSummary}\n` : '',
|
|
731
740
|
`## Current Project State`,
|
|
732
741
|
``,
|
|
733
742
|
projectMap ? projectMap.slice(0, 10000) : 'No project map available yet.',
|
|
734
743
|
``,
|
|
735
|
-
`##
|
|
744
|
+
`## Your Next Action`,
|
|
736
745
|
``,
|
|
737
|
-
`
|
|
738
|
-
`
|
|
739
|
-
`that naturally. Match the tone and continuity of a conversation that never paused.`,
|
|
746
|
+
`Look at Recent User Messages and Recent Tool Calls. Decide what output the user is waiting `,
|
|
747
|
+
`for right now. Produce it. No preamble, no announcement, just the answer or work product.`,
|
|
740
748
|
agent.workingDir ? `Stay within your working directory: ${agent.workingDir}.` : '',
|
|
741
749
|
agent.prompt ? `\nOriginal task context: ${agent.prompt}` : '',
|
|
742
750
|
].filter(Boolean).join('\n');
|
|
@@ -196,8 +196,10 @@ Do NOT re-explore the entire codebase. You already know it from team creation.
|
|
|
196
196
|
Just read the specific files related to the bug/feature, decide which existing agent should handle it, and write the routing config. This should be FAST — under 5 tool calls.
|
|
197
197
|
|
|
198
198
|
HOW TO DETECT WHICH MODE:
|
|
199
|
-
-
|
|
200
|
-
- If no
|
|
199
|
+
- Check the Team section of YOUR intro context (above this prompt). If it lists any teammates — active OR ready-to-resume — you are in MODE 2.
|
|
200
|
+
- If no teammates exist or only a planner exists, you are in MODE 1.
|
|
201
|
+
- Teammates listed as "ready to resume" are REAL agents on your team. They finished their last task and await new instructions. They WILL pick up new work when you route it to them via recommended-team.json. Do NOT treat them as absent.
|
|
202
|
+
- NEVER spawn a new agent of a role that already exists in your team. A second backend when a backend already exists is always a bug.
|
|
201
203
|
|
|
202
204
|
After completing your plan, you MUST write .groove/recommended-team.json — EVERY TIME, no exceptions.
|
|
203
205
|
|
|
@@ -201,6 +201,36 @@ describe('Journalist', () => {
|
|
|
201
201
|
assert.ok(brief.includes('Build the auth API'));
|
|
202
202
|
assert.ok(brief.includes('Write'));
|
|
203
203
|
});
|
|
204
|
+
|
|
205
|
+
it('instructs the agent to deliver the output, not passively wait', async () => {
|
|
206
|
+
// Regression test: v0.27.1 brief told the agent to "wait for the user's
|
|
207
|
+
// next message" which caused planners to sit idle mid-plan after a
|
|
208
|
+
// rotation, burning tokens without producing output. Agents must be
|
|
209
|
+
// told to finish the work in flight, not wait for further prompting.
|
|
210
|
+
const { daemon, grooveDir } = createMockDaemon();
|
|
211
|
+
const journalist = new Journalist(daemon);
|
|
212
|
+
writeFileSync(join(grooveDir, 'logs', 'planner-1.log'), JSON.stringify({
|
|
213
|
+
type: 'assistant',
|
|
214
|
+
message: { content: [{ type: 'tool_use', name: 'Read', input: { file_path: 'src/index.js' } }] },
|
|
215
|
+
}));
|
|
216
|
+
|
|
217
|
+
const agent = {
|
|
218
|
+
id: 'p1', name: 'planner-1', role: 'planner',
|
|
219
|
+
provider: 'claude-code', scope: [],
|
|
220
|
+
tokensUsed: 2_000_000, prompt: 'Plan voice integrations',
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const brief = await journalist.generateHandoffBrief(agent);
|
|
224
|
+
|
|
225
|
+
// The brief MUST NOT contain the old passive instruction
|
|
226
|
+
assert.ok(!/wait for the user's next message/i.test(brief),
|
|
227
|
+
'brief must not tell agent to wait for next message');
|
|
228
|
+
// The brief MUST tell the agent to complete/deliver the work
|
|
229
|
+
assert.ok(/finish|deliver|complete|produce it/i.test(brief),
|
|
230
|
+
'brief must instruct the agent to finish the work');
|
|
231
|
+
// Pass-through: planner-specific instruction
|
|
232
|
+
assert.ok(/output the plan|deliver/i.test(brief));
|
|
233
|
+
});
|
|
204
234
|
});
|
|
205
235
|
|
|
206
236
|
describe('status', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groove-dev",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.4",
|
|
4
4
|
"description": "Open-source agent orchestration layer — the AI company OS. Local model agent engine (GGUF/Ollama/llama-server), HuggingFace model browser, MCP integrations (Slack, Gmail, Stripe, 15+), agent scheduling (cron), business roles (CMO, CFO, EA). GUI dashboard, multi-agent coordination, zero cold-start, infinite sessions. Works with Claude Code, Codex, Gemini CLI, Ollama, any local model.",
|
|
5
5
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
6
|
"author": "Groove Dev <hello@groovedev.ai> (https://groovedev.ai)",
|
|
@@ -16,10 +16,30 @@ export class Introducer {
|
|
|
16
16
|
generateContext(newAgent, options = {}) {
|
|
17
17
|
const { taskNegotiation } = options;
|
|
18
18
|
const agents = this.daemon.registry.getAll();
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
|
|
20
|
+
// Team awareness must include completed teammates, not just running ones.
|
|
21
|
+
// Agents that finished an empty-prompt standup (common pattern: spawn the
|
|
22
|
+
// team upfront, then direct them task-by-task) sit in `completed` status
|
|
23
|
+
// until resumed. Hiding them from the new agent's context makes planners
|
|
24
|
+
// falsely conclude "I'm alone" and spawn duplicate roles.
|
|
25
|
+
//
|
|
26
|
+
// Scope to the same team so one team's agents don't leak into another's
|
|
27
|
+
// context. Completed teammates get a 1-hour freshness cutoff so truly
|
|
28
|
+
// stale ones don't clutter the intro.
|
|
29
|
+
const COMPLETED_WINDOW_MS = 60 * 60 * 1000;
|
|
30
|
+
const sameTeam = (a) =>
|
|
31
|
+
a.id !== newAgent.id &&
|
|
32
|
+
(!newAgent.teamId || a.teamId === newAgent.teamId);
|
|
33
|
+
const activeOthers = agents.filter((a) =>
|
|
34
|
+
sameTeam(a) && (a.status === 'running' || a.status === 'starting')
|
|
35
|
+
);
|
|
36
|
+
const recentCompleted = agents.filter((a) => {
|
|
37
|
+
if (!sameTeam(a)) return false;
|
|
38
|
+
if (a.status !== 'completed') return false;
|
|
39
|
+
const ts = a.lastActivity ? new Date(a.lastActivity).getTime() : 0;
|
|
40
|
+
return Date.now() - ts < COMPLETED_WINDOW_MS;
|
|
41
|
+
});
|
|
42
|
+
const others = [...activeOthers, ...recentCompleted];
|
|
23
43
|
|
|
24
44
|
const lines = [
|
|
25
45
|
`# GROOVE Agent Context`,
|
|
@@ -42,8 +62,17 @@ export class Introducer {
|
|
|
42
62
|
if (others.length === 0) {
|
|
43
63
|
lines.push('You are the only agent on this project right now.');
|
|
44
64
|
} else {
|
|
45
|
-
|
|
65
|
+
const activeCount = activeOthers.length;
|
|
66
|
+
const readyCount = recentCompleted.length;
|
|
67
|
+
const parts = [];
|
|
68
|
+
if (activeCount > 0) parts.push(`${activeCount} active`);
|
|
69
|
+
if (readyCount > 0) parts.push(`${readyCount} ready to resume`);
|
|
70
|
+
lines.push(`## Team (${others.length} teammate${others.length > 1 ? 's' : ''} — ${parts.join(', ')})`);
|
|
46
71
|
lines.push('');
|
|
72
|
+
if (readyCount > 0) {
|
|
73
|
+
lines.push(`**Teammates marked "ready" are part of your team.** They finished their last task and will resume their session when assigned new work. If you're a planner, route new tasks to them by role — do NOT spawn duplicates.`);
|
|
74
|
+
lines.push('');
|
|
75
|
+
}
|
|
47
76
|
|
|
48
77
|
// Collect all files created by teammates for the project files section
|
|
49
78
|
const allTeamFiles = [];
|
|
@@ -51,7 +80,8 @@ export class Introducer {
|
|
|
51
80
|
for (const other of others) {
|
|
52
81
|
const scope = other.scope?.length > 0 ? other.scope.join(', ') : 'unrestricted';
|
|
53
82
|
const dir = other.workingDir ? ` — dir: ${other.workingDir}` : '';
|
|
54
|
-
|
|
83
|
+
const statusLabel = other.status === 'completed' ? 'ready to resume' : other.status;
|
|
84
|
+
lines.push(`- **${other.name}** (${other.role}) — scope: ${scope}${dir} — ${statusLabel}`);
|
|
55
85
|
|
|
56
86
|
// Get files this agent created/modified
|
|
57
87
|
const files = this.daemon.journalist?.getAgentFiles(other) || [];
|
|
@@ -141,10 +171,9 @@ export class Introducer {
|
|
|
141
171
|
lines.push(discoveries);
|
|
142
172
|
}
|
|
143
173
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
lines.push(`- \`POST /api/memory/constraints\` — declare a project rule you discovered`);
|
|
174
|
+
// Contributing to memory is opt-in. Only mention if the agent
|
|
175
|
+
// explicitly needs to record something — no proactive prompting.
|
|
176
|
+
// (Optional: `POST /api/memory/discoveries` or `POST /api/memory/constraints`)
|
|
148
177
|
}
|
|
149
178
|
}
|
|
150
179
|
|
|
@@ -706,14 +706,23 @@ export class Journalist {
|
|
|
706
706
|
`You are **${agent.name}** (role: ${agent.role}). This is an internal context refresh — `,
|
|
707
707
|
`the conversation with the user is ongoing and must feel seamless to them. They cannot see this brief.`,
|
|
708
708
|
``,
|
|
709
|
-
`## CRITICAL:
|
|
709
|
+
`## CRITICAL: Finish What You Were Doing`,
|
|
710
|
+
``,
|
|
711
|
+
`The previous session was mid-work when this refresh happened. YOUR JOB IS TO COMPLETE THAT WORK.`,
|
|
712
|
+
``,
|
|
713
|
+
`- If Recent User Messages show an unanswered request, deliver the answer.`,
|
|
714
|
+
`- If Recent Tool Calls show exploration/planning/building in progress, finish it and deliver the output.`,
|
|
715
|
+
`- If you were a planner about to output a plan, output the plan now.`,
|
|
716
|
+
`- If you were a builder about to make edits, make the edits.`,
|
|
710
717
|
``,
|
|
711
718
|
`Do NOT announce a restart, rotation, or resumption. Do NOT greet the user. Do NOT say `,
|
|
712
|
-
`"resuming", "
|
|
713
|
-
`
|
|
714
|
-
`
|
|
719
|
+
`"resuming", "let me check state again", "here's where I was", or anything that signals a `,
|
|
720
|
+
`break. Do NOT ask "what would you like me to do" — the user already told you. Do NOT `,
|
|
721
|
+
`just wait — the user is waiting for YOUR output.`,
|
|
722
|
+
``,
|
|
723
|
+
`From the user's perspective, the conversation never paused. Act accordingly.`,
|
|
715
724
|
``,
|
|
716
|
-
conversationSummary ? `## Recent User Messages (what they've been asking for)\n\n${conversationSummary}\n` : '',
|
|
725
|
+
conversationSummary ? `## Recent User Messages (what they've been asking for — deliver this)\n\n${conversationSummary}\n` : '',
|
|
717
726
|
recentChain ? `## Rotation History (recent)\n\n${recentChain}\n` : '',
|
|
718
727
|
`## Your Identity`,
|
|
719
728
|
`- Role: ${agent.role}`,
|
|
@@ -722,21 +731,20 @@ export class Journalist {
|
|
|
722
731
|
agent.workingDir ? `- Working directory: ${agent.workingDir}` : '',
|
|
723
732
|
``,
|
|
724
733
|
`## Session State`,
|
|
725
|
-
`- Tokens used: ${agent.tokensUsed}`,
|
|
726
|
-
`- Tool calls: ${entries.filter((e) => e.type === 'tool').length}`,
|
|
734
|
+
`- Tokens used before refresh: ${agent.tokensUsed}`,
|
|
735
|
+
`- Tool calls completed: ${entries.filter((e) => e.type === 'tool').length}`,
|
|
727
736
|
``,
|
|
728
|
-
toolSummary ? `### Recent tool calls\n${toolSummary}\n` : '',
|
|
737
|
+
toolSummary ? `### Recent tool calls (what you were doing)\n${toolSummary}\n` : '',
|
|
729
738
|
resultSummary ? `### Last results\n${resultSummary}\n` : '',
|
|
730
739
|
errorSummary ? `### Unresolved errors\n${errorSummary}\n` : '',
|
|
731
740
|
`## Current Project State`,
|
|
732
741
|
``,
|
|
733
742
|
projectMap ? projectMap.slice(0, 10000) : 'No project map available yet.',
|
|
734
743
|
``,
|
|
735
|
-
`##
|
|
744
|
+
`## Your Next Action`,
|
|
736
745
|
``,
|
|
737
|
-
`
|
|
738
|
-
`
|
|
739
|
-
`that naturally. Match the tone and continuity of a conversation that never paused.`,
|
|
746
|
+
`Look at Recent User Messages and Recent Tool Calls. Decide what output the user is waiting `,
|
|
747
|
+
`for right now. Produce it. No preamble, no announcement, just the answer or work product.`,
|
|
740
748
|
agent.workingDir ? `Stay within your working directory: ${agent.workingDir}.` : '',
|
|
741
749
|
agent.prompt ? `\nOriginal task context: ${agent.prompt}` : '',
|
|
742
750
|
].filter(Boolean).join('\n');
|
|
@@ -196,8 +196,10 @@ Do NOT re-explore the entire codebase. You already know it from team creation.
|
|
|
196
196
|
Just read the specific files related to the bug/feature, decide which existing agent should handle it, and write the routing config. This should be FAST — under 5 tool calls.
|
|
197
197
|
|
|
198
198
|
HOW TO DETECT WHICH MODE:
|
|
199
|
-
-
|
|
200
|
-
- If no
|
|
199
|
+
- Check the Team section of YOUR intro context (above this prompt). If it lists any teammates — active OR ready-to-resume — you are in MODE 2.
|
|
200
|
+
- If no teammates exist or only a planner exists, you are in MODE 1.
|
|
201
|
+
- Teammates listed as "ready to resume" are REAL agents on your team. They finished their last task and await new instructions. They WILL pick up new work when you route it to them via recommended-team.json. Do NOT treat them as absent.
|
|
202
|
+
- NEVER spawn a new agent of a role that already exists in your team. A second backend when a backend already exists is always a bug.
|
|
201
203
|
|
|
202
204
|
After completing your plan, you MUST write .groove/recommended-team.json — EVERY TIME, no exceptions.
|
|
203
205
|
|