Phase 10: rescan branch for tracked skills when state entry missing — SPEC §6.3.
Walk user messages and read tool calls on session_start to rebuild tracked skills from history when no skill-reinject:state entry exists on the branch. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-2
@@ -22,6 +22,7 @@ import {
|
||||
tryConsumeDeferredReinject,
|
||||
} from "./reinject.js";
|
||||
import { readSettings } from "./settings.js";
|
||||
import { rescanSkillsFromBranch } from "./rescan.js";
|
||||
import { findRegisteredSkillByName, resolveRegisteredSkills } from "./skills-registry.js";
|
||||
import {
|
||||
applyExtensionState,
|
||||
@@ -99,9 +100,13 @@ export default function skillReinject(pi: ExtensionAPI): void {
|
||||
|
||||
pi.on("session_start", async (_event, ctx) => {
|
||||
detectAndCachePiAutoCompact(pi, runtime);
|
||||
readSettings(ctx);
|
||||
const loaded = loadStateFromBranch(ctx.sessionManager.getBranch());
|
||||
const settings = readSettings(ctx);
|
||||
const branch = ctx.sessionManager.getBranch();
|
||||
const loaded = loadStateFromBranch(branch);
|
||||
applyExtensionState(state, loaded ?? createInitialState());
|
||||
if (!loaded) {
|
||||
rescanSkillsFromBranch(state, branch, ctx.cwd, registeredSkills, settings.trackReadPaths);
|
||||
}
|
||||
});
|
||||
|
||||
pi.on("session_before_compact", async () => {
|
||||
|
||||
Reference in New Issue
Block a user