refactor(mcp): use shared appswire toolInvocation meta helper - #700
Merged
Merged
Conversation
Switches CLI-local app-helper _meta to appswire.ToolInvocationMeta, replacing manual nested openai/toolInvocation objects with the contract's flat slash-delimited keys. Adds ResourceURI and Visibility to the handoff ResumeToolSpec so the *_status and *_resume tools register their view attachment through the shared helper, and bumps go.lumeweb.com/pinner to the merge commit exposing meta.go.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
pcfreak30
marked this pull request as ready for review
September 12, 2026 20:48
Code Coverage ReportTotal Coverage: 55.3% Generated from commit: bb1bd97 |
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.
Switches the CLI-local app-helper _meta to the shared appswire.ToolInvocationMeta helper, replacing manual nested openai/toolInvocation objects with the contract's flat slash-delimited keys.
Adds ResourceURI and Visibility to the handoff ResumeToolSpec so the *_status and *_resume tools register their view attachment through the shared helper. Bumps go.lumeweb.com/pinner to the merge commit exposing meta.go.
Summary
This refactor centralizes the generation of OpenAI tool-invocation metadata (
openai/toolInvocation) behind a single shared helper,appswire.ToolInvocationMeta, and updates every tool that previously hand-wrote this metadata to use it.What changed
Shared meta helper adoption
internal/mcp/apps/apps.go(pin_status helper) andinternal/mcp/upload/upload_vault_app.go(vault_upload_submit helper) now callappswire.ToolInvocationMeta(...)instead of constructing the nestedmetamap inline.internal/mcp/core/handoff/handoff_registry.go(resume tool template) now uses the same shared helper and wires the tool'sResourceURIandVisibilityinto the generated metadata.Resume tool API change
handoff.NewResumeToolnow returns(model.ToolDescriptor, error)instead of just a descriptor. The only error path is an emptyResourceURIin the spec — a wiring bug.handoff.MustResumeTool, a convenience wrapper that panics on that error, to preserve the single-value ergonomics for callers with constant, valid specs. All existing callers (auth_sso,oob/vault_handoff,vault/vault_create_app,vault/vault_restore_app) were updated to supplyResourceURIandVisibilityand to use the wrapper.Metadata format change
openai/toolInvocation/invokingand/invoked) instead of a nestedopenai/toolInvocationobject. This matches the contract produced by the sharedappswire.ToolInvocationMetahelper across all tools.Tests
pin_status,vault_upload_submit, and the resume template.ResourceURIfails via error return (and therefore would panic throughMustResumeTool).ResourceURI/Visibilityfields.Impact