Skip to content

Fix: Update plugin to be compatible with post 2026.3.28 version#38

Closed
Arrosam wants to merge 12 commits intoadoresever:mainfrom
Arrosam:claude/update-openclaw-compatibility-dlBHr
Closed

Fix: Update plugin to be compatible with post 2026.3.28 version#38
Arrosam wants to merge 12 commits intoadoresever:mainfrom
Arrosam:claude/update-openclaw-compatibility-dlBHr

Conversation

@Arrosam
Copy link
Copy Markdown
Contributor

@Arrosam Arrosam commented Apr 1, 2026

Code reviewed and tested. Stably working with latest 2026.3.31 version.

claude and others added 12 commits March 31, 2026 20:45
OpenClaw 2026.03.28 passes a `prompt` field to `assemble()` for
prompt-aware retrieval. This update adds the field to the method
signature and uses it to perform a fresh, accurate recall at assembly
time — falling back to the pre-cached result from `before_agent_start`
when the field is absent (older OpenClaw versions).

Bump version to 1.6.0.

https://claude.ai/code/session_01VeZ6kyGGpBYn5H7tTtToLx
…ty-dlBHr

Claude/update openclaw compatibility dl b hr
Security scanner (2026.03.28 fails-closed by default):
- embed.ts: remove process.env.GM_DEBUG access inside network-calling
  function; drop the conditional debug log in the probe catch block
- llm.ts: remove process.env.ANTHROPIC_API_KEY from inside the fetch
  function; add anthropicApiKey parameter instead
- index.ts: read ANTHROPIC_API_KEY at plugin registration time and pass
  it through to createCompleteFn so env access and network send are
  never co-located in the same file

Hook pack validation:
- package.json: add "hooks": {} to the "openclaw" manifest field so the
  validator does not reject the package as a malformed hook pack

https://claude.ai/code/session_01VeZ6kyGGpBYn5H7tTtToLx
Previously, assemble() only updated recalled[] when freshRec had nodes,
leaving old cache entries in place when the current prompt had no graph
matches. This caused stale nodes from a prior turn to bleed into the
assembled context.

Always overwrite the session cache with the fresh recall result,
regardless of whether it is empty. The catch path is unchanged — a
network/DB error still falls through to the cached value.

https://claude.ai/code/session_01VeZ6kyGGpBYn5H7tTtToLx
The previous fix removed process.env.GM_DEBUG but also silently
dropped the error. Log it unconditionally via console.error so
embedding failures are always visible.

https://claude.ai/code/session_01VeZ6kyGGpBYn5H7tTtToLx
Three bugs caused garbled agent responses after LLM API failures:

1. llm.ts Path B (Anthropic) returned "" on empty content instead of
   throwing, unlike Path A. This masked API errors and let the caller
   treat the empty response as a successful extraction.

2. extract.ts parseExtract() caught JSON parse failures and returned
   { nodes: [], edges: [] } — indistinguishable from "nothing to
   extract." Callers then called markExtracted(), permanently marking
   messages as processed even though nothing was extracted. Knowledge
   was silently and irreversibly lost.

3. index.ts afterTurn() re-ingested messages already stored by
   ingest(), creating duplicates in gm_messages. Duplicate messages
   in the extraction prompt confused the LLM.

Fixes:
- Path B now throws on empty content, matching Path A
- parseExtract re-throws parse errors so runTurnExtract and compact
  skip markExtracted on failure (messages retry next turn)
- afterTurn no longer re-ingests messages

https://claude.ai/code/session_01VeZ6kyGGpBYn5H7tTtToLx
adoresever pushed a commit that referenced this pull request Apr 4, 2026
Co-authored-by: Arrosam <arrosam@users.noreply.github.com>
@adoresever
Copy link
Copy Markdown
Owner

Merged via CLI to dev, verified and pushed to main. Fixed a minor TS error (key → anthropicApiKey in llm.ts). Thanks for the contribution!欢迎来讨论群交流:adoresever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants