Skip to content

feat(AIC-3408): add Vercel AI SDK messages and agents adapters - #103

Open
andrewklatzke wants to merge 4 commits into
mainfrom
aklatzke/AIC-3408/vercel-adapter
Open

andrewklatzke wants to merge 4 commits into
mainfrom
aklatzke/AIC-3408/vercel-adapter

Conversation

@andrewklatzke

Copy link
Copy Markdown
Contributor

Summary

  • Add launchdarkly-ai-vercel-messages and launchdarkly-ai-vercel-agents packages that map LaunchDarkly AI Configs onto the official Python ai runtime and AI Gateway creator/model ids.
  • Execute tool loops, structured output, usage accumulation, and native graph handoffs instead of reading nonexistent stream fields or stopping at the first tool call.
  • Include runnable examples for gateway, injected-OpenAI, and native-graph paths, plus release-please and workspace wiring.

Test plan

  • make format-check && make lint && make typecheck && make test in python/
  • Run uv run python main.py vercel-agents launch-darkly-documentation-summarizer "..." and confirm a non-empty response, non-zero usage, and a judge score
  • Run vercel-messages and vercel-direct success/failure keys from integration-config.json
  • Confirm native-graph-vercel fails cleanly if the Gateway free tier still blocks the graph model

Made with Cursor

Route LaunchDarkly AI Configs through the official Python ai runtime and AI Gateway, including native graph execution and a direct-model opt-out.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .sdk_metadata.json
Comment thread packages/vercel-messages/src/launchdarkly_ai_vercel_messages/handler.py Outdated
Comment thread packages/vercel-agents/src/launchdarkly_ai_vercel_agents/handler.py Outdated
Use the shared span helpers in production, trace tool execution, and emit provider-compatible strict schemas for messages output.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c4ef4b8. Configure here.

span.set_attribute("launchdarkly.stream.abandoned", True)
if not failed:
model_span.end()
span.end()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancelled runs miss cancelled flag

Medium Severity

CancelledError is not an Exception, so the handlers skip fail_span and leave failed false. The stream finally then sets launchdarkly.stream.abandoned and ends the spans, while the blocking path ends them with no launchdarkly.run.cancelled. The same package’s native graph sets that flag on cancel, so cancelled Vercel runs will not match other handlers or the graph path.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c4ef4b8. Configure here.

) -> Any:
async def transfer() -> str:
selected[source] = target
return target

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handoff tool rejects model arguments

Medium Severity

transfer takes no arguments, unlike regular AgentTool executors that accept **kwargs. A model that passes any payload—common even for an empty-object schema, such as a reason—raises TypeError and aborts the graph instead of recording the handoff.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c4ef4b8. Configure here.

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.

2 participants