Files
leleka/docs
Pavlo RatushnyiandClaude Sonnet 5.5 9b07fdd995 fix: a string argument that quotes a tool call is no longer cut at the quoted text
tool_output::find_parameter_end ended a value at the first </parameter> followed by <parameter= or </function>, so a write
whose content quoted a whole call (a file that documents the format, a heredoc, a test) was published with content cut at the
quote and the rest as plain text, whole and streamed, without any error (upstream #4078, fixed there in 77794e34 and b72f56e0).
It now follows upstream's quote rule: a close inside a call the value itself quotes (more quoted <function=NAME> openers
followed by <parameter= or </function> than </function> closers before it) is part of the value. One forward pass over the
value. Incremental also stops re-trying candidate call ends it has already rejected.

A call whose value quotes an opener and never closes it is now unterminated (an error) instead of being cut at the first
plausible close, so a long write that quotes a call and is itself cut by the token limit is not published truncated.

Deliberately not taken from upstream: a value that reopens its own parameter (</parameter><parameter=content> inside content).
Upstream reads it as text; here it is byte for byte a parameter written twice, which desktop-core's
native_tools_sdet::unknown_incomplete_duplicate_or_late_invalid_call_refuses_entire_output requires to be refused, and merging
the two into one argument would hide a malformed call. It stays an error (duplicate tool parameter), listed as known failure.

Regression tests: specimens 4078-nested-call and 4078-heredoc and the quoted-value shapes "quoted call", "quoted call at the
end" and "heredoc" of the ported corpus failed on the previous commit and pass here (13 of 41 specimens, 5 of 6 shapes), plus a
unit test for the cut outer call. The 8 existing tool_output tests and the 14 native_tools_sdet tests pass unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:45:24 +01:00
..
2026-10-25 14:14:47 +01:00
2026-10-24 02:03:29 +02:00