Repository navigation
Release 0.8.12 - #427
Merged
Merged
Release 0.8.12#427
Conversation
…p-after-v0.8.11 chore: sync develop with main after v0.8.11
* test: prove a figure survives on a tool result The browser execution design has execute_code return its plots on the tool result and lists that as an open question, stated without being verified. It holds: an image block on a ToolMessage leaves this process as an Anthropic image block nested in the tool_result, and all four plausible spellings normalize to the same thing, so a widget cannot pick the wrong one and silently lose the figure. Nothing in the client stack validates the media type, so SVG (what matplotlib produces by default for the web) passes every layer here and fails as a 400 from the endpoint after the analysis has run. The accepted set is now declared as IMAGE_MEDIA_TYPES, next to the model tables so a CLI-only install can reach it, with a test comparing it against the anthropic SDK's own declaration. Offline tests assert the real payload CachingChatAnthropic builds; the live test sends one real request and reads a number drawn in the picture and written nowhere else, with a control round trip that omits the picture. * docs: close the tool-result image open question Records what was measured and the two consequences for Phase 2: the widget gates the media type because nothing else does, and images travel as inline base64 rather than as a URL the provider would fetch from the data plane. * test: draw a 3 the model can read The first live run replied 724 for a figure drawn as 734. A wrong digit is proof the picture arrived, so the transport is fine and the font was not: a flat-topped seven-segment 3 is a 2 once the image has been downscaled. Rounded glyph, larger cells, and the finding recorded where the next person will read it. * test: ask about a bar chart, not about glyphs Two live runs replied 724 and then 704 for a figure drawn as 734, both with the first and last digit right. That is the picture arriving and being read; five-pixel-wide glyphs are just not a reliable channel once an image has been downscaled. Which bar is tallest does not degrade that way, and it is closer to what this runtime will be asked about. * test: address the review findings on the image spike Moves the SDK drift test next to the constant it guards, in test_anthropic_models.py, where a maintainer editing IMAGE_MEDIA_TYPES will look and where the module's other anti-drift guard already lives. The live test now runs against every offered model rather than Haiku alone: the design's premise is that plots reach the model a person picked, and driving OFFERED_MODELS means a third one cannot skip it. Its reply parsing separates 'answered in prose' from 'named the wrong bar', so a red dispatch is triaged as the instruction-following slip it would be rather than as a dropped image. Seven bars instead of five halves the control's own coincidence rate, from 1 in 20 to 1 in 42. Also asserts the CachingChatAnthropic type before reaching for _get_request_payload, as the precedent does; records that the cache marker test is a forward guard whose invariant currently holds for a reason outside the tool-result path; and stops claiming SVG is matplotlib's default, which it is not. * test: take the answer off a tool schema, not out of prose The live run across both offered models found the flakiness the review predicted, and found it in the most instructive way: sonnet-5 passed both tests, and haiku-4-5 read the chart perfectly while failing the test. It answered with a numbered list, '1. Bar 1: Medium height ... 5. Bar 5: Tallest', so the first digit in the reply belonged to the list rather than to a bar. A prompt asking for a format is a request. A tool schema is a structure. The model now reports through a forced report_bars(tallest_position, shortest_position) call and the test reads its arguments, so no reply style can produce a wrong answer or a false alarm about the transport. * docs: describe the test that actually exists * test: prove the answer tracks the picture, with two charts The live control caught something a passing test would have hidden. Asked to report the bars with no image attached at all, haiku-4-5 answered 'tallest 5, shortest 2', which was exactly the fixture's answer. Nothing in that request depends on the fixture, so it is not a leak, it is the model's prior; but a prior that matches the fixture makes a single-chart test unfalsifiable for that model, passing whether or not the picture arrived. Two charts fix it. They carry byte-identical text and differ only in which bar is tallest and which is shortest, so a fixed guess can match at most one and answering both correctly is what proves the figure is being read. That subsumes the no-image control, which relied on a 1 in 42 coincidence not happening, and removes it. The fixtures move next to the encoder that draws them and the expected answer is derived from the heights rather than written beside them. The one property the pair depends on, that the two charts disagree, is checked in the offline suite, which runs on every pull request, rather than in a module skipped whenever no API key is present. * test: ask a question about the picture, not about counting The third live run failed for the third fixture reason in a row, and again not for a transport reason. On a seven-bar chart haiku-4-5 reported bar 4 as the tallest when bar 5 was 1.0 and bar 4 was 0.30, named the shortest bar correctly, and got BOTH answers right on the other chart, which a model perceiving nothing cannot do. The picture arrived and was read; the index was miscounted. That makes the fixture the thing under test rather than the transport, so the fixture gets easier instead of the assertion getting weaker: four bars, counted reliably, with heights far apart. Sonnet-5 passed all four cases before and after. Both rejected fixtures shared one shape, now written down where the next person will meet it: the model could see the picture and the fixture could not carry the answer. * test: tell the model how many bars there are Asked about a four-bar chart, haiku-4-5 named the tallest bar correctly and reported the shortest as bar 5. There is no bar 5. Two live runs have now failed on indexing while getting the perception right, so the prompt states the count: it leaks nothing, because which bar is tallest lives only in the picture, and it removes the last part of the question that is not about the figure. Also drops the None branch of _report_bars, dead since the two-fixture pair replaced the no-image control.
The prompt said the filters are exactly query, modality, task, has_hed, has_zarr and limit, that there is NO participant-count filter, and to pass only those six names. nemarOrg/nemar-cli#1429 takes the surface to 33 parameters and is in the release now being promoted to production, so all three statements become false the moment it ships. The third is the damaging one: it tells the model not to use filters that work, so a question about channel counts or participant numbers takes a worse route or gets refused, and nothing looks broken. Rather than swapping one list for a longer list that goes stale the same way, the prompt now points at the tool schema, which the server generates from its facet definitions. The warning that matters is kept and is not a function of how many filters exist: an undeclared argument is accepted and silently ignored, so an invented name returns unfiltered results that look filtered. Partial: #370 asks for a whole-config rewrite and raises open questions about how much belongs in the prompt at all. This is the correctness fix the nemar-cli promotion forces, not that rewrite.
The Unreleased section was empty, so the entry is written from what is actually in the promotion: the declared image media types for figures on tool results, and the NEMAR prompt no longer enumerating search_datasets' filters. Worth noting separately: 0.8.11 is on main with no entry in this file, so the changelog already skips a release. Not backfilled here, because guessing at its contents would be worse than the gap.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes
developtomain. Version is left alone:ensure-stable-version.ymlstrips.devon merge,tag-release.ymltags,release.ymlpublishes, andsync-develop.ymlmerges back and bumps.Merge with a regular merge commit, not a squash —
protect-mainsetsallowed_merge_methods: ["merge"]so the individual feature history survives onmain.What ships
#421, a figure can ride on a tool result. The only production change is additive:
IMAGE_MEDIA_TYPESdeclared insrc/core/services/anthropic_models.py, with a test comparing it against the Anthropic SDK's ownBase64ImageSourceParam.media_typeso the copy cannot drift. Nothing in the client stack checked this before, so a producer emitting an unaccepted type learned about it as a 400 after the work that made the picture was already done. SVG is the named trap:savefigdefaults to PNG, but SVG is the usual choice for a figure bound for a web page and is not accepted.#425, the NEMAR prompt stops enumerating
search_datasets' filters. This one is coupled to a release in another repository and should not be separated from it.The coupling, stated plainly
nemarOrg/nemar-cli 0.10.5 is being promoted in parallel and takes
search_datasetsfrom 6 advertised parameters to 33. Before #425, this repository's NEMAR prompt told the model:All three statements go false on that promotion, and the third instructs the model away from filters that then work, so a question about channel counts or participant numbers takes a worse route or is declined with nothing appearing broken.
The fix deliberately does not substitute a list of 33, which would go stale on the next facet added. It points at the tool schema, which the server generates from its facet definitions, and keeps the one warning that does not depend on how many filters exist: an argument the server does not declare is accepted and silently ignored.
That wording is true whether the server advertises 6 filters or 33, so this release is safe in either order relative to the nemar-cli one. Enumerating 33 here would have had to land strictly after it, or the model would invent parameters production drops.
Partial towards #370, which asks for a whole-config rewrite and raises open questions about how much belongs in the prompt at all. Those remain open.
Verification
uv run pytest tests/test_assistants/: 227 passed, 3 skipped. Full suite runs in this pull request's checks.Noted, not fixed here
maincarries 0.8.11 andCHANGELOG.md's newest entry before this release was 0.8.10, so a release already shipped without an entry. Not backfilled: reconstructing it from the commit range would be guesswork presented as a record.