Repository navigation
fix(contribute): a call the host blocked is not a failing tool - #1824
Conversation
The Stop scan counted every tool_result with is_error=true that was not a permission denial as a tool error, and Claude Code marks a call its auto-mode classifier refused to start that way. Eight of them added 25 points against a threshold of 20, so a session that only hit classifier timeouts was offered teamai-share-learnings, which needs Bash and hits the same refusal. Such a result now counts as neither a rejection nor an error. The message names the member's gateway model first, so the match starts after it. Refs Tencent#1821
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving. A tool_result that contains auto mode cannot determine the safety of now counts as neither a rejection nor a tool error. Leaving out the model name is right, since the name is the member's gateway and varies. The continue only skips that one result inside the per-item loop, so the other results in the same entry and the prompt count are unaffected. toolError is read only by the friction scoring in contribute-check.ts, so nothing else changes. The new cases cover a transcript of blocked results only and a mix with a real error.
- [P3 nit] The match runs on any error result, so a failing command whose output happens to quote that sentence (say, a
grepover this file that exits non-zero) would also be skipped. That's unlikely and harmless: one missed point of friction. - On the stricter option (skip the offer for any session where the host blocked tools): counting them as nothing is enough for #1821. A follow-up should wait until another blocking message is actually seen.
I'll merge once CI is green.
|
No findings in the scoped diff. The PR description includes a representative real-CLI record covering blocked calls and ordinary tool errors, plus a regression control with the skip removed. This satisfies the review’s testing-record requirement. No code was run, built, or installed. |
Summary
A
tool_resultthe host blocked before the tool ran no longer counts as a failing tool. Claude Code marks a call its auto-mode classifier refuses to start withis_error: true, so the Stop scan counted it as a tool error the AI had to work around; eight of them add 25 points against a threshold of 20, and the session was offeredteamai-share-learnings— a workflow that needs Bash and hits the same refusal.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesUnit
Two cases were added to
countInterventions: a transcript of eight blocked results countstoolError: 0, toolReject: 0, and a transcript mixing blocked results with an ordinary error counts only the ordinary one.Real CLI, after
npm run buildA user-scope HOME with 16
tool_useevents for one session (min_toolsis 15), and a transcript whose eighttool_results carry the classifier message from the issue:Against the same build with the new skip removed, the blocked scenario prints that hint, so the record above is the change and not the harness.
Related Issues
Refs #1821.
Notes for Reviewers
RCH10-CQ-2MMin the report), soTRANSCRIPT_HOST_BLOCK_MARKERSmatches onlyauto mode cannot determine the safety of. The constant sits besideTRANSCRIPT_REJECT_MARKERSinsrc/types.ts, which holds the other transcript facts, and the scan stays the place that counts rather than scores.dashboard-collector.tsis also the scan for Cursor transcripts; a marker that never appears there changes nothing.