Skip to content

Commit 0bb060e

Browse files
Ryan KRyan K
authored andcommitted
feat(subagent): continue project plan after step delivery
1 parent 1304472 commit 0bb060e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/agents/subagent-announce.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,24 @@ function buildAnnounceReplyInstruction(params: {
10871087
if (params.requesterIsSubagent) {
10881088
return `Convert this completion into a concise internal orchestration update for your parent agent in your own words. Keep this internal context private (don't mention system/log/stats/session details or announce type). If this result is duplicate or no update is needed, reply ONLY: ${SILENT_REPLY_TOKEN}.`;
10891089
}
1090+
// After delivering to the user, check the project plan and continue or gate.
1091+
const continuationInstruction =
1092+
` After delivering, check if your active project workspace contains a PROJECT-PLAN.md.` +
1093+
` If it does, read the Active Workstreams section to identify the next step.` +
1094+
` If the next step is marked [GATE]: append a gate entry to GATE_CHECKPOINTS.md, tell the user you are waiting for their go-ahead before proceeding, and stop.` +
1095+
` If the next step has no [GATE] marker: tell the user you are proceeding to it and start it now.` +
1096+
` If there is no PROJECT-PLAN.md or no clear next action in Active Workstreams: stop normally.` +
1097+
` When a milestone stage changes, update WORKBOARD.md.`;
10901098
if (params.expectsCompletionMessage) {
1091-
return `A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type).`;
1099+
return (
1100+
`A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type).` +
1101+
continuationInstruction
1102+
);
10921103
}
1093-
return `A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type), and do not copy the internal event text verbatim. Reply ONLY: ${SILENT_REPLY_TOKEN} if this exact result was already delivered to the user in this same turn.`;
1104+
return (
1105+
`A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type), and do not copy the internal event text verbatim. Reply ONLY: ${SILENT_REPLY_TOKEN} if this exact result was already delivered to the user in this same turn.` +
1106+
continuationInstruction
1107+
);
10941108
}
10951109

10961110
function buildAnnounceSteerMessage(events: AgentInternalEvent[]): string {

0 commit comments

Comments
 (0)