Repository navigation
fix(web): badge Needs attention only for unrecovered tool failures - #235
Merged
nullStack65 merged 2 commits intoNov 27, 2026
Merged
Conversation
A failed tool call a later call in the same run recovered no longer marks the activity pill; failed runs, errors and pending requests still do. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Owner
Author
{
"schema": "closura-review-gate/v1",
"kind": "full",
"review_kind": "full",
"reviewer": "Gemini 4 Neon, Antigravity",
"reviewer_family": "gemini",
"author_session": "nullStack65/t3code#235@e59c4ebc29420047e8e3e2785c38be87304b0e93",
"reviewer_session": "gemini-review-pr235-20261127T034600Z-9a7a1c38",
"fresh_context": true,
"round_id": "gemini-review-pr235-20261127T034600Z-9a7a1c38",
"reviewed_head": "e59c4ebc29420047e8e3e2785c38be87304b0e93",
"reviewed_base": "b64e48d52718896b379866bfa4099dbaa908abb8",
"intent": [
"R1: Recovered tool call failures followed by a clean completed call in the same run do not show Needs attention (partially met: works for status=failed event/work rows in chatActivityContext and web, but fails on mobile work-toggle rows [F1] and on recovered exitCode!=0/outputIndicatesFailure work-toggle rows [F2])",
"R2: Genuine unrecovered failures (last call failed, failed run, error items, failed notifications, pending approvals/input requests) still show Needs attention (partially met: failed runs, error items, notifications, and pending requests are preserved, but a trailing non-zero-exit/outputIndicatesFailure work-toggle failure after an earlier recovered failure in the same run is silently suppressed on web [F2])",
"R3: Consistent behavior across shared client-runtime, web, and mobile timelines (not met: mobile foldThreadFeedActivity does not apply recovery gating to work-toggle rows and has no recovery test coverage [F1])"
],
"verdict": "changes_requested",
"prior_findings": [],
"findings": [
{
"id": "F1",
"severity": "important",
"outcome": "open",
"file": "apps/mobile/src/features/threads/pending-thread-feed.ts",
"line": 166,
"summary": "Mobile `foldThreadFeedActivity` still unconditionally adds `row.id` to `attentionIds` for `row.type === \"work-toggle\" && row.hasFailure`, omitting the recovery check that web added in `MessagesTimeline.logic.ts:2680-2682`. When an agent run has a failed tool call in one collapsed `work-toggle` group (setting `hasFailure: true` via `apps/mobile/src/lib/threadActivity.ts:2395-2400`) followed later in the same run (e.g. after an intermediate agent message) by a clean retry, `chatActivityContext` marks the failure recovered and web clears the badge, while mobile still flags `attention` and auto-expands the activity fold. Fix: gate mobile's `work-toggle` failure check on recovery consistently with web (after fixing F2), and add regression tests in `apps/mobile/src/features/threads/pending-thread-feed.test.ts` covering recovered vs unrecovered `work-toggle` and `activity-group` failures.",
"check": "git show e59c4ebc29420047e8e3e2785c38be87304b0e93:apps/mobile/src/features/threads/pending-thread-feed.ts:166 vs MessagesTimeline.logic.ts:2680-2682"
},
{
"id": "F2",
"severity": "important",
"outcome": "open",
"file": "packages/client-runtime/src/chatActivity.ts",
"line": 123,
"summary": "`recoveredRuns` is monotonic (never cleared when a later tool call in the same run fails) and asymmetric with `workEntryDisplayIndicatesToolFailure` (`packages/client-runtime/src/work-log/presentation.ts:334-365`) for `command_execution` items that finish with `status: \"completed\"` plus `exitCode !== 0` or `outputIndicatesFailure: true`. Two concrete defects follow: (1) False negative on web: if a run recovers an earlier `status: \"failed\"` tool call (`recoveredRuns.add(runId)`), and then ends with a `work-toggle` whose last tool call has `status: \"completed\"` with `exitCode: 1` or `outputIndicatesFailure: true` (or a `declined`/failing `dynamic_tool`), `activityItemNeedsAttention` is false so nothing enters `attentionByRun`, while `recoveredRuns.has(row.runId)` remains true and suppresses `row.hasFailure` in `MessagesTimeline.logic.ts:2680-2682` — hiding a genuine unrecovered trailing failure. (2) False positive on web/mobile: if a run's earlier failed `command_execution` had `status: \"completed\"` with `exitCode: 1` / `outputIndicatesFailure: true` (setting `work-toggle.hasFailure = true`) and a later call succeeds cleanly, the earlier call never entered `unrecoveredByRun`, so `recoveredRuns` never includes `runId` and the earlier `work-toggle` still badges Needs attention. Fix: track failing tool calls symmetrically with `toolCallSucceeded` (including `command_execution` with non-zero `exitCode` or `outputIndicatesFailure`), and only include a run in `recoveredRuns` when all of its tracked tool failures are recovered (i.e. clear `recoveredRuns.delete(runId)` on any subsequent tool failure, or compute `recoveredRuns` after the loop when `unrecoveredByRun.get(runId)` is empty).",
"check": "git show e59c4ebc29420047e8e3e2785c38be87304b0e93:packages/client-runtime/src/chatActivity.ts:51-135 and packages/client-runtime/src/work-log/presentation.ts:334-365"
}
],
"skipped_nits": []
}Independent 1-round cross-family review at
|
…ecovery on mobile Treat completed commands with a failing exit code as tool failures when tracking recovery, let a later failure undo an earlier recovery for the run, and skip recovered work-toggle rows in the mobile activity fold. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
{
"schema": "closura-review-gate/v1",
"kind": "focused_recheck",
"review_kind": "focused_recheck",
"reviewer": "Gemini 4 Neon, Antigravity",
"reviewer_family": "gemini",
"author_session": "nullStack65/t3code#235@fa07c177c6a844b5afa07c00909dbeee1982ccf6",
"reviewer_session": "gemini-recheck-pr235-20261127T035200Z-fa07c177",
"fresh_context": true,
"round_id": "gemini-recheck-pr235-20261127T035200Z-fa07c177",
"reviewed_head": "fa07c177c6a844b5afa07c00909dbeee1982ccf6",
"reviewed_base": "b64e48d52718896b379866bfa4099dbaa908abb8",
"previous_reviewed_head": "e59c4ebc29420047e8e3e2785c38be87304b0e93",
"intent": [
"R1: Recovered tool call failures followed by a clean completed call in the same run do not show Needs attention (met: works symmetrically for status=failed and completed command_execution items with non-zero exitCode or outputIndicatesFailure across chatActivityContext, web, and mobile)",
"R2: Genuine unrecovered failures (last call failed, failed run, error items, failed notifications, pending approvals/input requests) still show Needs attention (met: trailing failures clear recoveredRuns and re-enter unrecoveredByRun, while non-tool attention items and failed runs remain unaffected)",
"R3: Consistent behavior across shared client-runtime, web, and mobile timelines (met: mobile foldThreadFeedActivity now gates work-toggle.hasFailure on context.recoveredRuns identically to web, with regression tests covering recovered and trailing failures)"
],
"verdict": "approved",
"prior_findings": [
{
"id": "F1",
"severity": "important",
"outcome": "resolved",
"file": "apps/mobile/src/features/threads/pending-thread-feed.ts",
"line": 166,
"summary": "Verified resolved: `foldThreadFeedActivity` now gates `row.type === \"work-toggle\" && row.hasFailure` on `!(row.runId && context.recoveredRuns.has(row.runId))`, matching web's `collapseTimelineActivity`, and `apps/mobile/src/features/threads/pending-thread-feed.test.ts` adds regression tests for both recovered and trailing failed `work-toggle` runs (including `exitCode !== 0`).",
"check": "git diff e59c4ebc29420047e8e3e2785c38be87304b0e93..fa07c177c6a844b5afa07c00909dbeee1982ccf6 -- apps/mobile/src/features/threads/pending-thread-feed.ts apps/mobile/src/features/threads/pending-thread-feed.test.ts"
},
{
"id": "F2",
"severity": "important",
"outcome": "resolved",
"file": "packages/client-runtime/src/chatActivity.ts",
"line": 79,
"summary": "Verified resolved: `toolCallFailed(item)` symmetrically flags `status === \"failed\"` and `status === \"completed\" && !toolCallSucceeded(item)` (covering `command_execution` with non-zero `exitCode` or `outputIndicatesFailure: true`), and `chatActivityContext` now calls `recoveredRuns.delete(runId)` on any subsequent tool failure so trailing failures are never suppressed by an earlier recovery. Covered by new unit tests in `packages/client-runtime/src/chatActivity.test.ts`.",
"check": "git diff e59c4ebc29420047e8e3e2785c38be87304b0e93..fa07c177c6a844b5afa07c00909dbeee1982ccf6 -- packages/client-runtime/src/chatActivity.ts packages/client-runtime/src/chatActivity.test.ts"
}
],
"findings": [],
"skipped_nits": []
}Focused re-check at
Verdict: approved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The activity pill showed
⚠ Needs attentionfor any failed tool call in a run, even when the agent immediately retried and the retry succeeded.Fix
chatActivityContext(packages/client-runtime/src/chatActivity.ts) now treats a failed tool call (command, file change, file/web search, dynamic tool) as recovered once a later call in the same run completes cleanly (not failed, exit code 0, no failing output). It exposesrecoveredItemIdsandrecoveredRuns.erroritems, failed notifications and pending approvals/inputs are unchanged.collapseTimelineActivity(web) andfoldThreadFeedActivity(mobile) use the same recovery data, so both clients agree.Tests
chatActivity.test.ts: retry recovers, last call failed stays flagged, running/failing later calls don't recover, other runs don't recover, some vs all recover, failed run stays flagged,erroritems never recover.MessagesTimeline.logic.test.ts: the same cases at the pill level (attentiontrue/false). The recovery case fails on base.chatActivity.test.ts(17),MessagesTimeline.logic.test.ts(154),pending-thread-feed.test.ts(13), pluscheck:changedformat/lint/tests/react-compiler.Known unrelated failures (same on base)
knipfails on two unused.github/scripts/*.cjsfiles.Sidebar.logic.test.tsandbotOrgTree.test.ts, none in touched files.projectGrouping.test.tsfailures in client-runtime.Deploy: none
Prior art
No new tooling or homegrown component; this narrows an existing helper. Searched: existing
chatActivity.tsattention logic.🤖 Generated with Claude Code