Bind communication wakes to concrete inbox rows

Replace the worker's generic `"Continue."` default with a dispatch-time
`initialUserTurn` that is resolved per trigger. Message and peer-request
wakes now enumerate the actual unread messages (id, sender, channel,
subject, reply-to) so the agent's first user turn carries the entities
it is expected to act on, instead of idling into a status summary.

Drop the system-prompt `heartbeatFallbackSection`: its "respond with a
brief status summary" line fought the wake-reason block above it and
was the main reason communication wakes degraded into self-narration.
The wake-reason section plus the bound initial user turn now cover
every case that section was carrying.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-19 14:43:57 -04:00
1 parent e917c614c9
commit 271c6cfec8
7 files changed
+152 -14

No files matched your search

+6 -2
View File
@@ -69,10 +69,14 @@ export function buildTaskPrompt(ctx: PromptContext): string {
parts.push(`\n${m.timeAwarenessSection}`);
// Taskless runs used to emit a "respond with a brief status summary"
// nudge here. That text fought the wake-reason block above and caused
// communication wakes to degrade into self-narration. The wake-reason
// section already tells the agent what to do; the initial user turn
// (assembled at dispatch) supplies the concrete action cue — no fallback
// text is needed for the system prompt anymore.
if (ctx.task) {
parts.push(m.immediateTaskSection(ctx.task.title, ctx.task.description, ctx.task.priority));
} else {
parts.push(m.heartbeatFallbackSection);
}
return parts.join("");