Ideas · Builder Notes
Stopping an agent mid-action and recovering cleanly
Kognita alpha now really aborts in-flight MCP calls, keeps uncertain actions pending, waits for them on recovery and keeps recovery retryable until compensation succeeds.
Before
A kill switch that does not close the socket, or a recovery that ignores running actions, leaves the system in an unknown state.
After
The MCP HTTP transport closes the upstream socket on cancellation. A durable pending-action row is written before any external effect. Timeouts and unconfirmed cancellations stay pending as uncertain. Recovery waits for in-flight actions and marks a run recovered only when every compensation completed. Containment alerts are delivered.
Containment and in-flight stop items of the 0.5 definition of done closed.
Why it matters
An aborted connection is recorded as aborted, not as a confirmed cancellation.
Uncertain actions can block recovery until the backend reports back.
Model uncertainty explicitly. 'We do not know if it ran' is a state of its own.
Sources
Kognita is an open-source alpha. This note comes from Kognita PR #75, Kognita PR #79, Kognita PR #91, Kognita PR #95, Kognita PR #103 in the Kognita repository.
