feat(backend): spawnFor new/resume prompt mode; resume sends /riprendi-sessione
This commit is contained in:
@@ -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",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user