Files
CC-Switch/src-tauri
Jason 9db9c56fda fix(proxy): report dropped Chat tool calls instead of faking completion
When a third-party gateway returns tool calls without a function name,
the Chat -> Responses transform silently discarded them and still marked
the turn as `completed`. Codex then saw a successful turn with nothing
left to do and ended its agent loop without any error, turning a
diagnosable upstream failure into a silent stall.

- Emit `response.failed` (streaming) or a transform error (non-streaming)
  when every tool call in a turn was dropped and none remains usable.
  Gated on `status == "completed"` so that `finish_reason: length`
  truncation keeps its own `incomplete` semantics, matching the existing
  Anthropic streaming path.
- Log all three drop sites with structured, content-free fields (call_id
  presence, argument byte counts, finish reason) so the upstream defect
  can finally be diagnosed from real traffic.
- Treat whitespace-only function names as missing, and resolve tool keys
  conservatively when upstream omits the required `index` field.

Turns that still contain a valid tool call, text-only turns and truncated
turns are unaffected. Adds 13 tests.

Refs #4341
2026-08-03 21:34:28 +08:00
..
2026-06-04 23:32:32 +08:00
2026-07-31 22:30:28 +08:00
2026-07-31 22:30:28 +08:00
2026-07-31 22:30:28 +08:00