Skip to content

fix(agents): read the self-test's log from its byte offset - #3

Merged
ancongui merged 1 commit into
mainfrom
fix/selftest-log-offset
Nov 6, 2026
Merged

ancongui merged 1 commit into
mainfrom
fix/selftest-log-offset

Conversation

@ancongui

@ancongui ancongui commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

What and why

dev agents test reported the PreToolUse guard as silent although the guard had refused the test's branch. It recorded the hooks log size in bytes and sliced the decoded text at that offset; with multi-byte characters in earlier lines (the guard's messages use … → ·), the slice skipped the new lines. The canary check had the same flaw.

Changes

  • providers._appended(path, offset) reads the bytes written after the offset and decodes them; the guard and canary checks use it.
  • A test appends a line after multi-byte text and checks that exactly that line comes back.

How to verify

  • python3 -m unittest tests.test_quota and the full suite on Python 3.15 and 3.9.
  • dev agents test claude: 9 of 9 (it was 8 of 9 after 26.11.1 was installed).
  • dev ci --run passed (evidence for tree 9b74d63).

Risk and rollback

  • Only the self-test reads differently; no hook or command behaves differently. Roll back by reverting the merge.

Links

dev agents test recorded the hooks log size in bytes and then sliced the decoded text at that offset. With multi-byte characters in earlier lines (the guard's messages use … → ·), the slice skipped the new lines, so the live test reported the PreToolUse guard as silent while it had refused the test branch. The canary check had the same flaw. Both read the appended bytes now; the live test passes 9 of 9.
@ancongui
ancongui merged commit 6288238 into main Nov 6, 2026
3 checks passed
@ancongui
ancongui deleted the fix/selftest-log-offset branch November 6, 2026 10:56
@ancongui ancongui mentioned this pull request Nov 6, 2026
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.

1 participant