Skip to content

fix(hooks): V3 MCP hook handlers now persist data (upstream #1059)#10

Merged
blackms merged 1 commit intomainfrom
codex/recreate-pr-1059-hooks-persistence
Feb 6, 2026
Merged

fix(hooks): V3 MCP hook handlers now persist data (upstream #1059)#10
blackms merged 1 commit intomainfrom
codex/recreate-pr-1059-hooks-persistence

Conversation

@blackms
Copy link
Owner

@blackms blackms commented Feb 6, 2026

Replica upstream

Questa PR ricrea nel fork la fix upstream:

Contenuto

  • I post-hook MCP (hooksPostEdit, hooksPostTask, hooksPostCommand) passano da stub a persistenza reale su DB
  • Persistenza con namespace dedicati (patterns, trajectories, commands)
  • Correzione metriche status hooks verso conteggi reali

Metodo

Cherry-pick del commit upstream 2e32f852c1dd057b3a190f550a1c82d7db7541a3 (con -x).

BREAKING FIX: hooksPostEdit, hooksPostTask, and hooksPostCommand were
returning success without actually storing any data. This fix makes
them call getRealStoreFunction() to persist to the memory database.

Changes:
- hooksPostEdit: Now stores to 'patterns' namespace with HNSW indexing
- hooksPostTask: Now stores to 'trajectories' namespace with HNSW indexing
- hooksPostCommand: Now stores to 'commands' namespace with HNSW indexing
- getLearningStats: Now queries real SELECT COUNT(*) instead of file_size/2KB

Before:
- handlers returned {recorded: true} without database INSERT
- hooksPostTask returned Math.random() for duration (fake data)
- statusline showed file_size/2KB as "patterns" count (misleading)

After:
- handlers call storeEntry() with generateEmbeddingFlag: true
- real pattern IDs returned from database
- statusline queries actual table row counts

Verified:
- ✅ post-edit: PERSISTED - "Pattern stored with HNSW indexing"
- ✅ post-task: PERSISTED - "Trajectory stored with HNSW indexing"
- ✅ post-command: PERSISTED - "Command pattern stored with HNSW indexing"

Closes ruvnet#1058

(cherry picked from commit 2e32f85)
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@blackms has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/recreate-pr-1059-hooks-persistence

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔗 Integration Test Results

🔗 Cross-Agent Integration Test Report

Session ID: integration-20260206-224337-1fbfd175edb84914abb513907a3b3481e0a0d7aa
Timestamp: 2026-02-06T22:49:57.465Z
Overall Status: ✅ PASSED

Summary

  • Total Tests: 4
  • Passed: 4
  • Failed: 0
  • Success Rate: 100.0%

Test Results

Component Status Details
Agent Coordination Multi-agent communication and task distribution
Memory Integration Shared memory operations and synchronization
Fault Tolerance Failure recovery and system resilience
Performance Multi-agent performance and scalability

Recommendations

  • All integration tests passed successfully!

Next Steps

  1. Review detailed test artifacts
  2. Address any failed test scenarios
  3. Monitor integration performance in production

Generated by Cross-Agent Integration Test Pipeline

@blackms blackms merged commit a93daaa into main Feb 6, 2026
34 of 37 checks passed
@blackms blackms deleted the codex/recreate-pr-1059-hooks-persistence branch February 6, 2026 23:07
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.

2 participants