@tekmidian/pai 0.36.1 → 0.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
import { readFileSync, existsSync, unlinkSync } from 'fs';
|
|
20
20
|
import { join } from 'path';
|
|
21
21
|
import { tmpdir } from 'os';
|
|
22
|
+
import { resetHandoverTriggerState } from '../../../session/context-handover-trigger.js';
|
|
22
23
|
|
|
23
24
|
interface HookInput {
|
|
24
25
|
session_id: string;
|
|
@@ -53,6 +54,16 @@ async function main() {
|
|
|
53
54
|
process.exit(0);
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
// This hook fires exactly once per compaction for this session — the
|
|
58
|
+
// right moment to reset the handover-trigger marker (confirmed/pending
|
|
59
|
+
// thresholds) so the NEXT context-fill cycle gets its own handover
|
|
60
|
+
// instead of being judged "already done" forever. Unconditional: it must
|
|
61
|
+
// run even when no compact-state digest file was found below, since a
|
|
62
|
+
// compaction still happened. Never touches the separate handover CACHE
|
|
63
|
+
// file — that is what gets injected below and must survive this call.
|
|
64
|
+
// See resetHandoverTriggerState() for the full rationale.
|
|
65
|
+
resetHandoverTriggerState(hookInput.session_id);
|
|
66
|
+
|
|
56
67
|
// Look for the state file saved by context-compression-hook during PreCompact
|
|
57
68
|
const stateFile = join(tmpdir(), `pai-compact-state-${hookInput.session_id}.txt`);
|
|
58
69
|
|