pi-usereq 0.43.0 → 0.45.0

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.
@@ -3633,7 +3633,7 @@ test("worktree-enabled prompt commands honor overridden worktree prefixes", asyn
3633
3633
  }
3634
3634
  });
3635
3635
 
3636
- test("worktree-backed prompt failures skip merge, restore base-path, and retain worktree", async () => {
3636
+ test("worktree-backed prompt failures keep the worktree session, retain worktree, and park in error", async () => {
3637
3637
  const { projectBase } = initFixtureRepo({ fixtures: [] });
3638
3638
  const previousCwd = process.cwd();
3639
3639
  try {
@@ -3658,8 +3658,11 @@ test("worktree-backed prompt failures skip merge, restore base-path, and retain
3658
3658
  messages: [{ role: "assistant", stopReason: "error", content: [] }],
3659
3659
  }, ctx);
3660
3660
 
3661
- assert.equal(process.cwd(), projectBase);
3662
- assert.equal(ctx.cwd, projectBase);
3661
+ // The original base-path session MUST NOT be resumed on failure; the
3662
+ // client stays on the worktree execution session so the failure stays
3663
+ // visible until req-reset restores base-path and removes the worktree.
3664
+ assert.equal(process.cwd(), executionBasePath);
3665
+ assert.equal(ctx.cwd, executionBasePath);
3663
3666
  assert.equal(fs.existsSync(executionBasePath), true);
3664
3667
  assert.equal(fs.existsSync(path.join(projectBase, "src", "failed.ts")), false);
3665
3668
  assert.equal(
@@ -3674,8 +3677,8 @@ test("worktree-backed prompt failures skip merge, restore base-path, and retain
3674
3677
  assert.equal(
3675
3678
  ctx.__state.statuses.get("pi-usereq"),
3676
3679
  buildExpectedFakeStatusText({
3677
- workflowState: "idle",
3678
- basePath: buildExpectedFakeBasePath(projectBase),
3680
+ workflowState: "error",
3681
+ basePath: buildExpectedFakeBasePath(executionBasePath),
3679
3682
  docsDir: DEFAULT_DOCS_DIR,
3680
3683
  testsDir: "tests",
3681
3684
  srcDir: ["src"],
@@ -6689,10 +6692,17 @@ test("configuration menu omits removed static-check raw-spec and reference actio
6689
6692
  const renderedStaticCheckMenu = (ctx.__state.customRenderLines[1] ?? []).join("\n");
6690
6693
  const staticCheckItems = ctx.__state.selectCalls[1]?.items ?? [];
6691
6694
  assert.match(renderedStaticCheckMenu, /Add static code checker/);
6695
+ assert.match(renderedStaticCheckMenu, /View static code checker/);
6692
6696
  assert.match(renderedStaticCheckMenu, /Remove static code checker/);
6693
- assert.deepEqual(staticCheckItems.slice(0, 2), ["Add static code checker", "Remove static code checker"]);
6697
+ assert.match(renderedStaticCheckMenu, /Reset static code checker/);
6698
+ assert.deepEqual(staticCheckItems.slice(0, 4), [
6699
+ "Add static code checker",
6700
+ "View static code checker",
6701
+ "Remove static code checker",
6702
+ "Reset static code checker",
6703
+ ]);
6694
6704
  assert.deepEqual(
6695
- staticCheckItems.slice(2, 22),
6705
+ staticCheckItems.slice(4, 24),
6696
6706
  getSupportedStaticCheckLanguageSupport().map((entry) => entry.language),
6697
6707
  );
6698
6708
  assert.deepEqual(staticCheckItems.slice(-1), ["Reset defaults"]);