Repository navigation
Commit 4a6f99c
authored
refactor(agents): route terminal-reason groups through the canonical classifier (#124122)
Root AGENTS.md: terminal state normalizes via agent-run-terminal-outcome.ts;
projections must not rederive timeout/cancel precedence. Three consumers
re-enumerated the reason groups by hand, so any future reason value would
silently misclassify:
- subagent-announce-output.ts applySubagentWaitOutcome: byte-equivalent
four-way partition replaced with a switch on
classifyAgentRunTerminalOutcome (status "timeout" iff reason is a timeout
classification, per buildAgentRunTerminalOutcome).
- subagent-registry-run-wait.ts waitAborted: aborted|cancelled|superseded is
exactly classification === "cancellation" (waitBlocked stays finer-grained
intentionally).
- embedded-agent-runner terminal-outcome.ts: isEmbeddedRunTerminalTimeout /
Abort become one-liners over the classifier.
Rider: dropped the provably unreachable chatLink && !finished guard in
finalizeLifecycleEvent — peek and shift run in one synchronous frame, so the
shifted head is exactly the peeked entry (comment records the invariant).
Net -1 production LOC; 2005 tests across agents/subagents/embedded/gateway
suites green.1 parent 5419a70 commit 4a6f99c
4 files changed
Lines changed: 32 additions & 33 deletions
File tree
- src
- agents
- embedded-agent-runner/run
- subagents
- announce
- registry
- gateway
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | 364 | | |
362 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
292 | | - | |
293 | | - | |
294 | | - | |
| 295 | + | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
| 814 | + | |
| 815 | + | |
814 | 816 | | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | 817 | | |
821 | 818 | | |
822 | 819 | | |
| |||
0 commit comments