hotfix(v1.25.1): wire multi-turn hook + accept new telemetry kind#47
Merged
masonwyatt23 merged 3 commits intomainfrom Apr 29, 2026
Merged
hotfix(v1.25.1): wire multi-turn hook + accept new telemetry kind#47masonwyatt23 merged 3 commits intomainfrom
masonwyatt23 merged 3 commits intomainfrom
Conversation
The v1.25 multi-turn-stale tracker shipped non-functional: 1. `hooks/posttooluse-stale-result.ts` was added but never registered in `hooks/hooks.json`, so the hook never fired and stale-byte tracking accumulated nothing. Adds a PostToolUse entry matching Read/Grep tools (matches the TRACKED_TOOLS set inside the hook). 2. `server/src/routes/telemetry.ts` validates `kind` against a closed `KIND_VALUES` enum, so client-emitted Assisted-By: ashlr-plugin <https://plugin.ashlr.ai>"multi_turn_stale_estimate" events were silently rejected (Zod `z.enum`) before reaching the DB. Adds the new kind to the allowlist. Regression coverage: - `__tests__/hooks-json-registration.test.ts` — guardrail asserting that every critical hook script is referenced from hooks.json under the correct event + matcher. Catches the exact class of bug that hid this. - `server/tests/telemetry.test.ts` — new case asserting the server accepts and persists multi_turn_stale_estimate with the documented payload shape (sessionTurnCount, staleBytes, staleResults). 2690 plugin pass / 308 server pass / 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hosted Windows runners briefly hold file handles after a sqlite-spawning subprocess exits. The afterEach `rm(force:true)` was racing the OS handle release and yielding EBUSY, surfacing as 2 flaky failures in __tests__/sql-server.test.ts:170 and ~419 with no actual test problem. Wrap rm in a small Windows-only retry (8 attempts, ~50–400 ms backoff; caps total wait at ~750 ms before giving up). POSIX hosts still get a single attempt — no behavior change there. Local: 15 pass / 1 skip / 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…lakes bun:test's default 5000ms timeout is too tight on hosted Windows runners for tests that spawn child bun processes plus shell scripts (git init, 500/300-file creation). When the test exceeds 5s, afterEach also fails with EBUSY because the still-running subprocess holds tempdir handles. Bumps to 30s for: - ashlr-bash: recognized-command git status NOT re-summarized (sh + bun + 500 files) - ashlr-tree: large dir 300+ files (writeFile×300 + bun) - grep confidence: multiple genome sections (buildProject + bun) POSIX hosts well under 1s — no behavior change there. Local: 33 pass / 0 fail across the three files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
masonwyatt23
added a commit
that referenced
this pull request
Apr 29, 2026
…48) Bumps plugin version to 1.25.1 and documents the hotfix already merged to main in PR #47: - Multi-turn-stale hook now actually fires (was unregistered in 1.25.0) - Server /v1/events accepts multi_turn_stale_estimate (was rejected) - New regression test guards hooks.json registration going forward - Three Windows test flakes hardened (rm retry + per-test timeouts) - Phase 1 smoke realtime: 500 ms → 2000 ms visibility deadline on Windows Also gitignores server/*.db{,-wal,-shm} so local sqlite dev runs no longer leak into git status. Co-authored-by: Mason Wyatt <masonwyatt23@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
v1.25 shipped the multi-turn-stale tracker as dead code — two wiring gaps stopped the feature from doing anything in production:
hooks/posttooluse-stale-result.tswas never registered inhooks/hooks.json. The hook code was correct and tested, but Claude Code never invoked it, so:~/.ashlr/session-history/<sessionId>.jsonlwas never written/ashlr-compacthad nothing to readmulti_turn_stale_estimatetelemetry was never emittedThe server's
/v1/eventsroute silently rejected the new kind.server/src/routes/telemetry.tsusesz.enum(KIND_VALUES)andKIND_VALUESdid not include"multi_turn_stale_estimate", so even when (after fix Add SafeSkill security badge (55/100 — Use with Caution) #1) the client tries to emit the event, Zod returns 400 and the data never reachestelemetry_events.What changed
hooks/hooks.jsonRead|Grep|mcp__plugin_ashlr_ashlr__ashlr__read|mcp__plugin_ashlr_ashlr__ashlr__grep→hooks/posttooluse-stale-result.tsserver/src/routes/telemetry.ts"multi_turn_stale_estimate"toKIND_VALUES__tests__/hooks-json-registration.test.ts(new)server/tests/telemetry.test.tsStats
Test plan
fly deployserver → curl/v1/eventswithmulti_turn_stale_estimateevent → 200 + row intelemetry_eventsbun test __tests__/hooks-json-registration.test.ts→ 4 pass~/.ashlr/session-history/<sessionId>.jsonlpopulates and the 50KB nudge fires once🤖 Generated with Claude Code