fix(eve): unique toolResultFrom identity for same-host connections (#202)#772
Open
ZhYGuoL wants to merge 5 commits into
Open
fix(eve): unique toolResultFrom identity for same-host connections (#202)#772ZhYGuoL wants to merge 5 commits into
ZhYGuoL wants to merge 5 commits into
Conversation
…ercel#202) Two OpenAPI connections sharing a baseUrl (e.g. Jira and Confluence on one Atlassian host) collided on the fallback identity connection:<host>, so eve warned "could not assign a unique toolResultFrom identity" and toolResultFrom stopped matching through the imported definition objects. Fold the connection description into the fallback identity so same-host connections stay distinct, and register the same key from the resolver. The genuine-ambiguity warning still fires when url and description both match. Also widen toolResultFrom to accept OpenAPI connections, which the runtime already narrowed but the type rejected. Signed-off-by: ZhYGuoL <[email protected]>
…ith resolver key Signed-off-by: ZhYGuoL <[email protected]>
…ections Signed-off-by: ZhYGuoL <[email protected]>
Contributor
|
@ZhYGuoL is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
Two connections on the same host (Jira + Confluence on one Atlassian
baseUrl) collided on the fallback identityconnection:<host>, so eve warned "could not assign a unique toolResultFrom identity" andtoolResultFromstopped matching when passed the imported connection objects.What changed
connectionDefinitionKey(url, description)inpackages/eve/src/public/tool-result-narrowing.tsand call it fromdefineOpenAPIConnection,defineMcpClientConnection, andresolveConnectionDefinition, foldingdescriptioninto the fallback identity so same-host connections stay distinct. Identicalurl+descriptionstill collide and warn.baseUrl ?? ""so it matches the compiledurl(normalize-connection.ts:62) even whenbaseUrlis omitted and the runtime derives the base URL from the spec'sservers.toolResultFromto accept OpenAPI connections via aNarrowableConnectionDefinitionunion; the runtime already narrowed them, only the type rejected them. Update theMatchedConnectionResultdoc comment anddocs/guides/hooks.md.How I verified
baseUrldefineOpenAPIConnectionobjects warneve could not assign a unique toolResultFrom identity for "connection:https://example.atlassian.net" ...andtoolResultFromreturnsundefined(test fails:expected "warn" to not be called at all, but actually been called 1 times).toolResultFrommatches through the imported object; a result from one connection does not narrow through the other.packages/eve/src/public/tool-result-narrowing.test.ts): "matches through same-host OpenAPI connections passed as module exports" and "matches through baseUrl-less OpenAPI connections passed as module exports". Fail before, pass after.pnpm lint,pnpm typecheck,pnpm test:unit(4684 passed, 1 skipped),pnpm docs:check.Closes #202.