Skip to content

Ongrid v0.7.176 — DeepSeek replay + sub-agent routing + conntrack metrics

Choose a tag to compare

@singchia singchia released this 05 Jun 16:52
· 811 commits to main since this release
3684118

Highlights

Seven fixes since v0.7.169 — five of them resolve chat-stream HTTP 400 failures we tripped in production after rolling DeepSeek v4. The remaining two clear up UI auto-scroll and an upstream node_exporter gap on modern kernels.

chat replay + LLM routing (5 fixes)

DeepSeek v4 enforces the OpenAI tool-call protocol strictly: every assistant message with tool_calls MUST be followed by tool responses pairing each tool_call_id. Several historical shortcuts in our persistence + replay layers produced subtly malformed history that older permissive providers tolerated and DeepSeek v4 rejected.

  • #39 — buildMessages dropped Content=NULL assistant rows (the natural shape for a turn that emitted only tool_calls). The following tool messages became orphans and the next request 400'd. Hydrated Message.ToolCalls via JOIN, added chat_tool_calls.llm_call_id column, factored the pairing logic into a new toolreplay package shared between the legacy agent path and the graph kernel.
  • #40 — graph kernel's PersistenceHandler exposed WithMessageID / WithToolCallID seams that production code never called → chat_tool_calls.message_id was empty → NOT NULL violation → silent log warn → 0 rows written. Tool messages received synthetic name|type IDs. Handler now self-wires via lastAssistantID + a pendingLLMCalls FIFO populated from msg.ToolCalls.
  • #41 — sub-agent workers (AgentTool) called the routing chat model with no opts and defaulted to openai. On installs configured for Zhipu / Anthropic / DeepSeek only, the specialist call hard-failed with "provider not configured". Coordinator LLM choice now propagates through context (basetool.WithLLMChoice) into SpawnRequest{Provider, Model} and the worker's chat model opts.
  • #42 — when AgentTool finishes seconds after parallel sibling tools, persistence stores rows in created_at order, which interleaves the next assistant turn between the parent and its delayed tool response. DeepSeek then 400'd with "insufficient tool messages following tool_calls message". Replay now indexes tool messages by tool_call_id and hoists each immediately after its parent assistant via emitToolByCallID.
  • (IM bridge model resolution — already shipped in #38 / v0.7.169.)

UI

  • #43 — long chat threads stopped auto-scrolling. The post-update useEffect measured distance AFTER React had already appended the new message, so scrollHeight - scrollTop - clientHeight always cleared the 80px threshold and the code bailed. Replaced with a stickToBottomRef flipped by the scroller's own onScroll (120px slack at the bottom).

Edge metrics

  • #44 / #45 — node_exporter 1.8.2's conntrack collector reads /proc/sys/net/nf_conntrack_count, which doesn't exist on modern kernels (the file lives at /proc/sys/net/netfilter/nf_conntrack_count). The collector registered but emitted nothing, leaving the manager's "conntrack 利用率" panel empty on every edge. hostmetrics plugin now wraps the subprocess with a 15s producer writing node_nf_conntrack_entries{,_limit} to a managed textfile collector dir. #45 adds a guard so the shim stays quiet on older kernels (where the built-in collector is already emitting the same series).

Upgrade

wget https://github.com/ongridio/ongrid/releases/download/v0.7.176/ongrid-v0.7.176-linux-amd64.tar.xz
tar -xJf ongrid-v0.7.176-linux-amd64.tar.xz
cd ongrid-v0.7.176-linux-amd64
bash upgrade.sh

In-place; no data migration. Edge agents pick up the conntrack fix automatically on their next bundle-upgrade heartbeat (ADR-024).

Checksums

687f50938e8960640455416940c169545c9a820be167cd2bd3a302fc6400125b  ongrid-v0.7.176-linux-amd64.tar.xz