Record Claude StopFailure events - #330
Closed
myobie wants to merge 2 commits into
Closed
Conversation
myobie
force-pushed
the
agent/stop-failure-records
branch
from
August 24, 2026 15:37
636bb01 to
6086795
Compare
Contributor
|
Superseded by merged first-class Claude harness state and unified OpenTelemetry diagnostics. A separate StopFailure JSONL would create another telemetry source of truth. Posted on behalf of @schickling
|
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 changed
StopFailureevent to one private JSONL file per st2 identity.error_type, and the sanitized provider payload.errorfield and the legacyerror_typefield.The record path is:
The directory uses mode
0700. Each record file uses mode0600.Why
The prior hook changed presence and could notify a declared supervisor. It wrote no durable evidence.
An agent without a supervisor produced no notification. Filtered error types also left no record. Operators could not count repeated provider failures without scanning transcripts.
User impact
A deployed hook set creates a queryable local failure history without changing the Claude hook response. Existing presence and supervisor actions remain.
The hook-set hash changes. Operators must select it through the normal
st2 hooks installflow during deployment.Proof
Commit
411dbe4contains the red regression. Its exact test fails because the successful hook creates no JSONL file.The green tests prove:
Checks:
bash -n hooks/claude-stop-failure.shcargo test --test claude_hooks— 9 passed.cargo test --test hooks— 11 passed.cargo test --test codex_hooks— 5 passed.cargo test --lib— 451 passed.git diff --check origin/main...HEADThe full workspace run reaches the current-main
incomplete_apply_marker_blocks_declarations_but_not_the_state_planefailure. The exact test fails unchanged onorigin/main. The current-main native-surface test and rustfmt drift also reproduce unchanged onorigin/main.Hosted Nix run
32746034451passed at6086795.This PR stays draft. Nathan owns the ready-for-review and merge gates.