Files
DeepTutor/deeptutor/capabilities/explore_context
Bingxi Zhao (Frank) 9e4233c3ae fix(chat): assign streamed tool-call ids instead of appending them
A router in front of an OpenAI-compatible provider re-sends the complete
`id` on every delta chunk rather than only on the first. The chat loop and
the explore capability appended it, so the id grew one copy per chunk —
#937 observed 551, 754, 870, 1566, 9715, 17864 and 47241 characters. Past
the provider's own 64-character ceiling every round died with HTTP 400
`Invalid 'messages[i].tool_calls[0].id': string too long`, the
forced-finish call died the same way, and the turn surfaced as "I could not
produce a useful response from the model output."

The report named one site and declared `name` correct as-is. There were two
sites, and both had the identical defect on `name`, which a repeat corrupts
into an unresolvable `toolnametoolnametoolname` — latent for that
reporter's gateway, fatal for any gateway that repeats the name.

Rather than restate the per-field rule a third and fourth time, converge
the three core-layer sites (chat loop, explore capability, labeled step)
onto one accumulator that states it once: `id` and `name` arrive whole and
are assigned, `arguments` arrives in fragments and is concatenated. That
rule is not new — it is what the services-layer provider's `_accum_tc` has
always done, which is the evidence that assigning `name` is safe across
every gateway users have configured. That accumulator stays where it is:
it reads deltas that may be plain dicts, so folding it in would widen the
blast radius without fixing anything.

Coercing a missing `index` to 0 also removes a latent crash in the labeled
step runner, where a `None` key made the final `sorted()` raise as soon as
one real index appeared.
2026-08-21 16:20:13 +08:00
..
2026-06-17 00:56:27 +08:00
2026-06-17 00:56:27 +08:00
2026-06-17 00:56:27 +08:00