feat(backend): spawnFor new/resume prompt mode; resume sends /riprendi-sessione

This commit is contained in:
2026-06-29 12:38:26 +02:00
parent 387ae56583
commit 790ac71284
2 changed files with 36 additions and 2 deletions
+6 -2
View File
@@ -47,7 +47,7 @@ export class PiProcessManager {
async spawnFor(
sessionId: string,
o: { provider?: string; model?: string; thinking?: string; author?: string },
o: { provider?: string; model?: string; thinking?: string; author?: string; mode?: "new" | "resume" },
): Promise<SessionRuntime> {
// Idempotent per session id: tear down any existing runtime for this id
// first (before the cap check) so a resume/respawn neither leaks the old
@@ -80,7 +80,10 @@ export class PiProcessManager {
await rpc.request({ type: "set_thinking_level", level: thinking } as object & { type: string });
}
rpc.send({ type: "prompt", message: `/nuova-domanda "kickoff"` });
const message = o.mode === "resume"
? `/riprendi-sessione ${sessionId}`
: `/nuova-domanda "kickoff"`;
rpc.send({ type: "prompt", message });
return rt;
}
@@ -90,6 +93,7 @@ export class PiProcessManager {
provider: manifest?.provider,
model: manifest?.model,
thinking: manifest?.thinking,
mode: "resume",
});
}