Skip to content

Fix main: gptme calls its hook can't read are blocked in audit, and one signer_without_fsync (lint) - #820

Merged
LoopGlitch26 merged 3 commits into
mainfrom
agent/gptme-unreadable
Nov 13, 2026
Merged

LoopGlitch26 merged 3 commits into
mainfrom
agent/gptme-unreadable

Conversation

@LoopGlitch26

@LoopGlitch26 LoopGlitch26 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Main's tests/test_audit.py::TestAudit::test_the_guard_line_names_the_calls_files_agent fails for gptme (2 != 0, "gptme markdown calls must carry an args list and text content").

Cause. gptme's mapping checks each call's shape and raises a plain ValueError when the call doesn't fit. gptme's hook blocks such a call (harness_hooks.run: a mapping error at PreToolUse is "blocking"). #779 made tracekit audit count only UnreadableCall as a call the hook blocks, and end the replay on any other ValueError as a bug. The gptme hooks merged with plain ValueErrors. Each PR passed CI on its own, and main's own CI runs were cancelled by the next merge before they finished, so the failure went unseen.

Fix. The nine shape checks in _gptme_tool raise UnreadableCall, a ValueError subclass. So gptme's ToolObserved path, which catches ValueError, behaves as before, and audit reports such a call as TK-HOOK-BLOCKED, as it does for Cline's and goose's.

Checked.

  • The failing subtest passes. It fails on main 7ed8145 without the fix.
  • tests/test_audit.py: 56 passed.
  • gptme tests in test_agent_hooks.py and test_harness_hooks_v2.py: 18 passed.
  • Run as a user: tracekit audit --calls <file> --agent gptme with a malformed shell call reports it denied, where before it stopped with the error.

Also: main's lint (7069d1e). #803 defined signer_without_fsync in tests/test_bounded.py, and #806 moved it to tests/factories.py and imported it from there. Merged together, test_bounded.py kept both, and pyflakes fails on main: "redefinition of unused 'signer_without_fsync' from line 22" (reported by hayatexe on #819). The two bodies were the same apart from the docstring. The local copy and the imports only it used are removed. make lint's pyflakes over tests/ is clean, and tests/test_bounded.py gives 16 passed.

…rror

gptme's checks of a call's shape raised a plain ValueError. Its hook blocks such a call, but since #779 audit
counts only UnreadableCall as blocked and ends the replay on any other ValueError, so main's audit test failed
for gptme (test_the_guard_line_names_the_calls_files_agent). The two PRs each passed CI before the other merged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
… not an error

The same mismatch as the shape checks: json.loads raised a plain ValueError, which gptme's hook blocks and audit
ended the replay on. Found by the independent review of this PR.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26

Copy link
Copy Markdown
Member Author

Independent review: approve. It traced every caller of the mapping: the only one that catches UnreadableCall is audit (audit.py:394), which reports TK-HOOK-BLOCKED, and the live v1 and v2 hooks still block these calls. It found one more case of the same mismatch, a gptme MCP call whose content isn't JSON (json.loads raised a plain ValueError). That's fixed in 25cd76a, with an audit test covering it, a malformed markdown call and a readable call after them. Tests: test_audit.py 57 passed; the gptme tests in test_agent_hooks.py and test_harness_hooks_v2.py, 18 passed.

#803 defined it in test_bounded.py and #806 moved it to factories and imported it; merged together, test_bounded.py
kept both and pyflakes failed (redefinition of unused 'signer_without_fsync'). The bodies were the same.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26 LoopGlitch26 changed the title tracekit audit: a gptme call its hook can't read is blocked, not an error (main's audit test) Fix main: gptme calls its hook can't read are blocked in audit, and one signer_without_fsync (lint) Nov 13, 2026
@LoopGlitch26
LoopGlitch26 enabled auto-merge (squash) November 13, 2026 13:30
@LoopGlitch26
LoopGlitch26 merged commit bb3ab5c into main Nov 13, 2026
32 of 34 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/gptme-unreadable branch November 13, 2026 14:31
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