Skip to content

fix(chat): claim-check silently degraded when tool-calling was off - #295

Merged
AVADSA25 merged 1 commit into
mainfrom
fix/claim-check-scope
Jul 24, 2026
Merged

fix(chat): claim-check silently degraded when tool-calling was off#295
AVADSA25 merged 1 commit into
mainfrom
fix/claim-check-scope

Conversation

@AVADSA25

Copy link
Copy Markdown
Owner

Found by verifying the previous fix live rather than trusting it.

The module flagged the case correctly in isolation — but the running dashboard produced no correction. The logic was right; the wiring starved it.

last_user_text was populated only inside the use_tools gate. Any request with tools disabled left it empty, so the claim check's request-intent half got nothing and fell back to reply-patterns alone — exactly the half that rephrasing can evade, and the half that three rounds of pattern-widening already proved insufficient.

A safety check must not depend on an unrelated feature flag. Now resolved unconditionally, before the gate.

Also reworded a comment that contained the literal if use_tools: — it tripped an existing string-matching test (test_chat_bindings_hoisted_before_use_tools_gate) that scans the source with src.index(). The code was correct; the prose wasn't.

180 chat/claim tests pass.

The request-intent half of the claim check needs the user's message. But
last_user_text was populated only inside the use_tools gate, so any request with
tools disabled left it empty and the check fell back to reply-patterns alone —
exactly the half that rephrasing can evade, and the half three rounds of pattern
widening already proved insufficient.

Found by verifying the previous fix live instead of trusting it: the module
flagged the case correctly in isolation, but the running dashboard produced no
correction. The logic was right; the wiring starved it.

A safety check must not depend on an unrelated feature flag. last_user_text is
now resolved unconditionally, before the gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AVADSA25
AVADSA25 merged commit 6108934 into main Jul 24, 2026
1 check passed
@AVADSA25
AVADSA25 deleted the fix/claim-check-scope branch July 24, 2026 15:50
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