Commit 76cfb33
fix(executor): address two code-forge:review warnings
Two warnings from the code-forge:review pass on the cleanup-2026-04
round, neither blocker but both worth resolving before push:
1. _translate_abort approval branch is structurally unreachable for
the built-in BuiltinApprovalGate (which raises typed
Approval{Denied,Timeout,Pending}Error subclasses directly, never
aborts via StepResult). The string-matching synthetic-result branch
only fired for hypothetical custom approval steps that aborted
with explanation strings — undocumented and fragile. Delete the
branch and document the contract: custom approval steps MUST
raise the typed Approval*Error subclass with a real
ApprovalResult, not abort with explanation strings. Drops three
now-unused error imports from executor.py.
2. stream() Phase 3 was swallowing post-stream output_validation /
middleware_after errors with bare `except: pass`. The "non-fatal
for already-yielded chunks" comment is correct (chunks are
already out the door), but silent failure makes bad streams
undebuggable. Replace with _logger.debug(... exc_info=True) so the
failure is still discoverable.
Verification: ruff ✓ black ✓ pyright 0 errors ✓ pytest 2252/2252 ✓.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8818bb5 commit 76cfb33
1 file changed
Lines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
491 | 488 | | |
492 | 489 | | |
493 | 490 | | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
504 | 498 | | |
505 | 499 | | |
506 | 500 | | |
| |||
682 | 676 | | |
683 | 677 | | |
684 | 678 | | |
685 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
686 | 688 | | |
687 | 689 | | |
688 | 690 | | |
| |||
0 commit comments