Skip to content

fix(ops): KB panel must not fetch groups while deactivated - #58

Merged
sulthannauval merged 1 commit into
mainfrom
fix/kb-panel-no-fetch-while-off
Aug 11, 2026
Merged

fix(ops): KB panel must not fetch groups while deactivated#58
sulthannauval merged 1 commit into
mainfrom
fix/kb-panel-no-fetch-while-off

Conversation

@sulthannauval

Copy link
Copy Markdown
Member

Found by the release-verification browser drive (the pass queued in #56): the plan-106 gate stopped rendering the library while off, but useAsync(kbGroups) lived in KbPanel itself — hooks fire on mount regardless of the early return, so the doomed 503 request still went out. The drive asserts on the network log, not the DOM, which is how it surfaced.

Change

Library (groups fetch + selection state + Documents/Graph chrome) moves to a child KbPanelBody mounted only when the KB is enabled — the request cannot exist while off.

Live drive evidence (real gateway + auth-aware probe mock, chromium)

activation card visible: true
inline error: embedding provider rejected the key (http 401)
still on activation card: true · nothing persisted
status row active: true · library chrome mounted: true · kb/groups: 200
off-with-key card + badge: true · config: {embedding_configured:true, enabled:false}
one-click reactivate: true
confirm modal wording ok · back to activation inputs, config empty

Panel-originated kb/groups while off: none. The one remaining page-load 503 is console-shell's chat-KB-selector prefetch — deliberately fail-soft (.catch(() => {})), renders nothing; out of scope.

Validation: next build clean · full flow driven end-to-end as above.

Risk: component split only · Rollback: revert

- the plan-106 gate stopped RENDERING the library while off, but the
  kbGroups useAsync lived in KbPanel itself and hooks fire on mount
  regardless of what is returned — the doomed request still went out
  (503) exactly as before; caught by the live browser drive, which
  asserts on the network log, not the DOM
- the library (groups fetch + selection state + Documents/Graph) moves
  to a child KbPanelBody mounted only when the KB is enabled, so the
  request cannot exist while off
- full activation-flow drive against a real gateway + probe mock now
  passes: off shows the activation card with NO kb/groups call from the
  panel, bad key surfaces the probe 400 inline and persists nothing,
  good key activates and mounts the library (groups 200), deactivate
  keeps the credential, reactivate is one click, remove-key returns to
  the empty inputs
- the remaining page-load kb/groups 503 comes from console-shell's
  chat KB selector prefetch, which is deliberately fail-soft
  (.catch(() => {})) and renders no error — out of this fix's scope
@sulthannauval
sulthannauval merged commit 585f702 into main Aug 11, 2026
1 check 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.

1 participant