Distinguishes between tool calls that never reached AFT and calls whose connection dropped mid-flight, so agents get accurate retry guidance instead of a bare "subc closed the connection".
A socket close after dispatch is marked outcome_unknown — bash says the command may still be running and must not be rerun; other commands advise verifying state before retrying. Classification covers bare SocketClosedError, connection_lost close reasons, and lifted connection-loss codes (ECONNRESET/EPIPE/ECONNABORTED) in adaptToolError (aft-bridge).
Calls that failed before dispatch — including bash options with no host fallback (runon, pty:true, background:true, PowerShell) and non-bash commands on a dead transport — throw a typed AftModuleUnavailableError with code: "aft_module_unavailable" and kind: "not_sent", stating nothing ran and it is safe to retry; module-reloading refusals are typed the same way.
Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue was found.
Summary
The PR separates calls that never reached AFT from calls whose replies were lost.
Dropped connections tell agents when a tool may have run.
Calls that never reach AFT say nothing ran and retrying is safe.
No new actionable issues were found.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool call fails] --> B{Explicitly not sent?}
B -->|Yes| C[Preserve safe-to-retry result]
B -->|No| D{Connection lost after dispatch?}
D -->|Yes| E[Mark outcome unknown]
E --> F{Bash call?}
F -->|Yes| G[Warn not to rerun]
F -->|No| H[Require checking state before retry]
D -->|No| I[Keep existing error handling]