Skip to content

v2.16.2

Latest

Choose a tag to compare

@Eigenwise Eigenwise released this 17 Nov 12:54
9be5ce5

Read before upgrading

  • AgentConfig.max_context_tokens has to be a positive number or None. Zero and negative values now fail validation instead of trimming the whole history before raising. (#475)
  • TokenCounter.count_text() counts the text alone. It used to wrap the text in a chat message, so every result was a few tokens too high (7 for an empty string on GPT-4). If you calibrated a budget against the old numbers, they drop by that amount. (#407)
  • MCP: a server argument named tool_name, resource_name or prompt_name used to be overwritten by the routing field and never reached the server. It now appears as mcp_tool_name, mcp_resource_name or mcp_prompt_name on the generated input model and is sent under its own name. (#409)
  • MCP: fixed-length tuple arguments are validated per position, and minProperties / maxProperties on dict-valued arguments are enforced, so a value the server would reject fails locally first. (#391, #463)
  • Tracing: for Anthropic, gen_ai.usage.input_tokens now includes cache read and cache write tokens, which Anthropic reports outside input_tokens. Totals for cached prompts go up to the real number. (#404)
  • ChatHistory.dump() writes round-trip JSON, so computed fields are no longer stored in a snapshot. (#388)

Fixes

Agents, history and schemas

  • A saved history with aliased or Json[T] fields loads again, and streamed outputs with such fields are recorded in history. (#388)
  • Specializing a generic BaseIOSchema, for example Envelope[int], keeps the docstring of the generic class instead of raising. (#431)
  • Media on a field hidden with exclude_if is not sent to the model. (#408)
  • Whitespace before the first JSON token of a streamed response no longer breaks partial parsing. (#468)

MCP

  • Discovery skips a catalog the server did not advertise instead of failing with Method not found, so tools-only servers work with the combined fetch. (#415)
  • An empty text block in a prompt response stays an empty string. (#411)

Tracing

  • Anthropic cache tokens are reported as gen_ai.usage.cache_read.input_tokens and gen_ai.usage.cache_write.input_tokens. (#404)
  • Native Gemini responses record token usage and the response model. (#430)
  • Payloads and captured messages are not serialized for spans that are not recording, such as sampled-out runs. (#460)

Forge tools

  • webpage_scraper: pages that declare their encoding in the HTML but not in the HTTP header are decoded correctly (#418), relative links and images are resolved against the final page URL (#412), headings and bylines inside <article><header> are kept (#442), and an empty main-content element no longer wins over the real article (#458).
  • hackernews_search: queries that fail are reported in a failures list instead of looking like an empty result. (#400)
  • serply_search: requests don't follow redirects, so the API key header can't be forwarded to another host. (#462)
  • searxng_search: the social media category is sent under the name SearXNG uses. (#453)
  • bocha_search: the per-call result limit is sent to the API. (#464)
  • arxiv_search: queries that start with submittedDate: or jr: are sent as written. (#402)
  • wikipedia_search: edition codes are validated before they go into the host name. (#379)
  • weather: the forecast is kept when the current temperature is missing. (#397)
  • datetime_tool: a local time that does not exist (spring-forward gap) is rejected. (#406)

Examples and the atomic TUI

  • rag-chatbot: chunks stay within the configured size (#382), and the Qdrant backend reports a cosine distance like the Chroma one (#392).
  • deep-research: the call cap is checked before every agent call (#377), and the research plan is part of the shared context (#459).
  • dspy-integration: prediction fields survive the bridge (#444), nullable and union fields are kept in signatures (#445), each benchmark review starts from a clean history (#450), and a limited training set still contains every genre (#452).
  • YouTube examples: the configured caption languages are used. (#447)
  • atomic: the file picker survives unreadable folders and duplicate names (#405), shows paths with square brackets literally (#410), and loads the tool catalogue without freezing the interface (#422).

Contributing

  • The contributing guide has a new section, "What gets reviewed": at most 5 open pull requests per contributor, related fixes grouped, a bug fix names a trigger a user can hit, and features and performance changes start with an issue. (#483)

Thanks

All fixes in this release are by @Afloat16.

Full Changelog

v2.16.1...v2.16.2