[Bug]: Coalesced webhook deliveries use the old prompt after a task edit#29440
Before submitting
- I searched existing issues and discussions and did not find a duplicate.
- I can reproduce this on the current
main.
Area
apps/server
Steps
- Create an enabled webhook task with prompt
Use the original instructions., coalesce key{{body.id}}and a 10 second window. - Send one request with body
{"id":"review"}. - Before the window closes, save the task with prompt
Use the updated instructions.. - Let the window close and inspect the run and its delivery log.
Expected
The run message and the delivery log use Use the updated instructions.. The prompt should be the task's prompt at dispatch time, like its model and thread settings.
Actual
The run message and the delivery log use Use the original instructions..
On main at edc37c96c8, apps/server/src/scheduledTasks/webhookDedupe.ts:89 stores task_json for the first delivery of a window and webhookDedupe.ts:81 updates only request_json for later deliveries. apps/server/src/scheduledTasks/ScheduledTaskService.ts:2334 decodes that task snapshot and line 2337 renders its prompt. runTask then reads the current task at line 811, but uses the rendered webhook prompt at line 884 while model and thread come from the current task (lines 924 and 931).
Impact
An edited instruction does not take effect for a window that is already pending. One run can combine an old prompt with new model or thread settings. A window can last up to 3600 seconds.
Version
main at edc37c96c8 (nightly 0.1.7-nightly.20261102.4080). Found by source reading and a focused service regression test, not by a release label. The open PR #23579 moves this block into a shared drain and keeps the snapshot render there.
Workaround
Save the prompt before the first delivery opens a window. If a window is already pending, pause the task before dispatch, then enable it and send the request again.