feat(AIC-3408): add Vercel AI SDK messages and agents adapters - #103
andrewklatzke wants to merge 7 commits into
Conversation
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>
Use the shared span helpers in production, trace tool execution, and emit provider-compatible strict schemas for messages output.
…cel-adapter # Conflicts: # .release-please-manifest.json
CancelledError is not an Exception, so those spans were ending unmarked or as abandoned. Handoff tools now ignore extra model arguments instead of raising TypeError. Co-authored-by: Cursor <cursoragent@cursor.com>
Tool loops were collapsing every inference into one span and forcing the final schema onto intermediate tool calls, and the native graph span omitted the token totals the other adapters write.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 89c52d5. Configure here.
| results = [await _tool_result(call, executors, parent) for call in calls] | ||
| messages = [*messages, message, ai.tool_message(*results)] | ||
| raise RuntimeError( | ||
| f"Vercel messages run did not reach a final response within {MAX_STEPS} steps" |
There was a problem hiding this comment.
Structured follow-up can exhaust step limit
Medium Severity
When outputFormat and tools are both set, a no-tool-call turn now continues so a later constrained request can apply the schema. That extra iteration still counts against MAX_STEPS. If the unconstrained final answer arrives on the last allowed step, the loop ends and raises RuntimeError instead of performing the structured turn, so a completed tool loop with structured output fails.
Reviewed by Cursor Bugbot for commit 89c52d5. Configure here.


Summary
launchdarkly-ai-vercel-messagesandlaunchdarkly-ai-vercel-agentspackages that map LaunchDarkly AI Configs onto the official Pythonairuntime and AI Gatewaycreator/modelids.Test plan
make format-check && make lint && make typecheck && make testinpython/uv run python main.py vercel-agents launch-darkly-documentation-summarizer "..."and confirm a non-empty response, non-zero usage, and a judge scorevercel-messagesandvercel-directsuccess/failure keys fromintegration-config.jsonnative-graph-vercelfails cleanly if the Gateway free tier still blocks the graph modelMade with Cursor