Skip to content

fix: improve openclaw test coverage#396

Merged
nicoloboschi merged 2 commits intomainfrom
openclaw
Feb 18, 2026
Merged

fix: improve openclaw test coverage#396
nicoloboschi merged 2 commits intomainfrom
openclaw

Conversation

@nicoloboschi
Copy link
Collaborator

No description provided.

…k integration tests

- Extract stripMemoryTags and extractRecallQuery as exported pure functions
  from index.ts so hooks share one implementation and tests cover the real code
- Update before_agent_start to call extractRecallQuery; update agent_end to
  call stripMemoryTags instead of duplicating the regex inline
- Rewrite index.test.ts to import the real functions (no more local duplicate)
  and add 11 tests for extractRecallQuery covering all envelope-stripping cases
- Add tests/hooks.integration.test.ts: loads the plugin via mock MoltbotPluginAPI
  in HTTP mode, spies on client.recall/retain, and exercises all hook behaviours:
  excluded providers, short messages, memory injection format, tag stripping,
  transcript formatting, array content blocks, metadata, document_id derivation
@nicoloboschi nicoloboschi merged commit 6c695eb into main Feb 18, 2026
25 of 30 checks passed
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.

1 participant