@cloudflare/codemode@0.5.2
QwenLM/Qwen3-VL@cloudflare/codemode@0.5.2Sep 11, 2026by github-actions[bot]
Upgrading?
AI Summary
Improves JSON handling for oversized results by truncating structurally to ensure valid output, separating durable call logs from model context.
Key Highlights
- Structured result truncation now produces valid JSON of the original shape
- Oversized values are shrunk in place (strings clipped, arrays truncated)
- Code Mode tool now carries a `toModelOutput` projection
- Durable call logs are preserved for UI and audit but not sent to model context
New Features
- Structural truncation for oversized objects and arrays
- Projection logic separating `calls` from `logs` in tool output
Full Release Notes
### Patch Changes
- [#2224](https://github.com/cloudflare/agents/pull/2224) [`dcca089`](https://github.com/cloudflare/agents/commit/dcca0896cc829e4a602a1feb47466ac79d1ca096) Thanks [@mattzcarey](https://github.com/mattzcarey)! - Truncate structured results structurally instead of slicing their JSON.
`truncateResult` (the default `transformResult` in Think's execute tool and the browser tools) and the `codeMcpServer` / `openApiMcpServer` response path used to pretty-print an oversized object and cut it at a character count, leaving the model with half a JSON document. Oversized values are now shrunk in place, largest values first: strings are clipped with a `--- TRUNCATED --- <n> chars` suffix, arrays keep their leading items and end with a `--- TRUNCATED --- <n> more items` element, and an object only loses entries (largest first, named in a `"--- TRUNCATED ---"` entry) when its values cannot share the budget. The output is always valid JSON of the original shape and small values pass through untouched.
The Code Mode tool now carries a `toModelOutput` that projects `calls` out of what the model sees and bounds the sandbox `logs` the same way a result is bounded. The durable call log — every connector call's args and result — stays on the persisted tool part for UIs and audit, but no longer rides into the model's context uncapped alongside the transformed `result`. The projection never throws: a BigInt or cyclic value is rendered rather than failing a completed run at model assembly.
The MCP servers apply the response budget to the text they emit, pretty-printing only while that still fits.
Fixes [#2009](https://github.com/cloudflare/agents/issues/2009), [#2143](https://github.com/cloudflare/agents/issues/2143) and [#2182](https://github.com/cloudflare/agents/issues/2182).
Related Repositories
rasbt/LLMs-from-scratch★ 107,079
Implement a ChatGPT-like LLM in PyTorch from scratch, step by step
lyogavin/airllm★ 40,213
AirLLM 2.8T LLM inference with single 4GB GPU
NirDiamant/RAG_Techniques★ 29,962
This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial.
microsoft/OmniParser★ 25,539
A simple screen parsing tool towards pure vision based GUI agent
karpathy/nn-zero-to-hero★ 24,907
Neural Networks: Zero to Hero