Commit 73d904a
fix(webapp): suppress runFailed emit for mollifier-buffered terminal failures
`writeMollifierTerminalFailureRow` was calling `createFailedTaskRun`
without `emitRunFailedEvent: false`. The engine's `runFailed` event
handler then called `completeFailedRunEvent`, which looks up the run's
primary trace span. Buffered-only runs never had a primary trace event
written for them — the mollifier gate intercepts BEFORE
`repository.traceEvent` runs — so the lookup always failed, producing
a systematic `[runFailed] Failed to complete failed run event` error
log per drainer terminal failure. The errors are caught by the
handler's `tryCatch`, but the per-failure noise pollutes Sentry and
masks real errors.
Mirrors what `TriggerFailedTaskService` already does at
`triggerFailedTask.server.ts:212` and `:324`:
- Pass `emitRunFailedEvent: false` to suppress the trace-event mirror.
- Manually enqueue `PerformTaskRunAlertsService.enqueue(run.id)` so the
customer's ERROR channel still fires. Best-effort, logged on failure
but does not bubble (the SYSTEM_FAILURE row landing is the
load-bearing customer-visible outcome).
Also tightens the helper's return type from `boolean` to `TaskRun |
null` so the alert side has the run id without an extra lookup. Both
existing call sites (inline non-retryable + max-attempts-exhausted
callback) keep working — the `if (!wrote)` truthy check is identical
under `TaskRun | null`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ccabb6f commit 73d904a
1 file changed
Lines changed: 40 additions & 9 deletions
Lines changed: 40 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
194 | 212 | | |
195 | 213 | | |
196 | 214 | | |
197 | | - | |
| 215 | + | |
198 | 216 | | |
199 | 217 | | |
200 | 218 | | |
| |||
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
207 | | - | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
220 | 238 | | |
221 | 239 | | |
222 | 240 | | |
223 | | - | |
| 241 | + | |
224 | 242 | | |
225 | 243 | | |
226 | 244 | | |
| |||
244 | 262 | | |
245 | 263 | | |
246 | 264 | | |
| 265 | + | |
247 | 266 | | |
248 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
249 | 280 | | |
250 | 281 | | |
251 | 282 | | |
| |||
0 commit comments