Fix: Update plugin to be compatible with post 2026.3.28 version#38
Closed
Arrosam wants to merge 12 commits intoadoresever:mainfrom
Closed
Fix: Update plugin to be compatible with post 2026.3.28 version#38Arrosam wants to merge 12 commits intoadoresever:mainfrom
Arrosam wants to merge 12 commits intoadoresever:mainfrom
Conversation
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
Use anthropicApiKey directly instead of aliasing it to key. 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>
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code reviewed and tested. Stably working with latest 2026.3.31 version.