Add diagnostic logging for AI metadata visibility issue in Vercel deployment#1105
Closed
Add diagnostic logging for AI metadata visibility issue in Vercel deployment#1105
Conversation
- Add detailed console.log statements in protocol.ts getMetaTypes() and getMetaItems() - Fix protocol initialization to include feed service callback - Log services registry availability, metadata service access, and item counts - This will help diagnose why AI metadata (agents/tools) are missing in Studio sidebar after Vercel deployment Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/7c8d308d-1490-4439-81f9-65605addcbb5 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Claude created this pull request from a session on behalf of
hotlong
April 10, 2026 13:38
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Create local integration test to verify protocol metadata service logic - Test confirms getServicesRegistry callback works correctly - Test confirms metadata service methods are called and items are merged - Add comprehensive TEST_REPORT.md documenting test results and expected behavior - All tests pass, backward compatibility maintained Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/d5b8630b-8471-4271-9799-d74454a96ed8 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
**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>
…operty Replace direct access to kernel.context (private property) with public kernel.getService() method. The protocol now probes for known services at runtime to build a fresh service map, ensuring metadata service is accessible when needed. Related to AI metadata visibility fix. 🤖 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>
The previous fix attempted to probe for services using a hardcoded list, which missed services not in the list. The correct solution is simpler: ctx.getServices() returns a fresh snapshot of ALL services each time it's called (see kernel.ts:144-145), so we can just pass it as a callback. This ensures the protocol has access to all services registered after ObjectQLPlugin's init() phase, including metadata service (for agents/tools) and AI service, which are registered by later plugins. Root cause: Protocol was capturing ctx.getServices() result during init() instead of calling it at runtime. Now fixed by passing the function itself. 🤖 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After Vercel deployment, Studio sidebar shows incomplete AI metadata (missing agents/tools). Root cause unknown—could be service registry callback failure, metadata service unavailability, or timing issues during bootstrap.
Changes
protocol.ts: Added console logging in
getMetaTypes()andgetMetaItems()to trace:plugin.ts: Fixed
ObjectStackProtocolImplementationinitialization to include missing feed service callback (3rd constructor parameter)Diagnostic Flow
This will expose whether the issue is in service registry access, metadata service registration, or the metadata itself. Once Vercel logs are available, a targeted fix can be implemented.