@testchimp/cli 0.1.71 → 0.1.72

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.
@@ -1632,10 +1632,8 @@ async function ackWorktreeFileWrite(backend, apiKey, sessionId, requestId, ok, e
1632
1632
  });
1633
1633
  }
1634
1634
  async function applyUserFileEdit(backend, apiKey, sessionId, edit, turnActive) {
1635
- if (turnActive()) {
1636
- await ackWorktreeFileWrite(backend, apiKey, sessionId, edit.requestId, false, "agent turn in progress");
1637
- return;
1638
- }
1635
+ // Never hard-nack mid-turn: write to disk immediately so the next agent prompt
1636
+ // sees the edit. Defer commit/push while a turn is active — post-turn always commits.
1639
1637
  try {
1640
1638
  const relative = normalizeWorktreeRelativePath(edit.path);
1641
1639
  const root = process.cwd();
@@ -1646,6 +1644,11 @@ async function applyUserFileEdit(backend, apiKey, sessionId, edit, turnActive) {
1646
1644
  }
1647
1645
  await fs.mkdir(path.dirname(full), { recursive: true });
1648
1646
  await fs.writeFile(full, edit.content, "utf8");
1647
+ if (turnActive()) {
1648
+ console.error(`ChimpHands applied user_file_edit mid-turn (deferred commit): ${relative}`);
1649
+ await ackWorktreeFileWrite(backend, apiKey, sessionId, edit.requestId, true);
1650
+ return;
1651
+ }
1649
1652
  const pushed = await commitAndPushDirtyWorktree("User Update");
1650
1653
  if (!pushed.ok) {
1651
1654
  await ackWorktreeFileWrite(backend, apiKey, sessionId, edit.requestId, false, pushed.error || "commit/push failed");
@@ -2402,11 +2405,9 @@ export async function runChimphands(opts) {
2402
2405
  console.error(`ChimpHands turn-end reconcile failed: ${err instanceof Error ? err.message : String(err)}`);
2403
2406
  }
2404
2407
  }
2405
- // Async / no UI: checkpoint dirty worktree after each turn so PR + Files changed
2406
- // are reviewable when the user opens the session later (live VCS tunnel may be idle).
2407
- if (!poster.uiAttached) {
2408
- await commitAndPushDirtyWorktree("chimphands: commit after turn (async / no UI attached)");
2409
- }
2408
+ // Always checkpoint dirty worktree after each turn so PR + Files pane
2409
+ // (GitHub compare) stay current whether or not a browser UI is attached.
2410
+ await commitAndPushDirtyWorktree("chimphands: commit after turn");
2410
2411
  if (attachUrl && opencodeSessionId && midTurnInjectedById.size) {
2411
2412
  try {
2412
2413
  await releaseUnansweredMidTurnMessages(attachUrl, opencodeSessionId, midTurnInjectedById, queue, wakePromptWaiter, midTurnSidecarAnswered);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "description": "TestChimp CLI and MCP server — coverage, plans, EaaS, TrueCoverage, API operations (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",