mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-07-09 17:28:45 +00:00
parent
2170363af4
commit
c4281a7dd1
3 changed files with 46 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
||||||
- Fixed auto-retry for Bun fetch socket-drop errors reported as `socket connection was closed`, so transient provider disconnects do not end headless runs without retrying ([#6431](https://github.com/earendil-works/pi/issues/6431)).
|
- Fixed auto-retry for Bun fetch socket-drop errors reported as `socket connection was closed`, so transient provider disconnects do not end headless runs without retrying ([#6431](https://github.com/earendil-works/pi/issues/6431)).
|
||||||
- Fixed `models.json` `modelOverrides` to apply to extension-registered provider models ([#6367](https://github.com/earendil-works/pi/issues/6367)).
|
- Fixed `models.json` `modelOverrides` to apply to extension-registered provider models ([#6367](https://github.com/earendil-works/pi/issues/6367)).
|
||||||
- Fixed project context file discovery to use stable parent traversal on Windows so startup no longer hangs while loading AGENTS.md or CLAUDE.md ([#6369](https://github.com/earendil-works/pi/issues/6369)).
|
- Fixed project context file discovery to use stable parent traversal on Windows so startup no longer hangs while loading AGENTS.md or CLAUDE.md ([#6369](https://github.com/earendil-works/pi/issues/6369)).
|
||||||
|
- Fixed `--session-id` startup to warn when no existing project session has that id and pi creates a new session ([#6407](https://github.com/earendil-works/pi/issues/6407)).
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,11 @@ async function createSessionManager(
|
||||||
if (existingSession) {
|
if (existingSession) {
|
||||||
return SessionManager.open(existingSession.path, sessionDir);
|
return SessionManager.open(existingSession.path, sessionDir);
|
||||||
}
|
}
|
||||||
|
console.error(
|
||||||
|
chalk.yellow(
|
||||||
|
`Warning: No project session found with id '${parsed.sessionId}'; creating a new session with that id.`,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SessionManager.create(cwd, sessionDir, { id: parsed.sessionId });
|
return SessionManager.create(cwd, sessionDir, { id: parsed.sessionId });
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,46 @@ describe("--session-id read-only commands", () => {
|
||||||
expect(hasSessionWithId(join(result.agentDir, "sessions"), "read-only-models")).toBe(false);
|
expect(hasSessionWithId(join(result.agentDir, "sessions"), "read-only-models")).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("warns when a missing --session-id creates a new session", async () => {
|
||||||
|
const result = await runCli((dirs) => [
|
||||||
|
"--session-dir",
|
||||||
|
dirs.sessionDir,
|
||||||
|
"--session-id",
|
||||||
|
"missing-session-id",
|
||||||
|
"--model",
|
||||||
|
"missing-model",
|
||||||
|
"-p",
|
||||||
|
"hi",
|
||||||
|
]);
|
||||||
|
|
||||||
|
expect(result.code).toBe(1);
|
||||||
|
expect(result.stderr).toContain(
|
||||||
|
"Warning: No project session found with id 'missing-session-id'; creating a new session with that id.",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("does not warn when --session-id opens an existing session", async () => {
|
||||||
|
const result = await runCli(
|
||||||
|
(dirs) => [
|
||||||
|
"--session-dir",
|
||||||
|
dirs.sessionDir,
|
||||||
|
"--session-id",
|
||||||
|
"existing-session-id",
|
||||||
|
"--model",
|
||||||
|
"missing-model",
|
||||||
|
"-p",
|
||||||
|
"hi",
|
||||||
|
],
|
||||||
|
(dirs) => {
|
||||||
|
mkdirSync(dirs.sessionDir, { recursive: true });
|
||||||
|
writeSession(dirs.sessionDir, dirs.projectDir, "existing-session-id");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(result.code).toBe(1);
|
||||||
|
expect(result.stderr).not.toContain("No project session found with id 'existing-session-id'");
|
||||||
|
});
|
||||||
|
|
||||||
it("rejects an existing fork target session id", async () => {
|
it("rejects an existing fork target session id", async () => {
|
||||||
const result = await runCli(
|
const result = await runCli(
|
||||||
(dirs) => ["--session-dir", dirs.sessionDir, "--fork", "source-id", "--session-id", "existing-id", "-p", "hi"],
|
(dirs) => ["--session-dir", dirs.sessionDir, "--fork", "source-id", "--session-id", "existing-id", "-p", "hi"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue