Commit ced60e9
Fix metadata API to query MetadataService directly in server mode
**Problem**: In server mode (Vercel deployment), the metadata API endpoints
were not returning runtime-registered types like 'agent' and 'tool'.
**Root Cause**: The HTTP dispatcher's fallback chain tried:
1. Protocol service (only knows static types from packages)
2. Broker call (no metadata broker actions registered)
3. Hardcoded defaults ['object', 'app', 'plugin']
It never queried MetadataService directly, which holds runtime-registered
metadata from AI Service Plugin and other sources.
**Fix**: Modified HTTP dispatcher to query MetadataService directly:
- `GET /api/v1/meta` now calls `metadataService.getRegisteredTypes()`
- `GET /api/v1/meta/:type` now calls `metadataService.list(type)`
Both are inserted into the fallback chain after protocol service but before
broker calls, ensuring runtime metadata is available in server mode.
**Affected Endpoints**:
- GET /api/v1/meta → now includes 'agent' and 'tool' types
- GET /api/v1/meta/agent → now returns registered agents
- GET /api/v1/meta/tool → now returns registered tools
🤖 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 2dd6afd commit ced60e9
1 file changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
350 | 361 | | |
351 | 362 | | |
352 | 363 | | |
| |||
464 | 475 | | |
465 | 476 | | |
466 | 477 | | |
467 | | - | |
| 478 | + | |
468 | 479 | | |
469 | 480 | | |
470 | 481 | | |
| |||
479 | 490 | | |
480 | 491 | | |
481 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
482 | 507 | | |
483 | 508 | | |
484 | 509 | | |
| |||
0 commit comments