Commit a943e53
fix(v0.6.2): async classifier — kill the fork-bomb
ingest-hook ran the classifier (nested `claude -p`) synchronously,
blocking each Claude Code hook 5-30s. PostToolUse fired faster than
the classifier finished, so ingest-hook procs piled up. The nested
claude also loaded every installed plugin, including task-journal
itself, spawning extra task-journal-mcp servers per call. After a
few minutes WSL2 died on `EAGAIN: pthread_create`.
Fix:
- Real-classifier ingest-hook now writes an enriched pending entry
(schema v2: kind/text/project_hash/events_path/backend) and spawns
a detached `task-journal classify-worker` child. Hook returns
<100ms instead of 5-30s. Mock path stays sync (tests rely on it);
TJ_INGEST_SYNC=1 forces sync mode for the real path too.
- Hidden `classify-worker` subcommand drains v2 pending entries.
Holds project-scoped file lock at
`state_dir/classifier-<project_hash>.lock` — at most one worker
per project. Stale locks (dead PID via `kill(pid, 0)`) are
reclaimed automatically.
- Bare `claude` invocations now get `--strict-mcp-config --mcp-config
'{"mcpServers":{}}'` injected. Inner haiku-claude no longer spawns
task-journal-mcp (or any other MCP server) per classification.
Wrappers like `aimux run dt` are detected via non-empty base args
and left untouched. `--bare` not used because it breaks
subscription auth (claude-memory-0kk); `--no-plugins` does not
exist in claude 2.1.x.
Tests: 259 passed, 0 failed. Three new tests cover async hook speed,
worker behavior on classifier failure, and lockfile contention.
Closes claude-memory-9ty.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 1d74549 commit a943e53
11 files changed
Lines changed: 663 additions & 11 deletions
File tree
- .claude-plugin
- crates
- tj-cli
- src
- tests
- tj-core/src/classifier
- tj-mcp
- plugin
- .claude-plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
10 | 50 | | |
11 | 51 | | |
12 | 52 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
0 commit comments