Phase 7: add sendImmediateReinjectAllFollowUp — queue all blocks when streaming or willRetry.

Uses deliverAs followUp for every skill block so re-inject does not interrupt an active agent turn or overflow recovery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 11:58:29 +07:00
parent 446a186431
commit dc73ea9747
+13
View File
@@ -113,6 +113,19 @@ export function sendImmediateReinjectIdle(
});
}
/** Immediate path when streaming or overflow willRetry: all blocks as followUp (SPEC §5.2, §6.5.2). */
export function sendImmediateReinjectAllFollowUp(
pi: ExtensionAPI,
skillNames: readonly string[],
state: ExtensionState,
settings: SkillReinjectSettings,
registeredSkills: readonly Pick<Skill, "name" | "filePath" | "baseDir">[],
): void {
for (const block of buildReinjectBlocks(skillNames, state, settings, registeredSkills)) {
pi.sendUserMessage(block, { deliverAs: "followUp" });
}
}
/**
* Defer path on before_agent_start: inject one combined message, then clear queue (SPEC §6.5.1).
* Returns undefined when pendingReinject is empty.