Data Manager offers a one-click purge of the onboard tools registry, labelled "Tool execution data"

Closed Beginner friendly
#14,508 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
backend

Research direction

Start with the tools entry in CATEGORIES at server/services/dataManager.js:208, then the table contract at lines 33-35 and the category purge at lines 731-737. Change the entry to deletable: false, drop purgeScope, and rewrite the description to name the tool registry. Add a test in the Data Manager service or route tests that asserts purgeCategory('tools') is refused. Done when that test passes and the existing fail-closed path is the only thing refusing it.

Written by the indexing model from the issue text.

Description

data-safety effort:low model:light plan planner:opus-5-5

Found during the 2026-11-01 code-quality audit while reviewing Data Manager classifications. Purge classification is owned by the data-safety audit, so this is filed for that lane rather than fixed in the code-quality PR.

Problem

  • server/services/dataManager.js:208 classifies data/tools as { label: 'Tools', description: 'Tool execution data', archivable: true, deletable: true, purgeScope: 'category' }.
  • data/tools/ is not execution data. It is the onboard tools registry (server/services/tools.js:1-6): one JSON config per tool, which getToolsSummaryForPrompt() (server/services/tools.js:112) splices into CoS agent prompts through server/services/agentPromptBuilder.js.
  • Its only writers are POST /api/tools and PUT /api/tools/:id (server/routes/tools.js:69,77), driven by the Image Gen settings save (client/src/components/settings/ImageGenTab.jsx:391-450). Nothing re-registers tools at boot.
  • The category-wide purge (server/services/dataManager.js:731-737) removes every file in data/tools/ but never invalidates the in-memory cache in server/services/tools.js:26-58.

Impact

A user who reads "Tool execution data" and purges it sees no change at first, because the cache keeps serving the old list. After the next server restart, every CoS agent prompt silently loses its "Available Tools" section (the image-generation endpoints and hints) until the user happens to re-save Image Gen settings. The purge reclaims only a few KB, so nothing offsets that loss. It also contradicts the table's own contract (dataManager.js:33-35): deletable is reserved for bytes that are "genuinely reproducible".

Decided fix

Reclassify tools as deletable: false (keep archivable: true, drop purgeScope), and replace the description with an accurate one, e.g. "Onboard tool registry listed in CoS agent prompts — rebuilt only when Image Gen settings are saved". Once the purge is withdrawn, no cache-invalidation plumbing is needed.

Acceptance criteria

  • CATEGORIES.tools is deletable: false with no purgeScope; purgeCategory('tools') refuses through the existing fail-closed path.
  • The description names the registry and how it is rebuilt.
  • A Data Manager service or route test asserts that a tools purge is refused.

Scope: small

Dispatch: model:light (one classification row plus a test); effort:low (no design question remains).

Dominant language
JavaScript
Stars
38
Forks
32
Avg merge
40m
Merged PRs (30d)
992

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.