jinccc-ctrl on #4659: with tools declared and the model answering in text
alone, WorkBuddy's stream ended on a frame whose function_call was an
empty object where the contract has null, and OpenMausBot, which checks
every frame's shape, read the empty object for a legacy call and refused
the whole turn ("legacy function_call is unsupported; use structured
tool_calls") — so every text reply a tools-carrying request got was a
turn lost, while clients that merge silently never noticed.
An empty function_call — a name and arguments both empty — says nothing
and runs nowhere, so chatTidy leaves it out, as it leaves out an empty
reasoning_content, an empty tool_calls and a nameless call (#1475). A
null goes as it came, and a call whose name or arguments hold something
is one a client may still be reading: both untouched, as is a name or
arguments of another kind than a string.
Run (darwin/arm64, go test ./internal/gateway/ -tags nogui):
internal/gateway/function_call_null_test.go:32: an empty function_call
object went out where the contract has null (#4659) — before the fix;
after, TestStreamedEmptyFunctionCallLeftOut and
TestStreamedNamedFunctionCallKept pass, the full gateway package
passes, and gofmt, go vet, -race on the targeted tests and
linux/windows/darwin builds are clean.
Generated-by: GLM-5.3-Flash (ZCode)