agents@0.28.1
Cloudflare Agents SDK 0.28.1 enhances AI model routing options, updates MCP dependencies, refines MCP session teardown, and standardizes OpenCodeHarness session events.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
agents@0.28.1 delivers several patch changes across model integration, Model Context Protocol (MCP) support, and harnesses. Key updates include: - Model routing: createAI in agents/models/ai-sdk and agents/models/pi-ai adds the 'zdr' gateway option and vendorKey: 'request' for routing with user-supplied vendor keys. It also accepts AI Gateway dynamic routes formatted as ai('dynamic/ '). - MCP updates: Dependency updates to @modelcontextprotocol/sdk (1.32.1) and @modelcontextprotocol/client & server (2.3.1). Client transports now follow redirects only within the same origin. McpAgent now immediately returns 404 for requests to sessions ended with DELETE, rather than continuing until deferred teardown runs. createMcpHandler rejects legacy requests if the factory returns an active instance without closing it. - OpenCodeHarness: session.events() now streams a snapshot followed by events normalized to match PiHarness event types (run start/end, operation start/end, message start/end, text delta, reasoning delta, tool start/end, permissions, compaction), replacing raw OpenCode events (which remain accessible via session.log()). In the OpenCode example, local file and shell tools are replaced with @cloudflare/computer Workspace tools.
可执行摘要
agents@0.28.1 introduces zdr gateway and vendorKey: 'request' options in createAI, supports AI Gateway dynamic routes, updates @modelcontextprotocol packages to sdk 1.32.1/client/server 2.3.1 with same-origin redirect restrictions, changes McpAgent teardown behavior to return 404 immediately on DELETE, and standardizes OpenCodeHarness session.events() output to match PiHarness event types.
- Agent 实用度
- 77/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Verify that code relying on OpenCodeHarness session.events() is updated to handle the new standardized event schema, or switch to session.log() if raw OpenCode events are required.
- Ensure MCP client transports do not depend on cross-origin redirects, as redirects are now restricted to the same origin.
- Update any session cleanup flows to expect immediate 404 responses upon session DELETE in McpAgent.