• Stefy Lanza (nextime / spora )'s avatar
    send tool-call arguments over HTTP as a string, not an object (v0.4.62) · 3f58073e
    Stefy Lanza (nextime / spora ) authored
    The turn AFTER a tool call failed, with the client replaying the assistant's
    tool_calls:
    
      the pod answered 500: 400 Bad Request ... 3 validation errors:
        {'type': 'string_type',
         'loc': (..., 'ChatCompletionMessageFunctionToolCallParam',
                 'function', 'arguments'),
         'input': {'dal': '2026-10-21', 'al': '2026-11-21'}}
    
    coderai hands its backends `function.arguments` as a MAPPING on purpose: GGUF
    chat templates render it with `|items`, and llama.cpp raises "Can only get item
    pairs from a mapping" on a string (_normalize_tool_call_arguments). The OpenAI
    schema says string. Both are right for their own side, so the conversion
    belongs at the edge where a request stops being a template's input and becomes
    another server's HTTP body -- in the proxy backends' _chat_payload: runpod,
    vllm, and ds4/ktransformers, which post the same body to a local server. The
    three validation errors are one cause: vLLM's union arms each rejecting that
    field.
    
    Absent arguments go out as "{}", not "null", which a server would try to read
    as an argument object. Nothing to convert returns the caller's own list
    unchanged -- every request passes through here, OCR's page-per-request traffic
    included.
    
    Only reachable once a client replays an assistant turn that HAS tool calls,
    so it was unreachable while those calls were being dropped (v0.4.60).
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01S8LAP3ueNzQJtwzhgVbq66
    3f58073e
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-longcat-train.txt Loading commit data...
requirements-longcat.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...