Skip to content

client: a later successful run of the same task never retires its failed card in the Inbox - #2536

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-inbox-stale-failed-card
Nov 5, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-inbox-stale-failed-card

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2534

Owner: Dev-3
Reviewer: Birfy
Written-by: FlyBot Dev-3
Risk tier: T1
Base: 90a5944

The defect

The Inbox chose a graph's failed workflow card from the failed runs alone: it walked the graph's runs and history, kept the newest row whose status is failed inside the same 7-day window Done uses, and drew that as a Needs you row. A task that failed and was then run again to a green finish therefore kept its Failed card, and the place it holds in the sidebar's Needs you count, for the whole window — even though the success sits in the same per-graph history under the same task.id. The row has no dismiss path (openCard only navigates, and inboxAnswer returns undefined for it), so nothing short of seven days retired it.

Reproduction from the product run: one graph, same task.id, a failed run two hours old and a done run thirty minutes old. On base 90a59447 the model still lists run-failed.

The change

  • After the newest failed run is chosen, the scan looks once more at that graph's runs + history: a run with status: 'done' and the same task.id that ended later means the work the failure named has since finished, and the card is dropped. The source change is core/src/client/inbox.js, +4/−0. Nothing else moves: which failures are news, the 7-day window, the newest-failure pick, the title and reason, the graph's Runs tab and every task and turn card are untouched.
  • core/test/inbox-workflow-failure.test.js gains that fixture plus two controls: another task.id failing on the same graph still lists, and needsCount equals the model's own needs.length, so the sidebar badge cannot drift from the list.
  • docs/subsystems/core-client.md states the rule on the inbox.js row; changelog.d/2534-inbox-stale-failed-card.fixed.md is the fragment.
  • Generated files follow generate + npm run build: core/client.js and patches/ds-bot/0008-client-bundle.patch, with the whole-file mirrors patches/ds-bot/files/src/client/inbox.js and patches/ds-bot/files/test/inbox-workflow-failure.test.js. patches/ds-bot/0001-core-fixes.patch needed no change and none was made: this source file is delivered through the bundle mirror.

Red first

On a clean tree at base 90a594471b5886737b433e116f6397aa8ca2b6f2, carrying only the new case in core/test/inbox-workflow-failure.test.js, TZ=UTC node --import ./test/harness-resolve.mjs --test test/inbox-workflow-failure.test.js exits 1:

not ok 9 - P-599: a later successful run of the same task retires its failed card
  the run that finished green answers the failure
  + actual   ['run-failed']
  - expected []
# tests 9
# pass 8
# fail 1

With the fix, the same file is 9/9/0 at the tip, and the four inbox suites together (inbox.test.js 32, inbox-workflow-failure.test.js 9, inbox-readonly.test.js 6, inbox-task-status.test.js 3) are 50/50/0.

Measurements at the tip

Measured in a clean worktree at 255db59673dc4a5c8be4fc5e510685e5f27e2f33, Node v22.23.2, TZ=UTC ARCH_DOCS_BASE=90a594471b5886737b433e116f6397aa8ca2b6f2 npm run verify → exit 0:

suite result
core 2928 / 2928 / 0
plugins/social 577 / 577 / 0
plugins/tree 137 / 137 / 0
plugins/timeline 141 / 141 / 0
plugins/workflow 440 / 440 / 0
.github/scripts + policy 671 / 671 / 0
interop 37 / 37 / 0
live-e2e 26 / 26 / 0

arch-docs: OK (8 changed file(s)); oxlint 81 warnings and 0 errors; the four plugin lints 36 / 9 / 2 / 16 warnings and 0 errors; build-client.mjs --check clean.

Generated files: node scripts/ds-bot-patches.mjs generate run twice (the second run left git status --porcelain empty), then check and canonical → ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5), ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/, ok patches/ds-bot/ is what generate writes (generate is a no-op).

Files

8 files, +57/−2 against base 90a59447:

file +/−
core/src/client/inbox.js +4/−0
core/test/inbox-workflow-failure.test.js +21/−0
docs/subsystems/core-client.md +1/−1
changelog.d/2534-inbox-stale-failed-card.fixed.md +1/−0
core/client.js +2/−0
patches/ds-bot/0008-client-bundle.patch +3/−1
patches/ds-bot/files/src/client/inbox.js +4/−0
patches/ds-bot/files/test/inbox-workflow-failure.test.js +21/−0

Not run

The smoke test, because no index.js or src/host/ file changed; and the pack check, typecheck and actionlint of CI's package job. CI runs those on this tip.

Checkpoint

{
  "pr": 2536,
  "claim": "Dev-3",
  "issue": 2534,
  "summary": "The Inbox picked each graph's failed workflow card from the failed runs alone, so a task that failed and was then run again to a green finish kept its Failed card, and its place in the sidebar's Needs you count, until the 7-day window closed. The scan now looks once more after choosing the failure: a done run of the same task.id in that graph that ended later means the work finished, and the card is dropped. Nothing else about which failures are news changes. The bundle mirrors and the client bundle follow generate.",
  "files": ["core/src/client/inbox.js", "core/test/inbox-workflow-failure.test.js", "docs/subsystems/core-client.md", "changelog.d/2534-inbox-stale-failed-card.fixed.md", "core/client.js", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/files/src/client/inbox.js", "patches/ds-bot/files/test/inbox-workflow-failure.test.js"],
  "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=90a59447 npm run verify (exit 0); node scripts/ds-bot-patches.mjs generate twice then check and canonical; node core/scripts/build-client.mjs --check", "result": "green", "at": "255db59673dc4a5c8be4fc5e510685e5f27e2f33" },
  "next": "none — ready for review"
}

pnpm-free path: client.js from src/client/inbox.js, and the 0008 bundle,
per the generated-file contract.
@Birfy
Birfy added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ThinkFlowLab:main with commit 7bba3a5 Nov 5, 2026
15 checks passed
@Birfy
Birfy deleted the dev/3-inbox-stale-failed-card branch November 5, 2026 14:10
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.

client: a later successful run of the same task never retires its failed card in the Inbox

2 participants