Skip to content

fix(knowledge): show why list, tag and bulk actions failed - #27103

Merged
iamwhatever merged 1 commit into
mainfrom
crew/conductor/knowledge-errors-k1
Nov 1, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
crew/conductor/knowledge-errors-k1

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When a Knowledge page request fails, the page says why instead of showing nothing, an empty library, or "not found".

On the Knowledge page, a failed tag save, bulk Archive or bulk Delete says nothing. A failed list read shows onboarding or "No items match". A failed item read shows "Item not found". A failed related-items, source-row or entity read hides its section or shows "No items found".

Why it matters

A user whose request failed is told the wrong thing. They re-upload a library they already have, look for an item that still exists, or click Archive again with no idea why the rows came back. Nobody can hand the error to the agent, because there is no error on screen.

Not a goal

  • Changing website/src/pages/knowledge/api.ts (other open PRs edit it) or SourcesList.tsx.
  • Restyling the Archive/Delete failure line in DetailView.tsx: it already shows its error, and fix: migrate renderer native dialogs #21276 edits those lines.
  • Background reads that fall back quietly: stats, namespaces, config, entity autocomplete.
  • Retry buttons.

What changed (motivation → approach → change)

Each of these requests had no error branch. The page drew its empty or "not found" state in its place.

Request Was Now
Item read (DetailView.tsx) "Item not found" notice with the reason, back link kept
Item re-read after a save stale item, silent notice above the cached item
Tag save silent inline notice, draft kept, no hand-off
Related items card hidden notice
Bulk Archive / Delete (index.tsx) rows come back, silent notice naming the action
Source list / search onboarding / "No items match" notice
Entity items (Graph tab) "No items found" notice
Open source row (SourceGroup.tsx) empty row notice

The bulk notice stays mounted when the optimistic update empties the selection. Every notice is the shared ErrorNotice with the server reason, per errors-use-error-notice. It shows "Ask the agent" everywhere except next to the unsaved tag draft. A failed read with nothing cached no longer counts as an empty library, so onboarding stays away. New strings are in all 12 shipped catalogs under website/src/i18n/locales/; en-XA.json is regenerated.

Backwards compatibility

Compatible: success paths render exactly as before. Only failure paths gain a notice.

Removes nothing: no request, prop, key or behavior on a success path is removed.

Tests

  • website/src/test/KnowledgeDetailViewErrors.test.tsx: item read, re-read after save, tag save (draft kept, no hand-off), closing the editor clears the notice, related items, empty-reason fallback.
  • website/src/test/KnowledgeIndexErrors.test.tsx: bulk Archive, bulk Delete, a bulk failure that lands after the selection empties, the latest action failure wins, source list (no onboarding), a failed refresh over a cached empty library, search, entity items, and no notice on success.
  • website/src/test/KnowledgeSourceGroup.test.tsx: a failed read in an open row, and no notice on success.

The 12 cases first written, plus the SourceGroup case, were run against origin/main: every failure case fails there, and the two no-notice cases pass. The 38 related frontend test files pass (1,180 tests), and so do the i18n suites with I18N_BASE_REF=origin/main. The two new files pass under three shuffled seeds.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Rendered the item, detail and list views in a Vite harness with fetch stubbed to fail, in dark and light. Screenshots below.

Screenshots / video

Item read failed:

item read failed, dark

Tag save and related items failed, cached item kept:

detail failures, dark
detail failures, light

Source list failed (was the onboarding screen):

list failed, dark

Light variants

item read failed, light
list failed, light

Related Issues

Fixes #27093

Sibling sweep

Swept: git grep -nE "useQuery(|useMutation(" -- website/src/pages/knowledge/
Sibling: website/src/pages/knowledge/SourceGroup.tsx:68 -- changed here
Sibling: website/src/pages/knowledge/EmbeddingStatus.tsx -- not affected -- fixed in #26737
Sibling: website/src/pages/knowledge/KnowledgeGraph.tsx -- not affected -- already renders ErrorNotice on a failed read
Sibling: website/src/pages/knowledge/SettingsTab.tsx -- not affected -- already renders ErrorNotice for load and save
Sibling: website/src/pages/knowledge/SourcesList.tsx -- not affected -- already renders ErrorNotice for its mutations

Pattern harvest

Rule candidate: review-prompt
Pattern: a list read with no error branch renders its empty state when the request fails

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 1, 2026 14:26
@RohanK6
RohanK6 requested a review from mbriones98 November 1, 2026 14:26
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of b5f4ac53fc400836a5c88f21d67a7ccf16db41fb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns: each read or write that failed silently now gets a shared ErrorNotice at the point where it failed, and the success paths render as before.

Notes

  • BulkActions now stays mounted with no selection, so a bulk-failure notice stays up after a page, filter or tab change until it is dismissed. Clearing the notice when the list query key changes would keep it attached to the rows it describes.

[DESIGN-REVIEWED] b5f4ac5

Description read

[DESCRIPTION-READ] a96926ac265d86c6a39647733809b0581ba80f311978929f81e846a6e9b41043

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b5f4ac53fc400836a5c88f21d67a7ccf16db41fb — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: every notice replaces an empty or "not found" state the page used to show when a request failed, and the tests cover each case.

Notes

  • Item 9 — oversized: failureText is defined twice (DetailView.tsx:27 and index.tsx:103), SourceGroup inlines the same thing a third time, and error_no_reason is added under 3 namespaces in all 13 catalogs. The knowledgeGraph namespace already has "load_failed_unknown": "The read failed without a reason." (en.json:8004). Subtraction: drop the 3 new error_no_reason keys and point all three call sites at pages.knowledge.knowledgeGraph.load_failed_unknown through one failureText.

What this change ships

Inventory (9 items) — 8 justified

Intent: when a Knowledge page request fails, the user is told why instead of seeing an empty or "not found" state. FIX.

  1. A failed item read shows a notice with the reason and a Back link, not "Item not found" — justified
  2. A failed re-read after a save shows a notice above the cached item — justified
  3. A failed tag save shows an inline notice, keeps the draft, and the notice clears when the editor closes — justified
  4. A failed related-items read shows a notice instead of hiding the card — justified
  5. A failed bulk Archive/Delete names the action, stays visible after the selection empties, and the latest failure wins — justified
  6. A failed list or search read shows a notice and no longer shows onboarding or "No items match" — justified
  7. A failed entity-items read (Graph tab) shows a notice, not "No items found" — justified
  8. A failed read in an open source row shows a notice — justified
  9. New failure strings in all 13 catalogs, with "no reason" fallback copies under three namespaces — oversized: second spelling of an existing key

[FIRST-PRINCIPLES-REVIEWED] b5f4ac5

Description read

[DESCRIPTION-READ] 8e924203458b46792bca709f4b215a2b089268d3585a08a90229210df312f991

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of b5f4ac53fc400836a5c88f21d67a7ccf16db41fb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing the bulk Archive/Delete failure notice. It is the change the PR title names, and no screenshot shows it. Three other new failure notices are also unshown.

Evidence gaps

  • Bulk Archive / Delete failure notice (knowledge-bulk-error, "Couldn't archive the selected items" / "Couldn't delete the selected items"). No screenshot shows it. Closing this gap needs a still of the list after a failed bulk Archive, with the rows back, the selection empty and the notice showing.
  • Item refresh failure over a cached item (knowledge-item-load-error above the title). shot-05/06 show the cached item without this notice. Closing it needs a still of the detail view with this notice above the item.
  • Entity items failure on the Graph tab ("Couldn't load the items for this entity"). No screenshot shows it. Closing it needs a Graph tab still with an entity selected and the read failed.
  • Open source row failure ("Couldn't load this source's items"). No screenshot shows it. Closing it needs a still of an expanded source row whose read failed.

Notes

  • The list error in shot-03 sits above a footer that still says "3 items". The blind reader said: "I can't tell which one is true." The footer should be muted or hidden while listUnread is true.
  • Server reasons such as "database is locked" and "related index is rebuilding" reach the user raw. The reader asked "whether it's my fault or whether I should just wait". Add a next-step line where the reason is known to be temporary.
  • The reader asked why the tag error has × and no "Ask the agent" while the other notices are the opposite. The PR says this is on purpose (the field still holds the unsaved tag draft), so this is a note, not a blocker.

[UX-REVIEWED] b5f4ac5

Description read

[DESCRIPTION-READ] 528353b0f831a14b1416d8785b7c2d5f389f84eaac6743dc8494a9a47e0d8adc

That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed b5f4ac53fc400836a5c88f21d67a7ccf16db41fb — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b5f4ac5

Verdict parsed from the review's SHA-scoped output markers for commit b5f4ac53fc400836a5c88f21d67a7ccf16db41fb.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b5f4ac53fc400836a5c88f21d67a7ccf16db41fb false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of b5f4ac53fc400836a5c88f21d67a7ccf16db41fb and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b5f4ac5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b5f4ac53fc400836a5c88f21d67a7ccf16db41fb false-positive: <reason, 20 to 500 characters>

@RohanK6
RohanK6 force-pushed the crew/conductor/knowledge-errors-k1 branch from c66bfa3 to 66dae4f Compare November 1, 2026 14:37
@RohanK6

RohanK6 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: bulk failure notice owned by a toolbar that unmounts with the selection

  • span=b3cdafeb831a Optimistic updates unmount the bulk failure notice

fixed in 66dae4f: BulkActions stays mounted in the list view and only its toolbar follows the selection, so the mutations and their notice survive the optimistic update emptying the selection.
Test: KnowledgeIndexErrors "a bulk failure that lands after the selection empties is still shown" holds the PATCH open until the selection is gone; it fails on c66bfa3 and passes on 66dae4f.

@RohanK6

RohanK6 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: list error gated on missing data instead of missing rows

  • span=b3cdafeb831a Cached empty counts hide failed list refreshes

fixed in 66dae4f: a list error with zero rows on screen, cached or not, now suppresses onboarding and the empty states and shows the notice; cached rows still render under it.
Test: KnowledgeIndexErrors "a failed refresh over a cached empty library is not shown as onboarding" fails on c66bfa3 and passes on 66dae4f.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 1, 2026
@RohanK6
RohanK6 force-pushed the crew/conductor/knowledge-errors-k1 branch from 66dae4f to 03c9883 Compare November 1, 2026 14:45
@RohanK6

RohanK6 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: findBy and waitFor calls across request chains with the default ceiling

  • span=b534e7be1ff9 Lazy and chained-query waits omit explicit ceilings

fixed in 03c9883: every findBy and waitFor this PR adds, in KnowledgeDetailViewErrors, KnowledgeIndexErrors and the new KnowledgeSourceGroup cases, now passes a namedCeiling (DETAIL_REQUEST_CHAIN, PAGE_REQUEST_CHAIN, GROUP_REQUEST_CHAIN, 5000 ms each), so a starved runner fails by name instead of at the 1000 ms default.

@RohanK6
RohanK6 force-pushed the crew/conductor/knowledge-errors-k1 branch from 03c9883 to b5f4ac5 Compare November 1, 2026 15:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 1, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve at b5f4ac5.

Each Knowledge read or write that failed silently now shows the shared ErrorNotice with the server reason, and a failed read with no rows no longer passes as an empty library (index.tsx#L285, DetailView.tsx#L209). Success paths render as before. The earlier GPT findings have fixed dispositions with tests, the current-head GPT and Opus lanes report none, and all checks on this head are green.

AI findings judged non-blocking

  • Design note: the bulk-failure notice outlives a filter or page change. It is dismissible and the dismiss clears both mutations, so it is cosmetic (index.tsx#L198-L203).
  • First Principles note: failureText and the error_no_reason keys are duplicated. Style and subtraction only, with no user-visible harm (DetailView.tsx#L27, SourceGroup.tsx#L135).
  • UX evidence gaps: four failure notices have no screenshot. Each uses the same ErrorNotice the shown screenshots use, and the tests assert each one renders (index.tsx#L646).
  • UX notes: the footer count under a list error, raw server reasons, and no Ask-the-agent on the tag notice. These are polish suggestions, and the last one is intended because the field holds an unsaved draft.

— crew-pr-reviewer (r139)

@iamwhatever
iamwhatever enabled auto-merge (squash) November 1, 2026 16:50
@iamwhatever
iamwhatever merged commit 7fc33af into main Nov 1, 2026
96 checks passed
@iamwhatever
iamwhatever deleted the crew/conductor/knowledge-errors-k1 branch November 1, 2026 17:11
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 1, 2026
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.

Knowledge: list, tag and bulk actions fail with no message

2 participants