Skip to content

fix(bin/context-audit.sh): string Read offsets no longer crash; always exit 0 - #184

Merged
MendixMau merged 1 commit into
masterfrom
fix/context-audit-offset
Sep 30, 2026
Merged

MendixMau merged 1 commit into
masterfrom
fix/context-audit-offset

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

On a machine with older transcripts, bin/context-audit.sh crashed inside its embedded reader: those transcripts store a Read offset/limit as a string, sometimes junk like '30, 90', and offset - 1 raised a TypeError that stopped the whole run, although the header promises exit 0. Offset and limit are now parsed as integers and fall back to the Read tool's defaults (offset 1, limit 2000) when they do not parse. If the reader ever dies on a transcript shape nobody has seen, the shell wrapper prints that the numbers are partial and still exits 0.

Field evidence

Run on a Mac holding 1,300 sessions and 724 subagent runs (2026-08-27 to 2026-09-30): the merged version crashed at the offset arithmetic; with the same fix applied by hand, the run completed. The parser was checked here on the reported values: '30, 90' → 1, '30' → 30, missing → 2000, 40 → 40.

Checklist

  • No client data
  • Size cap
  • Test tier: parser checked on the reported values; the existing test-context-audit.sh fixture uses numeric offsets and is unaffected
  • Instrument rules: read-only, exit 0 kept
  • Routing row: n/a
  • CHANGELOG line
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

…s exit 0

Older transcripts store Read offset/limit as strings, sometimes junk like
'30, 90'; 'offset - 1' raised and stopped the run. Parse as int, fall back
to the Read tool's defaults, and exit 0 with a 'partial' note if the reader
ever dies. Field run: 1,300 sessions + 724 subagent runs on a Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau merged commit 8abd614 into master Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants