{"slug": "openclaw-connector-hardening", "title": "OpenClaw Connector Hardening", "summary": "OpenClaw runtime plugin received three hardening improvements identified by Ant from production patterns: temporal index content previews, type safety and backwards compatibility updates, and a new mid-session checkpoint extraction endpoint for long-lived sessions. The changes are delivered in PR #369.", "body_md": "# OpenClaw Connector Hardening\n\nThree targeted improvements to the OpenClaw runtime plugin identified by Ant (Discord agent) from production use patterns.\n\n## Problem 1 — Temporal Index Content Previews\n\n**Change:** `buildSynthesisIndexBlock`\n\n(hooks.ts) now appends a\n`summary: <preview>`\n\nline under each temporal index entry, using the\nexisting `trimContent(node.content, 120)`\n\nhelper.\n\nThe synthesis prompt’s “do not rewrite” instruction was updated to cover the two-line format.\n\n## Problem 2 — Type Safety and Backwards Compatibility\n\n**Change:** `openclaw-types.ts`\n\nnow mirrors the upstream typed hook\ninterfaces (`PluginHookAgentContext`\n\n, `PluginHookBeforePromptBuildEvent`\n\n,\netc.) with `& Record<string, unknown>`\n\nintersections that preserve access\nto undocumented extra fields from older OpenClaw builds.\n\n`resolveCtx()`\n\nreplaces six ad-hoc field resolution functions with a\nsingle dual-source resolver: typed ctx fields preferred, legacy event\nextras as fallback.\n\nLegacy dedup: when both `before_prompt_build`\n\nand `before_agent_start`\n\nfire on the same turn without the `messages`\n\nfield (older OpenClaw),\ngeneration counters (`bpbGen`\n\n/`basGen`\n\nMaps) ensure only one of the pair\nincrements the turn counter. Generation-based tracking avoids the\nstale-flag problem a `Set`\n\napproach has when `before_agent_start`\n\nmisses\na turn.\n\n## Problem 3 — Mid-Session Extraction for Long-Lived Sessions\n\n**Change:** New `POST /api/hooks/session-checkpoint-extract`\n\nendpoint.\nThe OpenClaw adapter tracks turns per session; after 20 turns it\nfire-and-forgets a checkpoint extract without releasing the session claim.\n\nDelta tracking via `session_extract_cursors`\n\ntable (migration 049 in TS\ndaemon, 033 in Rust daemon). The cursor is advanced AFTER\n`enqueueSummaryJob`\n\nsucceeds so a crash causes redundant re-extraction\nrather than a silent data-loss window.\n\nRust daemon reads cursor and transcript, checks the delta threshold,\nenqueues a `checkpoint_extract`\n\nsummary job for the delta, then advances\nthe cursor. Summary job queueing and cursor advancement now match the TS\ndaemon contract: if enqueue fails, the cursor is not advanced and the\ndelta is retried on the next checkpoint attempt.\n\nFor file-backed checkpoint transcripts, the Rust daemon applies the same\nguardrail used by its session-end path: `transcriptPath`\n\nmust canonicalize\nunder `/tmp/signet`\n\n, point to a regular file, and fit within the transcript\nsize cap before the daemon reads it.\n\n## Delivered\n\nPR #369 (`ant/openclaw-hardening`\n\n).", "url": "https://wpnews.pro/news/openclaw-connector-hardening", "canonical_source": "https://signetai.sh/docs/specs/complete/openclaw-hardening/", "published_at": "2026-06-18 07:37:48+00:00", "updated_at": "2026-06-18 23:38:18.809058+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["OpenClaw", "Ant", "Discord"], "alternates": {"html": "https://wpnews.pro/news/openclaw-connector-hardening", "markdown": "https://wpnews.pro/news/openclaw-connector-hardening.md", "text": "https://wpnews.pro/news/openclaw-connector-hardening.txt", "jsonld": "https://wpnews.pro/news/openclaw-connector-hardening.jsonld"}}