hotfix: run_claude diagnostics + empty-diff tracking (Claude CLI path) - #262
Merged
Conversation
…LI path too) PR #260 only instrumented the Codex fallback path (run_codex_exec in worker.py). Production log from 2026-07-02 13:42 shows job 264 hit empty-diff count=11 while Claude CLI (not Codex) was returning exit=1 with no diff — my previous patch missed it because the Claude path lives in claude_ops.run_claude. This patch adds the same diagnostics to run_claude so both providers are covered: - runtime_secs, returncode, stdout_bytes, stderr_bytes, cwd, model - Suspicious short-output warning (returncode==0 && stdout<50 chars) - worktree diff probe (git status --porcelain + git diff --numstat) - per-worktree empty-diff streak counter (reset on real change) - streak >= 2 emits a claude-bot-go#23 pointer Pure observability. Zero control-flow changes. Refs: claude-bot-go#23
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.
Why
PR #260 added Codex-path diagnostics to
run_codex_execinworker.py. Production log 2026-07-02 13:42 shows the actual empty-diff cause is different:Claude CLI (not Codex) is the one returning exit=1 with no diff. That path lives in
claude_ops.run_claude, which PR #260 didn't touch.What this changes
Only
run_claudein claude_ops.py. No control-flow changes. Pure observability.runtime_secsper invocationgit status --porcelain+git diff --numstat HEADWhat this does NOT do
Verification
python3 -m py_compile claude_ops.pyOKFollow-up (autonomous)
Refs: claude-bot-go#23, #260