Skip to content

fix: chunks sometimes not visibles, bc useEffect missing dependencies - #3266

Merged
vanbasten17 merged 4 commits into
masterfrom
BLT-2594-rl-preview-events-with-chunks-sometimes-not-visible
Aug 25, 2026
Merged

fix: chunks sometimes not visibles, bc useEffect missing dependencies#3266
vanbasten17 merged 4 commits into
masterfrom
BLT-2594-rl-preview-events-with-chunks-sometimes-not-visible

Conversation

@vanbasten17

@vanbasten17 vanbasten17 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Context

Chunks from AI Agent debug events were sometimes not visible in the preview (Ralph Lauren / v1 bots).

Root cause

  • When a Pusher payload exceeds 10 KB, the backend sends a truncated stub (tools_executed: [], truncated: true) and the frontend rehydrates it via getMessageById.
  • useKnowledgeBaseInfo had an empty dependency array ([]) on its fetching useEffect, so it ran once on mount with chunkIds = [] and never re-ran when rehydration later populated the real chunk IDs → chunks were never fetched.

Fix

  • Added chunkIds to the useEffect dependency array in use-knowledge-base-info.tsx so the fetch re-triggers once rehydration replaces the empty tools_executed with the real data.
  • Added a regression test verifying getChunkIdsGroupedBySource is called with the real chunk IDs after getMessageById rehydrates a truncated event.

@vanbasten17
vanbasten17 requested a review from Iru89 August 25, 2026 07:46
@vanbasten17
vanbasten17 marked this pull request as ready for review August 25, 2026 07:46
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vanbasten17
vanbasten17 force-pushed the BLT-2594-rl-preview-events-with-chunks-sometimes-not-visible branch from f389dea to 1aded04 Compare August 25, 2026 08:22
@vanbasten17
vanbasten17 merged commit e32f224 into master Aug 25, 2026
8 checks passed
@vanbasten17
vanbasten17 deleted the BLT-2594-rl-preview-events-with-chunks-sometimes-not-visible branch August 25, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants