Skip to content

Assert the tool round-trip property instead of the signature repr - #2

Merged
jph00 merged 1 commit into
mainfrom
roundtrip-test
Aug 3, 2026
Merged

Assert the tool round-trip property instead of the signature repr#2
jph00 merged 1 commit into
mainfrom
roundtrip-test

Conversation

@erikgaas

@erikgaas erikgaas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Companion to AnswerDotAI/toolslm#99, which makes mk_tool-rebuilt tools carry param descriptions as Annotated metadata. That changes the signature repr, breaking the byte-exact assertion here:

test_eq(str(inspect.signature(c.tools.fahrenheit)), '(celsius: float)')

Replaced with the guarantee it stood for, checked over the live HTTP round trip:

test_eq(list(inspect.signature(c.tools.fahrenheit).parameters), ['celsius'])
test_eq(get_schema(c.tools.fahrenheit, pname='inputSchema')['inputSchema'], srv.specs[0]['inputSchema'])

This makes the notebook's own claim ("comes back out the other with its signature, docs, and defaults intact") fully true — previously per-param descriptions were dropped. Needs the toolslm PR (the toolslm>=0.3.47 pin already covers it per the bump-after-release convention). nbdev-test --path nbs/00_core.ipynb green with that branch.

With toolslm carrying param descriptions as Annotated metadata, the
signature repr changed; replace the byte-exact assertion with the
guarantee it stood for: a rebuilt tool re-derives the exact schema it
was served from. Needs toolslm>=0.3.47 (already pinned).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHkskFwAKk5LNW4xMpeZFP
@erikgaas
erikgaas requested a review from jph00 August 3, 2026 03:12
@jph00

jph00 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks @erikgaas .

If you have a moment, it might be nice to clean up the now-extremely-giant sentence "Against the live server started above: the handshake carries the instructions across, the rebuilt tool re-derives the exact schema it was served from (descriptions included, carried as Annotated metadata on its signature), and the bound tool wears fahrenheit's real signature and docs, calling it round-trips, and a crashing tool surfaces as a Python exception carrying the server-side traceback:"! :O

@jph00
jph00 merged commit be6391e into main Aug 3, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants