Skip to content

fix(eve): unique toolResultFrom identity for same-host connections (#202)#772

Open
ZhYGuoL wants to merge 5 commits into
vercel:mainfrom
ZhYGuoL:fix/toolresultfrom-same-host-connections
Open

fix(eve): unique toolResultFrom identity for same-host connections (#202)#772
ZhYGuoL wants to merge 5 commits into
vercel:mainfrom
ZhYGuoL:fix/toolresultfrom-same-host-connections

Conversation

@ZhYGuoL

@ZhYGuoL ZhYGuoL commented Jul 14, 2026

Copy link
Copy Markdown

Two connections on the same host (Jira + Confluence on one Atlassian baseUrl) collided on the fallback identity connection:<host>, so eve warned "could not assign a unique toolResultFrom identity" and toolResultFrom stopped matching when passed the imported connection objects.

What changed

  • Add connectionDefinitionKey(url, description) in packages/eve/src/public/tool-result-narrowing.ts and call it from defineOpenAPIConnection, defineMcpClientConnection, and resolveConnectionDefinition, folding description into the fallback identity so same-host connections stay distinct. Identical url+description still collide and warn.
  • Align the OpenAPI authoring key to baseUrl ?? "" so it matches the compiled url (normalize-connection.ts:62) even when baseUrl is omitted and the runtime derives the base URL from the spec's servers.
  • Widen toolResultFrom to accept OpenAPI connections via a NarrowableConnectionDefinition union; the runtime already narrowed them, only the type rejected them. Update the MatchedConnectionResult doc comment and docs/guides/hooks.md.

How I verified

  • Before: two same-baseUrl defineOpenAPIConnection objects warn eve could not assign a unique toolResultFrom identity for "connection:https://example.atlassian.net" ... and toolResultFrom returns undefined (test fails: expected "warn" to not be called at all, but actually been called 1 times).
  • After: each connection gets a distinct identity, no warning, and toolResultFrom matches through the imported object; a result from one connection does not narrow through the other.
  • Tests (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.
  • Full local green: pnpm lint, pnpm typecheck, pnpm test:unit (4684 passed, 1 skipped), pnpm docs:check.

Closes #202.

ZhYGuoL added 3 commits July 13, 2026 19:59
…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]>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@ZhYGuoL is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eve could not assign a unique toolResultFrom identity for Atlassian tools

1 participant