Repository navigation
Ongrid v0.7.176 — DeepSeek replay + sub-agent routing + conntrack metrics
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=NULLassistant rows (the natural shape for a turn that emitted only tool_calls). The following tool messages became orphans and the next request 400'd. HydratedMessage.ToolCallsvia JOIN, addedchat_tool_calls.llm_call_idcolumn, factored the pairing logic into a newtoolreplaypackage shared between the legacy agent path and the graph kernel. - #40 — graph kernel's
PersistenceHandlerexposedWithMessageID/WithToolCallIDseams that production code never called →chat_tool_calls.message_idwas empty → NOT NULL violation → silent log warn → 0 rows written. Tool messages received syntheticname|typeIDs. Handler now self-wires vialastAssistantID+ apendingLLMCallsFIFO populated frommsg.ToolCalls. - #41 — sub-agent workers (
AgentTool) called the routing chat model with no opts and defaulted toopenai. 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) intoSpawnRequest{Provider, Model}and the worker's chat model opts. - #42 — when
AgentToolfinishes 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 bytool_call_idand hoists each immediately after its parent assistant viaemitToolByCallID. - (IM bridge model resolution — already shipped in #38 / v0.7.169.)
UI
- #43 — long chat threads stopped auto-scrolling. The post-update
useEffectmeasured distance AFTER React had already appended the new message, soscrollHeight - scrollTop - clientHeightalways cleared the 80px threshold and the code bailed. Replaced with astickToBottomRefflipped by the scroller's ownonScroll(120px slack at the bottom).
Edge metrics
- #44 / #45 —
node_exporter1.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.hostmetricsplugin now wraps the subprocess with a 15s producer writingnode_nf_conntrack_entries{,_limit}to a managed textfile collector dir.#45adds 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.shIn-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