feat: tool metadata cache, tool call toggle, stale-closure fix, and perf optimizations#479
Merged
shanselman merged 3 commits intoMay 21, 2026
Merged
Conversation
- Cache tool metadata (name, label) to local JSON so tool call types persist across app restarts instead of falling back to 'exec' - Improve ClassifyFlattenedToolOutput heuristic to detect bash, view, grep, git, edit, glob from output text patterns - Add tool call show/hide toggle button to composer toolbar with tooltips on all toolbar buttons - Add CompactSummary as default tool burst style with expand/collapse - Fix stale-closure bug in ChatExplorationState.Changed handlers across Timeline, Composer, ChatRoot, and ExplorationsPanel — event handler captured initial UseState value (0), so Set(1) only triggered one re-render; subsequent toggles were no-ops - Optimize SyncChildren with fast path for empty panels (skip RemoveFromParent O(n) scan) and pre-clear panel on visibility toggle - Enable NavigationCacheMode on ChatPage to avoid full reload on navigation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tests - Debounce SaveToolMetaCache with 500ms timer instead of Task.Run per event - Atomic file write (write .tmp then File.Move) to prevent partial JSON - ChatRoot: read explorationRevRef.Current inside dispatcher lambda - Revert in-place HashSet mutation to proper Set(new HashSet) - Add ToolMetaCacheTests (10 tests): sequential matching, exhaustion, guards - Add classifier edge case tests (9 tests): view, git, exec defaults Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move tool metadata timer replacement under the provider lock, version debounced saves so stale timer callbacks cannot overwrite newer snapshots, and serialize unique-temp-file writes to avoid cache corruption under rapid tool events. Add coverage that concurrent metadata additions flush complete valid JSON without leaving temporary files behind. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
@christineyan4 I found and pushed a fix for the tool metadata cache race I was worried about. The new commit serializes debounced saves, uses unique temp files for atomic writes, prevents stale timer callbacks from overwriting newer snapshots, flushes on provider disposal, and adds a concurrent-cache test that verifies complete valid JSON with no leftover temp files.\n\nLocal validation on the pushed branch: ./build.ps1, dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore, and dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore all passed. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Improves the chat experience with tool call caching, a toggle UI, and critical bug fixes.
Tool Metadata Cache
Tool Call Toggle
Stale-Closure Fix (Critical)
Performance Optimizations
Tests
Other