@@ -72,12 +72,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7272
7373### Fixed
7474- ** AI Chat agent selector missing ` data_chat ` and ` metadata_assistant ` ** — Fixed ` GET /api/v1/ai/agents `
75- returning 404, which caused the Studio AI Chat panel to show only "General Chat". Root cause was a
76- redundant second ` ctx.getService('metadata') ` call inside ` AIServicePlugin.start() ` that shadowed
77- the outer resolved variable and failed silently, preventing ` buildAgentRoutes() ` from being called.
78- Fix: reuse the already-resolved ` metadataService ` variable instead of re-fetching it. Additionally,
79- added a fallback in ` DispatcherPlugin.start() ` that recovers AI routes from the ` kernel.__aiRoutes `
80- cache in case the ` ai:routes ` hook fires before the listener is registered (timing edge case).
75+ returning 404, which caused the Studio AI Chat panel to show only "General Chat". There were two
76+ root causes addressed by this fix:
77+ 1 . ** Kernel bootstrap timing** (` packages/core/src/kernel.ts ` ): 'core' service in-memory fallbacks
78+ (e.g. the 'metadata' service) were only injected in ` validateSystemRequirements() ` which runs
79+ AFTER all plugin ` start() ` methods execute. This meant ` ctx.getService('metadata') ` always threw
80+ during ` AIServicePlugin.start() ` when no explicit ` MetadataPlugin ` was loaded. Fix: added
81+ ` preInjectCoreFallbacks() ` called between Phase 1 (init) and Phase 2 (start), ensuring all core
82+ service fallbacks are available before any plugin's ` start() ` runs.
83+ 2 . ** Shadowed variable** (` packages/services/service-ai/src/plugin.ts ` ): a redundant second
84+ ` ctx.getService('metadata') ` call declared a new ` const metadataService ` that shadowed the outer
85+ ` let metadataService ` and failed silently, preventing ` buildAgentRoutes() ` from being called even
86+ if the metadata service was available. Fix: reuse the already-resolved outer variable.
87+ Additionally, added a fallback in ` DispatcherPlugin.start() ` that recovers AI routes from the
88+ ` kernel.__aiRoutes ` cache in case the ` ai:routes ` hook fires before the listener is registered
89+ (timing edge case).
8190- ** ObjectQLPlugin: cold-start metadata restoration** — ` ObjectQLPlugin.start() ` now calls
8291 ` protocol.loadMetaFromDb() ` after driver initialization and before schema sync, restoring
8392 all persisted metadata (objects, views, apps, etc.) from the ` sys_metadata ` table into the
0 commit comments