Commit 3b9a884
committed
fix(workflow): align engine with ant 2.1.150 (throttle, alias, serialize guard)
Three faithful-parity fixes to the workflow engine ported in 933da2a, found
by diffing against ant 2.1.150 (3886/3892/3904):
1. Throttle backoff (hooks.ts) — ant 3886 `aH`/`r6(45000)`. After the stall
loop, detect a throttled/empty response: no stop_reason, no structured
output, <50 output tokens, yet ran >half the stall window. Sleep 45s
(abort-aware) and retry once. Without it a rate-limited workflow burns its
hard-stall (180s) retries instead of cooling down. Threaded `stop_reason`
through AgentExecResult to drive the predicate.
2. RunWorkflow alias (WorkflowTool.ts) — ant 3904 `gJ3` declares
`aliases:["RunWorkflow"]`; ccb omitted it, so the model couldn't invoke the
tool under that name.
3. Serializability guard (engine.ts) — ant 3892 `ZHK` calls `IH(M)`
(JSON.stringify) on the cloned result before returning. ccb's
structuredCloneSafe falls back to the raw value for non-cloneable inputs, so
a non-serializable result would leak into the task notification. Re-assert
JSON.stringify(cloned) so it surfaces as a workflow error instead.
Two ant divergences left as documented staged-gaps (not regressions): the
named-workflow registry (.claude/workflows/ loader + builtin merge — ccb marks
it "wired in P5") and worktree-isolation agent spawning (ccb's
`isolation:'worktree'` is currently a progress-event field only; ant serializes
real worktree creation via an ElH(1) semaphore — full worktree creation +
cleanup is a self-contained follow-up, not half-implemented here).1 parent 3279daf commit 3b9a884
3 files changed
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
123 | 150 | | |
124 | 151 | | |
125 | 152 | | |
| |||
404 | 431 | | |
405 | 432 | | |
406 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
407 | 472 | | |
408 | 473 | | |
409 | 474 | | |
| |||
445 | 510 | | |
446 | 511 | | |
447 | 512 | | |
| 513 | + | |
448 | 514 | | |
449 | 515 | | |
450 | 516 | | |
| |||
533 | 599 | | |
534 | 600 | | |
535 | 601 | | |
| 602 | + | |
536 | 603 | | |
537 | 604 | | |
538 | 605 | | |
| |||
543 | 610 | | |
544 | 611 | | |
545 | 612 | | |
| 613 | + | |
546 | 614 | | |
547 | 615 | | |
548 | 616 | | |
| |||
616 | 684 | | |
617 | 685 | | |
618 | 686 | | |
| 687 | + | |
619 | 688 | | |
620 | 689 | | |
621 | 690 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
0 commit comments