Skip to content

🧑‍🍳 fix: Distinguish Tool Preparation From Execution - #16619

Merged
danny-avila merged 7 commits into
devfrom
lia/tool-preparing-status
Oct 1, 2026
Merged

danny-avila merged 7 commits into
devfrom
lia/tool-preparing-status

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Chat UI Shell codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 1, 2026
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

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.

@danny-avila
danny-avila merged commit 34df3ac into dev Oct 1, 2026
30 checks passed
@danny-avila
danny-avila deleted the lia/tool-preparing-status branch October 1, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Chat UI Shell codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants