You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🧑🍳 fix: Distinguish Tool Preparation From Execution - #16619
Tool cards can announce execution while the model is still streaming their arguments, making argument-generation time look like slow tool execution. Show Preparing X while arguments are incomplete, or until explicit dispatch when timing metadata is available. Once execution starts, preserve the existing execution or model-authored intent label.
Apply the distinction to generic and specialized tool cards, grouped headers, collapsed activity, and their screen-reader announcements. Preserve completion, failure, cancellation, authentication, and background-task precedence.
How it works
The tool-part host supplies a localized preparation label through a small context. Shared outcome metadata also exposes preparation to grouped and collapsed summaries. Dispatch, output, completed progress, and terminal status outrank partial arguments. Older calls without timing metadata fall back to JSON argument completeness. Generic integration cards retain their configured MCP/action name parsing without adding another catalog observer.
Incomplete arguments Preparing X
Measured call before dispatch Preparing X
Legacy arguments complete Existing execution label
Dispatch Existing execution label
Terminal verdict Existing settled label
Type of change
Bug fix
Testing
Configuration: Frontend Jest environment with real tool cards and outcome resolution. English localization. Standard and specialized calls, measured and legacy calls, collapsed groups, and delimiter-bearing MCP server names.
Automated checks for aa4754fac59ccb661864a9044ee96e93bcf3a6a0: 1,141 tests across 56 focused tool/status Jest suites passed, including the activity integration and question-progress regressions. Client tsc --noEmit, scoped ESLint/Prettier/import-order/design-rule checks, unused-i18n checks, and the production frontend build also passed.
Not run: Full Playwright suite and local Lighthouse. No startup, database-loading, or backend behavior changes are introduced by this patch.
Screenshots / recordings
Before/after recordings were captured from the running app at 1280 × 720 using the same deterministic provider-boundary fixture, which streams incomplete JSON arguments through the real SDK and SSE pipeline. Both browser assertions passed: the base shows execution/writing feedback while arguments arrive; this head shows Preparing Code, then the existing cancellation verdict. The base is d3d9bc9703295241452edf1bf4760576ce0e3db3, and the after recording uses head 322881f964fdea4680dc2025d427a656de39889f.
Attachment publication is unavailable: gh pr comment --attach reported unsupported authentication type. No assets were uploaded, and no local paths or invented attachment links are included. The focused suite separately covers transition to execution after complete legacy arguments or explicit measured dispatch.
Risk / compatibility
Frontend-only. No API, persistence, configuration, or tool execution changes. Older calls without dispatch metadata use argument completeness as the fallback. Current dev styling and command-outcome handling are retained.
Independent review ledger
ID
Severity
Finding
Disposition
R1
P1
Image-card preparation binding
Fixed in f8392f2f9198086160635344c028045c07287178
R2
P2
Grouped preparation headers
Fixed in f8392f2f9198086160635344c028045c07287178
R3
P3
Delimiter-bearing MCP server names
Fixed in f8392f2f9198086160635344c028045c07287178
R4
P3
Background-task preparation announcement
Fixed in 03e9c467c
R5
P2
Legacy function preparation groups
Fixed in 322881f964fdea4680dc2025d427a656de39889f
R6
P3
Question-progress preparation feedback
Fixed in aa4754fac59ccb661864a9044ee96e93bcf3a6a0
After the second actionable review, the tool-status subsystem was swept by invariant: all explicit live announcements must agree with preparation labels, while terminal verdicts retain precedence. The real-card regression matrix now asserts that invariant, including background-task checks.
Independent review completed for pushed head aa4754fac59ccb661864a9044ee96e93bcf3a6a0, based on dev d3d9bc9703295241452edf1bf4760576ce0e3db3, with no findings. R1–R6 are fixed: one P1, two P2, and three P3 findings. None were rejected. The reviewer read the complete diff and related routing, outcome, dispatch, and restored-session paths; runtime verification was performed separately by the implementation lane.
CI snapshot at 2026-10-01 13:27 UTC: 17 checks passed, 9 pending, 3 skipped, no failures. Both frontend test shards, frontend TypeScript, static checks, Vite build, and Lighthouse passed. Pending: six memory E2E shards, two Redis-transport E2E shards, and API runtime smoke.
Checklist
I reviewed my own changes
Relevant tests have been added or updated
Existing relevant tests pass on the final pushed head
The change introduces no new lint or TypeScript diagnostics
Required dependency changes have been merged/published: N/A
Required documentation PR: N/A
Title verification: 🧑🍳 has 0 prior uses in 5,750 indexed LibreChat commits through 2026-09-30 22:35:22 UTC. The sentinel passed. This PR records the title's use.
Review head: 09d57d5584b135d75daa83d77fae68e4adba67e3. This head distinguishes argument preparation from execution across generic and specialized tool cards and collapsed activity, preserving terminal-state precedence. Focused tests, frontend typechecking, and static checks are running alongside CI.
Review head: f8392f2f9198086160635344c028045c07287178. R1 (P1), R2 (P2), and R3 (P3) are fixed in this head, with regressions for image binding, collapsed groups, and delimiter-bearing MCP server names. Local checks: 439 focused tests, frontend TypeScript, touched-file static checks, and production frontend build passed. Browser evidence is being captured alongside CI.
Review head: a88f1f3bea91c77d469df823f1f907d0679ccce1. R1–R4 are fixed, including the background-task announcement invariant. Current dev d3d9bc9703295241452edf1bf4760576ce0e3db3 is incorporated without rewriting history. Local verification of the synchronized behavior: 494 focused tests across 15 suites, frontend TypeScript, and production frontend build passed. The new dev class-ordering rule is applied and its static checks are rerunning. A fresh independent review is being started for this exact head.
Review head: 322881f964fdea4680dc2025d427a656de39889f. R5 (P2, legacy function groups) is fixed in this head. The variant sweep also covers legacy image preparation and forwards legacy terminal/timing metadata to the generic card. CI's unused plural keys are replaced with explicit singular/count keys. Local results: 497 tests across 15 focused suites, client TypeScript, scoped static checks, unused-i18n checks, and production frontend build passed. A fresh independent review is being started for this exact head.
Review head: aa4754fac59ccb661864a9044ee96e93bcf3a6a0. R6 (P3, question progress during argument preparation) is fixed in this head. The activity integration fixtures now distinguish complete execution arguments from partial preparation arguments, with a measured-dispatch transition regression. Local verification: 1,141 tests across 56 focused tool/status suites, client TypeScript, scoped static checks, unused-i18n checks, and production frontend build passed. A fresh independent review is being started for this exact head.
Independent review completed for exact head aa4754fac59ccb661864a9044ee96e93bcf3a6a0: no findings. R1–R6 are fixed (one P1, two P2, three P3); none rejected. Local verification: 1,141 tests across 56 focused tool/status suites, client tsc --noEmit, scoped static checks, unused-i18n checks, and production frontend build passed. CI snapshot at 13:27 UTC: 17 passing, 9 pending, 3 skipped, no failures. Both frontend test shards, frontend TypeScript, static checks, Vite build and Lighthouse passed; memory/Redis E2E and API runtime smoke remain in progress. Full Playwright and Lighthouse were not run locally. Before/after app recordings were captured at base and earlier head 322881f96, but attachment upload was unavailable; those recordings are not claimed as exact-current-head browser verification.
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
🗺️ Chat UI Shellcodegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)
2 participants
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.
Summary
Tool cards can announce execution while the model is still streaming their arguments, making argument-generation time look like slow tool execution. Show Preparing X while arguments are incomplete, or until explicit dispatch when timing metadata is available. Once execution starts, preserve the existing execution or model-authored intent label.
Apply the distinction to generic and specialized tool cards, grouped headers, collapsed activity, and their screen-reader announcements. Preserve completion, failure, cancellation, authentication, and background-task precedence.
How it works
The tool-part host supplies a localized preparation label through a small context. Shared outcome metadata also exposes preparation to grouped and collapsed summaries. Dispatch, output, completed progress, and terminal status outrank partial arguments. Older calls without timing metadata fall back to JSON argument completeness. Generic integration cards retain their configured MCP/action name parsing without adding another catalog observer.
Type of change
Testing
Configuration: Frontend Jest environment with real tool cards and outcome resolution. English localization. Standard and specialized calls, measured and legacy calls, collapsed groups, and delimiter-bearing MCP server names.
Automated checks for
aa4754fac59ccb661864a9044ee96e93bcf3a6a0: 1,141 tests across 56 focused tool/status Jest suites passed, including the activity integration and question-progress regressions. Clienttsc --noEmit, scoped ESLint/Prettier/import-order/design-rule checks, unused-i18n checks, and the production frontend build also passed.Not run: Full Playwright suite and local Lighthouse. No startup, database-loading, or backend behavior changes are introduced by this patch.
Screenshots / recordings
Before/after recordings were captured from the running app at 1280 × 720 using the same deterministic provider-boundary fixture, which streams incomplete JSON arguments through the real SDK and SSE pipeline. Both browser assertions passed: the base shows execution/writing feedback while arguments arrive; this head shows Preparing Code, then the existing cancellation verdict. The base is
d3d9bc9703295241452edf1bf4760576ce0e3db3, and the after recording uses head322881f964fdea4680dc2025d427a656de39889f.Attachment publication is unavailable:
gh pr comment --attachreportedunsupported authentication type. No assets were uploaded, and no local paths or invented attachment links are included. The focused suite separately covers transition to execution after complete legacy arguments or explicit measured dispatch.Risk / compatibility
Frontend-only. No API, persistence, configuration, or tool execution changes. Older calls without dispatch metadata use argument completeness as the fallback. Current dev styling and command-outcome handling are retained.
Independent review ledger
f8392f2f9198086160635344c028045c07287178f8392f2f9198086160635344c028045c07287178f8392f2f9198086160635344c028045c0728717803e9c467c322881f964fdea4680dc2025d427a656de39889faa4754fac59ccb661864a9044ee96e93bcf3a6a0After the second actionable review, the tool-status subsystem was swept by invariant: all explicit live announcements must agree with preparation labels, while terminal verdicts retain precedence. The real-card regression matrix now asserts that invariant, including background-task checks.
Independent review completed for pushed head
aa4754fac59ccb661864a9044ee96e93bcf3a6a0, based on devd3d9bc9703295241452edf1bf4760576ce0e3db3, with no findings. R1–R6 are fixed: one P1, two P2, and three P3 findings. None were rejected. The reviewer read the complete diff and related routing, outcome, dispatch, and restored-session paths; runtime verification was performed separately by the implementation lane.CI snapshot at 2026-10-01 13:27 UTC: 17 checks passed, 9 pending, 3 skipped, no failures. Both frontend test shards, frontend TypeScript, static checks, Vite build, and Lighthouse passed. Pending: six memory E2E shards, two Redis-transport E2E shards, and API runtime smoke.
Checklist
Title verification: 🧑🍳 has 0 prior uses in 5,750 indexed LibreChat commits through 2026-09-30 22:35:22 UTC. The sentinel passed. This PR records the title's use.