Repository navigation
feat(protocol): the ATIF builder gives an id for a call id an endpoint repeats, and reads epoch-millisecond times and base64 media - #952
Draft
earakely-scale wants to merge 2 commits into
Conversation
…t repeats, and reads epoch-millisecond times and base64 media Eight agents' adapters each kept their own copy of the rule that numbers a call id the document already holds (`<id>#2`, `#3`, ...), and one copy that counted instead of skipping taken forms could write a duplicate. `turn.tool_call_id(native_id)` now gives that id from the document, which knows every call written and every id given out. `timestamp_ms`, `decode_base64` and `decode_data_url` replace the epoch-millisecond and base64 readers several adapters repeat. Nothing else changes: the adapters adopt these once a release carries them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e) does Python 3.10's validate=True still takes excess padding, which later versions refuse, so "padded as it should be" held only from 3.11. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai review |
earakely-scale
marked this pull request as draft
November 30, 2026 17:17
This branch has not been 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.
The ATIF builder now gives adapters what eight of them each kept a copy of: the id to write a call under when an endpoint gives a tool-call id again, a time given in epoch milliseconds, and the bytes of base64 text or a data URL. Nothing existing changes. The adapters switch to these in a follow-up, once a release carries them, since each agent's image installs the protocol from PyPI.
What changes
turn.tool_call_id(native_id). A call id is unique across a document, but an endpoint may repeat one, as vLLM numbers each response's calls from zero (functions.<name>:<index>). This gives the id to write the call under: the endpoint's own, or, once the document holds it or gave it out, the first of<native_id>#2,#3and on that it hasn't. The id is reserved when given, so an adapter that takes ids for several calls before writing them gets distinct ones. Its result names that id, so the adapter still decides which of its calls a result answers.tool_callgives.timestamp_ms(value). A time given as an integer count of milliseconds since the Unix epoch, written astimestampwrites a time to the millisecond. It returns None for any other value and for a count past the years a datetime holds; the four adapters' copies raised there.decode_base64(value)anddecode_data_url(value). The bytes of base64 text, and the bytes and media type of adata:<type>;base64,...URL, read asb64decode(validate=True)reads them (from Python 3.11 that refuses bad padding too; 3.10 still takes excess=). Each returns None for a value it doesn't read. Nine adapters decode media one of these two ways.Testing
test_atif_adapter_helpers.py, 39):tool_callrefuses it; times at and around the epoch; bad base64 and malformed data URLs.b64decodeon any text.tool_call_idin 1,668,311 random documents built straight through the builder: several tasks, sub-agents, ids given out and written at once, held and written later in any order, or never written, ids of the adapter's own, endpoint ids that already look likex#2, results by the id each call was written under, tasks ending with calls open, and a live page after every operation. Each id given out matched a model of the rule kept in the script, writing one never clashed, every call and result sat where it was written, and every document and its live pages validated. The adapters' own chaos never reaches ids held before they're written, since every adapter today writes a call as soon as it has its id; this does.timestamp_ms,decode_base64anddecode_data_urlagainst reference rules written in the script (datetime arithmetic, a padding-aware base64 reader, a data-URL parser): 333.7 million values, none apart.#1, milliseconds dropped, bools read as times, lenient base64.main:main's adapter and the ported one on every seed, 900 s each on a test host: 266,230 seeds, every live page, document, media file and kit finding identical.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Adds shared ATIF helpers for repeated tool-call ids, epoch-millisecond times, and base64 media.
Reviews (7) · Last reviewed commit: "docs(protocol): decode_base64 says it re..." · Reviewed by Greptile