[codex] Fix dynamic tool rebuild and compact light list#305
Merged
lioensky merged 1 commit intolioensky:mainfrom Apr 24, 2026
Merged
[codex] Fix dynamic tool rebuild and compact light list#305lioensky merged 1 commit intolioensky:mainfrom
lioensky merged 1 commit intolioensky:mainfrom
Conversation
7273f6b to
2308606
Compare
There was a problem hiding this comment.
Pull request overview
This PR is an incremental bugfix/follow-up to the dynamic VCP tool registry/admin panel work, focusing on making manual rebuild non-blocking, surfacing background classification state to the UI, and keeping lightweight tool list entries compact.
Changes:
- Make
/admin_api/dynamic-tools/rebuildsupport non-blocking rebuilds via awaitflag, and exposeisClassifyingstate from the registry. - Update the AdminPanel dynamic tools page to disable rebuild buttons during classification, show background status, and poll until completion.
- Add compact-brief/token-budget handling for the lightweight tool list, including small-model prompt guidance and local clamping, plus tests.
Reviewed changes
Copilot reviewed 6 out of 48 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dynamicToolRegistry.test.js | Adds regression tests for background rebuild behavior and compact light-list briefs. |
| routes/admin/dynamicTools.js | Accepts wait in rebuild requests and forwards it to the registry. |
| modules/dynamicToolRegistry.js | Implements wait:false rebuild path, exposes isClassifying, and compacts light-list briefs to a token budget. |
| AdminPanel-Vue/src/views/DynamicToolsManager.vue | Shows background classification state, disables rebuild buttons during classification, and polls for completion. |
| AdminPanel-Vue/src/platform/http/httpClient.ts | Preserves abort reasons (timeout + merged signals) to improve UI error reporting. |
| AdminPanel-Vue/src/api/dynamicTools.ts | Adds isClassifying to state typing and supports wait option in rebuild API. |
| AdminPanel-Vue/dist/index.html | Updates built AdminPanel asset hashes. |
| AdminPanel-Vue/dist/assets/js/useRecentVisits-Cv1J7k25.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/useMarkdownRenderer-DLeytw2l.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/index-DavTYS7A.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/dashboard-components-B8tHL6X6.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/VcpForum-Id9m3gbZ.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/TvsFilesEditor-C5aiCR9A.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ToolboxManager-D56-z_F1.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ToolListEditor-ioMxub1G.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ToolApprovalManager-Bf6PJCCw.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ServerLogViewer-BdlP6B20.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/SemanticGroupsEditor-BH73yceu.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ScheduleManager-Bbhal8Kk.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/SarPromptEditor-Bq853TUQ.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/PreprocessorOrderManager-DZK3zVsY.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/PluginConfig-B_YmEtY4.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/PlaceholderViewer-qyzPTnil.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/Login-O5UIIymr.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/ImageCacheEditor-Du3p9rj1.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/DynamicToolsManager-LMmR5Ul0.js | New built output for updated DynamicToolsManager page. |
| AdminPanel-Vue/dist/assets/js/DynamicToolsManager-JKX64yof.js | Removes old built output for DynamicToolsManager page. |
| AdminPanel-Vue/dist/assets/js/DreamManager-B-hn_w0p.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/BaseConfig-ZwMPzMSY.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/AgentScores-C7Y-y85L.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/js/AgentFilesEditor-DBKe1qSu.js | Built output update (hash/import changes). |
| AdminPanel-Vue/dist/assets/css/VcptavernEditor-owhvFUwg.css | Removes old built CSS asset. |
| AdminPanel-Vue/dist/assets/css/VcptavernEditor-5MCsg1Ga.css | Adds new built CSS asset. |
| AdminPanel-Vue/dist/assets/css/SarPromptEditor-CCC5Xs9a.css | Adds new built CSS asset. |
| AdminPanel-Vue/dist/assets/css/SarPromptEditor-C2ZOTWQD.css | Removes old built CSS asset. |
| AdminPanel-Vue/dist/assets/css/DynamicToolsManager-bmlUkVu7.css | Adds new built CSS asset for DynamicToolsManager page. |
| AdminPanel-Vue/dist/assets/css/DynamicToolsManager-_CapYPVW.css | Removes old built CSS asset for DynamicToolsManager page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+453
to
+456
| statusMessage.value = isClassifying.value ? "重建任务已开始,正在后台分类" : "重建任务已完成"; | ||
| statusType.value = isClassifying.value ? "info" : "success"; | ||
| showMessage(statusMessage.value, "success"); | ||
| if (isClassifying.value) startRebuildPolling(); |
Comment on lines
+201
to
+205
| const startedAt = Date.now(); | ||
| const state = await registry.forceRebuild({ mode: 'classification', wait: false }); | ||
|
|
||
| assert.ok(Date.now() - startedAt < 100, 'background rebuild should return before classification finishes'); | ||
| assert.equal(state.isClassifying, true); |
Comment on lines
+94
to
+109
| function tokenPieces(value) { | ||
| return String(value || '').match(/[A-Za-z0-9_.-]+|[\u3400-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]/g) || []; | ||
| } | ||
|
|
||
| function estimateTokenCount(value) { | ||
| return tokenPieces(value).length; | ||
| } | ||
|
|
||
| function truncateToTokenBudget(value, maxTokens) { | ||
| const text = cleanText(value, 500); | ||
| const budget = Math.max(1, Math.trunc(Number(maxTokens) || 1)); | ||
| const pieces = tokenPieces(text); | ||
| if (pieces.length <= budget) return text; | ||
| if (pieces.length === 0) return cleanText(text, Math.max(12, budget * 8)); | ||
| return cleanText(`${pieces.slice(0, budget).join(' ')}...`, Math.max(24, budget * 14)); | ||
| } |
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
Context
PR #302 has already been merged. This is the incremental follow-up bugfix for the rebuild timeout path and the lightweight list token budget.
Verification