Repository navigation
Let a model investigate an alert through the operations catalog - #28
Merged
Merged
Conversation
cloudfall agent investigate sends an alert to any OpenAI-compatible endpoint and gives the model the catalog's operation tools, the same ones mcp serve offers: reads run, changes are proposed in check mode, nothing is approved. Repeated calls are answered from the first result. The run is kept as an AgentInvestigation record with the model, tokens, steps and finding, and decision ids the model named but never recorded are set apart. Read operation tools now say they run, not that they run check mode only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APTdZZw8Jw9PQF4TD55wMv
ctx.http's own exit 12 told the caller the command had no side effects, though earlier turns may have recorded decisions, and a 200 answer that was not JSON crashed the handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A repeated step carries the decision id of the call it repeats, so a read called twice and named under PROPOSED was listed as a proposal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tool name the model made up longer than 128 characters failed the record's schema after the run and crashed the handler; the record now keeps the first 128. A blank alert, or a model name or endpoint longer than the schema takes, is refused before the run instead of after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key passed as ?api-key= in --base-url was accepted and written to the investigation record. The URL is refused before the run, as one with a username or password is, and the refusal does not echo it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two runs in one second clashed on the investigation id, and the clash was reported as MODEL_UNAVAILABLE, losing the second record. The store now writes exclusively and gives a later record a numeric suffix (investigation-YYYYmmddHHMMSS-2), and a failure to record exits PRECONDITION instead of 92. 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.
What
cloudfall agent investigate --alert TEXT --base-url URL --model NAMElets any OpenAI-compatible model work an alert through the team's operations catalog.mcp serve --repositorygives any client: a read operation runs and returns its output (operations propose: a read operation's output is not returned, only the path to its .diff #24), any other operation is proposed in check mode and recorded as a decisiondecisions approve, a person's step (see decisions approve --yes runs headless, so an agent with a shell can approve its own proposal #25)investigations/as anAgentInvestigation(new schema): alert, model, tokens, every call and its outcome, the finding; decision ids the model named but never recorded go underunrecorded--api-key-from-env,--api-key-from-file,CLOUDFALL_API_KEY); it never reaches the recordMODEL_UNAVAILABLE, 93INVESTIGATION_INCOMPLETE(record in data)mcp serveand the agentProven live
Disposable Hetzner cx23, PostgreSQL down because 36G of unrotated shop worker logs filled the disk. With Nemotron 3 Super on Nebius Token Factory:
shop-logrotatethenpostgresql-restart, no unrecorded idsReview fixes
Each with a regression test that fails on the code before it:
0b18ed5: an unreachable endpoint now exits 92 instead of 12 "retry, it had no side effects" (decisions may already be recorded); a 200 that isn't JSON exits 92 instead of crashing1701380: a read called twice no longer puts its decision id intofinding.proposed034f195: a made-up tool name over 128 characters is cut to 128 in the record instead of failing its schema after the run and losing it; a blank--alert, or a model name or endpoint longer than the schema allows, is refused with exit 2 before the run16739db(security): a--base-urlwith a query or fragment is refused with exit 2, without echoing it; before,?api-key=...was written to the record, and the scheme error echoed the whole URLd4ca6a6: a second run in the same second is saved as<id>-2instead of failing; a record that can't be written exits PRECONDITION, not 92Follow-up: #29 (a 92 partway through a run writes no investigation record).
Checks
uv run pytest: 384 passed after the review fixes (374 before, 9 of them new: scripted model for the loop, plus an end-to-end CLI test against a local OpenAI-compatible server)uv run ruff check .,uv run mypy,cloudfall config validate --project config/examples: clean🤖 Generated with Claude Code
https://claude.ai/code/session_01APTdZZw8Jw9PQF4TD55wMv