Skip to content

fix(contribute): a call the host blocked is not a failing tool - #1824

Merged
SaulMoro merged 1 commit into
Tencent:mainfrom
Walternater:fix/host-blocked-not-a-tool-error
Nov 11, 2026
Merged

SaulMoro merged 1 commit into
Tencent:mainfrom
Walternater:fix/host-blocked-not-a-tool-error

Conversation

@Walternater

Copy link
Copy Markdown
Collaborator

Summary

A tool_result the 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 with is_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 offered teamai-share-learnings — a workflow that needs Bash and hits the same refusal.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npx tsc --noEmit passes
  • npm run lint passes
  • The test files that cover what I changed pass
  • Added/updated tests for the change

Unit

npx vitest run src/__tests__/dashboard-collector.test.ts     202 passed
npx vitest run src/__tests__/contribute-check.test.ts \
  src/__tests__/contribute-check-phase2.test.ts \
  src/__tests__/session-share-reminder.test.ts \
  src/__tests__/codex-stop-hint.test.ts                       81 passed

Two cases were added to countInterventions: a transcript of eight blocked results counts toolError: 0, toolReject: 0, and a transcript mixing blocked results with an ordinary error counts only the ordinary one.

Real CLI, after npm run build

A user-scope HOME with 16 tool_use events for one session (min_tools is 15), and a transcript whose eight tool_results carry the classifier message from the issue:

=== 8 host-blocked calls (auto-mode classifier), 16 tool_use events
[exit 0]                                  ← no hint

=== control: 8 ordinary tool errors, same events
{"hookSpecificOutput":{"hookEventName":"Stop","additionalContext":"[teamai] This session may contain a
problem worth documenting: the AI retried failing tools 8 times. …Offer the person the
teamai-share-learnings workflow: run `teamai workflow start --describe teamai-share-learnings --driver
skill` …"}}[exit 0]                        ← the same session with real failures still offers it

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

  • The judgment SaulMoro asked for, and what this takes. The scan now counts a host-blocked call as nothing rather than as a rejection or an error; the stricter option — skip the offer for a whole session in which the host blocked tools — is a product decision I did not take, because it needs to know the offered workflow needs Bash, and today the offer does not consult what a workflow runs. Say the word and I will do it in a follow-up.
  • The marker, not the model. The message begins with the member's gateway model (RCH10-CQ-2MM in the report), so TRANSCRIPT_HOST_BLOCK_MARKERS matches only auto mode cannot determine the safety of. The constant sits beside TRANSCRIPT_REJECT_MARKERS in src/types.ts, which holds the other transcript facts, and the scan stays the place that counts rather than scores.
  • One known text. This covers the classifier being unavailable, which is the reported failure. If Claude Code's auto mode also blocks with a different sentence (a denial rather than a timeout), that sentence needs its own marker; I did not have a log of one and did not guess.
  • dashboard-collector.ts is also the scan for Cursor transcripts; a marker that never appears there changes nothing.

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 SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 grep over 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.

@github-actions

Copy link
Copy Markdown

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.

@SaulMoro
SaulMoro merged commit e30376d into Tencent:main Nov 11, 2026
20 checks 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.

3 participants