Commit 37bbb2f
fix: Access kernel services dynamically to fix AI metadata visibility
**Root Cause:**
Protocol callback captured PluginContext during ObjectQLPlugin.init(), but MetadataPlugin
registers its service AFTER ObjectQLPlugin. This meant ctx.getServices() returned a snapshot
without the metadata service, causing agents/tools to be invisible in Studio sidebar.
**Fix:**
Changed protocol initialization to access kernel.context.getServices() dynamically at request
time instead of capturing ctx.getServices() during init. This ensures the protocol always
accesses the live services registry with all registered services including MetadataService.
**Changes:**
- ObjectQLPlugin: Use ctx.getKernel() to get kernel reference, access services via kernel.context
- Protocol: Removed diagnostic logging (no longer needed)
- AIServicePlugin: Removed diagnostic logging
- MetadataPlugin: Removed diagnostic logging
**Verified:**
- Protocol now accesses services dynamically at runtime
- MetadataService is accessible even though it registers after ObjectQLPlugin
- Agents and tools should now be visible in Studio sidebar on Vercel
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/8252cffa-ca7f-44e7-9646-e56ed9b05e6a
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent 770fb91 commit 37bbb2f
File tree
4 files changed
+10
-21
lines changed- packages
- metadata/src
- objectql/src
- services/service-ai/src
4 files changed
+10
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
78 | | - | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | 189 | | |
191 | | - | |
192 | 190 | | |
193 | 191 | | |
194 | | - | |
195 | 192 | | |
196 | | - | |
| 193 | + | |
197 | 194 | | |
198 | | - | |
199 | 195 | | |
200 | 196 | | |
201 | 197 | | |
202 | | - | |
203 | 198 | | |
204 | 199 | | |
205 | 200 | | |
| |||
253 | 248 | | |
254 | 249 | | |
255 | 250 | | |
256 | | - | |
257 | 251 | | |
258 | | - | |
259 | 252 | | |
260 | 253 | | |
261 | | - | |
262 | 254 | | |
263 | 255 | | |
264 | 256 | | |
| |||
275 | 267 | | |
276 | 268 | | |
277 | 269 | | |
278 | | - | |
279 | 270 | | |
280 | 271 | | |
281 | | - | |
| 272 | + | |
282 | 273 | | |
283 | | - | |
284 | 274 | | |
285 | 275 | | |
286 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | 253 | | |
255 | | - | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
| |||
289 | 287 | | |
290 | 288 | | |
291 | 289 | | |
292 | | - | |
293 | 290 | | |
294 | 291 | | |
295 | | - | |
296 | 292 | | |
297 | 293 | | |
298 | 294 | | |
| |||
333 | 329 | | |
334 | 330 | | |
335 | 331 | | |
336 | | - | |
337 | 332 | | |
338 | 333 | | |
339 | | - | |
340 | 334 | | |
341 | 335 | | |
342 | 336 | | |
| |||
0 commit comments