Open
Conversation
… 0.6.10 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… rename to hivemind
Track which agent (claude_code, codex, openclaw) generated each event. The column is included in CREATE TABLE schema for both memory and sessions tables, and populated in all INSERT statements.
- Use same sessions table schema as CC (id, path, filename, message JSONB, author, size_bytes, project, description, agent, creation_date, last_update_date) - Use buildSessionPath() with same convention as CC - Set agent='openclaw' on all captured events - Fix SQL quoting (wrap sqlStr() in single quotes) - Delete credentials.ts and memory.ts (replaced by shared src/) - Add child_process stub in esbuild for OpenClaw build - Rebuild CC bundles with agent column
…ommand # Conflicts: # CLAUDE.md # claude-code/.claude-plugin/plugin.json # esbuild.config.mjs
Add /hivemind_login step and explain auto-recall/capture behavior. Note shared sessions table across all platforms.
|
Claude finished @kaghni's task in 1m 44s —— View job Left 2 inline comments on
|
openclaw/src/index.ts
Outdated
| const results = allResults.slice(0, 5); | ||
| // Search sessions table — cast JSONB message to text for keyword search | ||
| const results = await dl.query( | ||
| `SELECT path, message FROM "${sessionsTable}" WHERE message::text ILIKE '%${sqlStr(words[0])}%' ORDER BY creation_date DESC LIMIT 5` |
There was a problem hiding this comment.
sqlStr doesn't escape % and _ LIKE metacharacters — a user prompt containing % matches every row in the sessions table, leaking all stored memories into the AI context. Use sqlLike instead (also import it alongside sqlStr).
Suggested change
| `SELECT path, message FROM "${sessionsTable}" WHERE message::text ILIKE '%${sqlStr(words[0])}%' ORDER BY creation_date DESC LIMIT 5` | |
| `SELECT path, message FROM "${sessionsTable}" WHERE message::text ILIKE '%${sqlLike(words[0])}%' ORDER BY creation_date DESC LIMIT 5` |
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.
Summary
Version Bump
Test plan
npm test)package.json, or no release needed for this change