You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agent investigate: a model failure partway through a run leaves no investigation record #29
cloudfall agent investigate (PR #28) writes its AgentInvestigation record only when the loop ends normally or runs out of turns (exit 93). When the model endpoint fails partway through a run (exit 92 MODEL_UNAVAILABLE), no record is written, although the decisions the earlier turns proposed are already recorded.
Reproduce
Start a local OpenAI-compatible server that answers the first chat request with a tool call proposing a mutating operation, and the second with HTTP 500
cloudfall agent investigate --alert "disk full" --base-url http://127.0.0.1:<port>/v1 --model test
Exit 92; decisions list shows the proposed decision, investigations/ has no record of the run that proposed it
Expected
The run is recorded on a 92 too, with the calls made so far and an outcome saying the model became unavailable, so every decision an agent proposed traces back to its investigation.
Confirmed on main (cb367d9, just after #28 merged): agent_investigate in sdk/src/cloudfall/app.py saves the record only after investigate() returns, so an InvestigationError or a model-unavailable exit raised mid-loop leaves investigations/ empty while the decisions proposed in earlier turns stay recorded.
Design (a stored-state change, additive to a schema that has only shipped in 0.6.0rc5):
When the endpoint fails after the run started, the record is written with the steps, turns and tokens so far, answer: "" and no finding, then the command still exits 92 MODEL_UNAVAILABLE, with the record's id in the error's context
A failure before the first request (bad endpoint, empty alert) stays exit 2 and writes nothing
PR #32 implements the design above: a model failure after the run started saves the investigation as model-unavailable (steps, turns and tokens so far, empty answer, no finding), then exits 92 with the record's id in error.context.investigation.
One choice beyond the plan: when the very first request fails (endpoint unreachable), a record with turns: 1 and no steps is written, since the request was sent. Refusals before any request (exit 2) still write nothing. The record stores no error text, because an endpoint's error body can echo the request's key.
Activity
shipmill-romamo commentedon Oct 8, 2026
Triage: implement.
Confirmed on
main(cb367d9, just after #28 merged):agent_investigateinsdk/src/cloudfall/app.pysaves the record only afterinvestigate()returns, so anInvestigationErroror a model-unavailable exit raised mid-loop leavesinvestigations/empty while the decisions proposed in earlier turns stay recorded.Design (a stored-state change, additive to a schema that has only shipped in 0.6.0rc5):
AgentInvestigation.spec.statusgainsmodel-unavailableanswer: ""and nofinding, then the command still exits 92MODEL_UNAVAILABLE, with the record's id in the error's contextshipmill-romamo commentedon Oct 8, 2026
PR #32 implements the design above: a model failure after the run started saves the investigation as
model-unavailable(steps, turns and tokens so far, emptyanswer, nofinding), then exits 92 with the record's id inerror.context.investigation.One choice beyond the plan: when the very first request fails (endpoint unreachable), a record with
turns: 1and no steps is written, since the request was sent. Refusals before any request (exit 2) still write nothing. The record stores no error text, because an endpoint's error body can echo the request's key.shipmill-romamo commentedon Oct 8, 2026
Released in v0.6.0rc6.