Repository navigation
Record the investigation when the model endpoint fails partway - #32
Merged
Merged
Conversation
agent investigate now saves its AgentInvestigation, ended model-unavailable with the steps, turns and tokens so far, before exiting 92 MODEL_UNAVAILABLE, and names it in error.context.investigation. Decisions proposed in earlier turns are no longer left without the investigation that produced them. The chat transport raises InvestigationError instead of exiting, so investigate() can keep the run up to the failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloudfall agent investigatesaved itsAgentInvestigationonly after the loop returned, so a model endpoint failing partway (exit 92) left decisions from earlier turns without the investigation that proposed them.AgentInvestigation.spec.statusgainsmodel-unavailable(additive; the schema has only shipped in 0.6.0rc5)investigate()catches anyInvestigationErroronce the run started and raisesModelUnavailableError, which carries the investigation so far: steps, turns and tokens,answer: "", nofindingagent investigatesaves that record, then still exits 92MODEL_UNAVAILABLEwith the record's id inerror.context.investigation; a failure to save it exitsPRECONDITION, as the success path doesInvestigationError(same codes and messages as before) instead ofExit.MODEL_UNAVAILABLE, so every mid-run failure goes through one path: refused status, unreachable, not JSON, JSON that is not an object, no choices, a malformed tool callturns: 1and no steps (the request was sent). A refusal before any request (exit 2) still records nothingThe 93
INVESTIGATION_INCOMPLETEand success paths are unchanged.Tests
[], no choices, a tool call without a function). Each exits 92, names a record that ismodel-unavailablewith one step, 2 turns, the turn-1 tokens, nofinding, andsk-testappears neither in the record nor in the command's outputuv run ruff check .,uv run mypy,uv run pytest(391 passed),uv run cloudfall config validate --project config/examplesFixes #29
🤖 Generated with Claude Code