Commit Graph

2 Commits

Author SHA1 Message Date
85ff26ae51 ADR-018 amendment: meta-tools replace per-operation tool conversion
Instead of flattening the entire operation registry into individual
OpenAI tool definitions (with schema normalization headaches), the
AgentLoop provides the same 4 discovery+call meta-tools that the MCP
server already exposes: hub.list, hub.search, hub.schema, hub.call.

This eliminates operationToOpenAITool() + normalizeSchemaForOpenAI()
entirely. The LLM discovers and calls operations the same way an MCP
client does. Same tool defs in context always (4, not N), same call
protocol path (callMap.call()), unified interface for both MCP and
direct agent consumers.
2026-05-27 05:22:49 +00:00
a248698f40 ADR-018: Remove AI SDK, use openai SDK directly with hub-own streaming
Replace the Vercel AI SDK with direct OpenAI SDK calls and a custom
AgentLoop. The AI SDK has zero runtime integration today, so removing
it costs nothing. Supply chain risk (2-5 releases/day, April 2026
Vercel breach, bus factor of 1) makes it a liability we don't need.

Key changes:
- ADR-018 accepted: openai package (zero runtime deps) replaces ai SDK
- AgentLoop handles multi-step tool execution explicitly (~300 LOC vs
  AI SDK's ~2700 LOC streamText)
- Hub owns UIMessage/UIPart/ToolCallState types (extends ADR-016)
- Hub owns streaming protocol (subset of AI SDK's UIMessageChunk wire
  format with step boundaries, error handling, usage tracking)
- operationToOpenAITool() maps TypeBox schemas directly, no adapter
- Trade-off: ~1100 LOC total new code for the savings of 6+ transitive
  deps, supply chain risk, and release cadence coupling

Updates AGENTS.md constraints and dependencies, adds OQ-63/OQ-64/OQ-65
and Theme 11 (Inference & LLM Integration) to open questions.
2026-05-26 08:55:52 +00:00