Skip to content

refactor(recall): remove auto-recall PostToolUse hook in favor of teamai-recall subagent - #106

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
hsuchifeng:refactor/remove-auto-recall
Jul 2, 2026
Merged

refactor(recall): remove auto-recall PostToolUse hook in favor of teamai-recall subagent#106
jeff-r2026 merged 2 commits into
Tencent:mainfrom
hsuchifeng:refactor/remove-auto-recall

Conversation

@hsuchifeng

Copy link
Copy Markdown
Contributor

Summary

  • Removes the auto-recall PostToolUse hook that silently fired on every Bash/Grep/WebSearch/WebFetch tool call to search the team knowledge base. In practice it was noisy and low-hit-rate, and is now superseded by the teamai-recall subagent (proactive, codebase-graph aware, structured summary output) plus the manual teamai recall command.
  • Installed machines self-clean the stale hook entries on the next teamai pull / hooks inject via the existing reconcile engine — no manual migration needed.
  • contribute-check's Phase 2 knowledge-gap detection depended on auto-recall's quality cache (~/.teamai/sessions/<sid>-recall-cache.json). That cache is now written by teamai recall itself (extracted into a standalone src/recall-quality.ts module), so the feature keeps working with an equivalent-but-more-accurate data source — both manual recall and the subagent's underlying teamai recall call now populate it.
  • TEAMAI_RECALL_DISABLED=1 now gates teamai recall's quality tracking instead of the removed hook.

Test plan

  • npx tsc --noEmit
  • npm run build (tsup)
  • npx vitest run — 1569 passed, 3 pre-existing failures in import-repo-merge.test.ts unrelated to this change (present on main before this branch)
  • Added src/__tests__/recall-quality.test.ts covering recordRecallQuality/readRecallQuality
  • Added quality-tracking coverage in recall-scope-isolation.test.ts (hit + miss cases)
  • Updated golden hook fixtures (claude/claude-internal/codebuddy/cursor) and all hook-count assertions across hooks*.test.ts
  • contribute-check-phase2.test.ts passes unchanged (cache format untouched)

Made with Cursor

jeff-r2026 and others added 2 commits July 2, 2026 11:56
…amai-recall subagent

auto-recall silently fired on every Bash/Grep/WebSearch/WebFetch tool call to
search team knowledge, but was noisy and low-hit-rate in practice, and its job
is now done better by the teamai-recall subagent (proactive, codebase-graph
aware, structured output). Installed machines self-clean the old hook entries
on the next `teamai pull` / `hooks inject` via the existing reconcile engine.

contribute-check's knowledge-gap detection (Phase 2) depended on auto-recall's
quality cache, so `teamai recall` now records recall quality itself (moved
into a standalone recall-quality.ts module) — the feature keeps working, just
with a new, more accurate data source (manual recall + the recall subagent's
underlying command, instead of a passive hook).

Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase onto main picked up the new Codex hooks injection tests
(Tencent#103), which still hardcoded 7 PostToolUse builtin hooks. Update
the expectation to 3 to match the auto-recall removal in this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hsuchifeng
hsuchifeng force-pushed the refactor/remove-auto-recall branch from 68ff78b to 4acb5ed Compare July 2, 2026 03:59
@jeff-r2026
jeff-r2026 merged commit cde6632 into Tencent:main Jul 2, 2026
7 checks passed
jeff-r2026 added a commit to jeff-r2026/teamai-cli that referenced this pull request Jul 2, 2026
The passive auto-recall PostToolUse hook was removed in Tencent#106, replaced
by the proactive teamai-recall subagent + builtin-rules approach.
Update the design doc to reflect this decision.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jeff-r2026 added a commit that referenced this pull request Jul 3, 2026
The passive auto-recall PostToolUse hook was removed in #106, replaced
by the proactive teamai-recall subagent + builtin-rules approach.
Update the design doc to reflect this decision.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@hsuchifeng hsuchifeng mentioned this pull request Jul 3, 2026
3 tasks
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