Commit 9d89f50
Fix agent and tool metadata visibility in Studio
**Root Cause**: The fs polyfill mock in Studio's Vite config had a broken
`access()` function that returned `undefined` instead of rejecting with an
error. When awaited, `undefined` becomes a resolved Promise, causing the
FilesystemLoader to incorrectly report that non-existent files exist.
This prevented AI Service Plugin from registering agents and tools because
`metadataService.exists()` would return true even for non-existent items.
**Fix**:
1. Fixed `access()` and `accessSync()` in mocks/node-polyfills.ts to properly
reject/throw when files don't exist
2. Added `access()` to the `promises` export for consistency
3. Removed temporary debug logging from AI Service Plugin
**Impact**:
- Agents (data_chat, metadata_assistant) now register correctly
- Tools now visible in Studio sidebar
- All metadata visibility tests passing
**Files Changed**:
- apps/studio/mocks/node-polyfills.ts: Fix fs.access mock
- packages/services/service-ai/src/plugin.ts: Clean up debug logs
- packages/metadata/src/metadata-manager.ts: Remove debug logs
- packages/metadata/src/loaders/filesystem-loader.ts: Remove debug logs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent ced60e9 commit 9d89f50
2 files changed
Lines changed: 30 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
286 | 287 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
292 | 296 | | |
293 | 297 | | |
294 | 298 | | |
| |||
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
| |||
0 commit comments