Commit Graph
3 Commits
Author SHA1 Message Date
cat-shark d0d69617da fix: keep a turn's tool results together when one returns an image
The OpenAI-shaped `tool` role content is a plain string, so a tool result
carrying images (pi's read/screenshot tools) follows as an extra user
message. It was emitted immediately after its own tool message, which broke
multi-call turns:

  assistant(tool_calls=[a, b]) -> tool(a) -> user(image) -> tool(b)

Qoder rejects that with "An assistant message with 'tool_calls' must be
followed by tool messages responding to each 'tool_call_id' (insufficient
tool messages following tool_calls message)", leaving the session unable to
send any further request.

Queue the image follow-up and flush it once the run of consecutive tool
results ends, so every tool_call_id is answered before the user message.
2026-09-24 17:17:25 +08:00
cat-shark e7d12b5532 fix: retry instead of stalling when DSML tool-call markup leaks
DeepSeek V4 sometimes expresses a tool call as its internal DSML markup
instead of filling `tool_calls`, and Qoder's gateway leaks the tag skeleton
rather than converting it. When no structured call arrives the turn used to
end as an empty `stop` and the agent stopped mid-task with no error.

Handle both shapes:

- Filter the delimited form (`||DSML||tool_calls` ...) on the reasoning and
  content channels, rebuilding a complete block into a structured call.
- Strip the delimiter-less form the gateway leaves behind
  (`<parameter name="command">…</parameter>`, `</invoke>`, `</tool_calls>`,
  a stray `</thinking>`) line-wise before the empty-turn guard reads the
  message, and make `hasVisibleText` ignore markup-only text. That form used
  to land in the *content* channel as a normal reply, so the guard saw
  visible text and never fired.

A turn that produces only leaked markup now fails with a retryable error
(matching pi's "ended without" pattern) instead of ending silently.
2026-09-24 17:17:18 +08:00
cat-shark a0be14764c feat(models): register every /model/list scenario
Qoder's /model/list groups one account catalog by UI scenario (chat,
assistant, quest, qwork, experts, ...). The CLI only read `chat`, so the
picker hid models the IDE exposes elsewhere — GLM-5.3, GLM-5.2 and
DeepSeek-V4-Pro live under experts/qwork.

Register the union of the scenario groups, keeping the first occurrence per
upstream key (chat wins) and excluding byok_* groups, which are
bring-your-own-key providers rather than part of the shared catalog.

Also keep an explicitly enabled `auto` model: live catalogs key `configs` by
the whitespace-stripped display name, so it arrives as `Auto` instead of the
legacy raw `auto` key.

Refresh the lockfile to the 0.4.5 already in package.json.
2026-09-24 17:17:10 +08:00