Commit Graph

5 Commits

Author SHA1 Message Date
Ishaan Gupta 30642cc7ae feat: add organization switching 2026-08-24 12:34:13 +05:30
Dhravya Shah a4ecd312b1 Fail open with 3s network cap on all hooks; async capture; token count in recall banner (#108)
* feat: fail open with 3s network cap on all hooks; async capture; token count in recall banner

- All hook API calls hard-capped at 3s (was 15s default, 4s recall);
  every failure path continues the session with a visible error
- Stop/capture hook runs with "async": true — fire-and-forget save, so
  the user gets their prompt back immediately. Injection hooks stay
  sync (async hooks' output is discarded, which would kill recall
  injection and auto-approval); tightened their backstop timeouts
- Network failures now say "Supermemory unreachable" instead of raw
  fetch errors, and session-start no longer claims "no previous
  memories" when the fetch failed — only a 404 means empty
- Recall banner shows the injected context cost: "recalled 5 memories (32 tok)"

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfsBZgW6vDm8GEcy9ML3dT

* feat: statusline tally counts recalled memories in context, not recall events

Search state accumulates a cumulative memories counter (fresh injections
only); the resting tally shows "9 recalled" instead of "6 recalls".
Sessions with only MCP-tool searches (nothing hook-injected) keep the
event-count fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfsBZgW6vDm8GEcy9ML3dT

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 16:59:59 -06:00
Dhravya Shah 22b65a2fd8 feat: entity context asks for human-memorable memories, skips git-tracked state
Extraction was memorizing transient working-tree snapshots
("uncommitted changes to X, ready to be committed to PR #N") — state
git already tracks and no teammate would remember. The entity context
now leads with "try to remember things that a human would remember"
and explicitly skips uncommitted file lists, branch position, and
in-flight commit/push status.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 20:29:56 -07:00
Dhravya Shah 74d0ed0fe4 feat: recall on every substantive prompt, done by the hook itself
The recall directive was advisory — the model had to choose to spend a
tool call, so mid-session recall almost never happened. The
UserPromptSubmit hook now searches supermemory with the prompt itself
(4s timeout, skips short prompts and /, !, # inputs) and injects the
top matches directly, with a visible '◪ recalled N memories' notice
and statusline search state. A configured recallDirective restores
advisory mode.

Also fixes recall-approve missing the claude.ai connector namespace
(mcp__claude_ai_supermemory__*), which silently dropped the recall
notice and statusline count when the model did search.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 19:12:06 -07:00
Dhravya Shah e9f018c6b6 checkpoint: visibility fixes in src + new CLI-free hooks architecture (pre-restructure)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 17:19:14 -07:00