probe-research 0.34.0 → 0.35.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.
@@ -747,6 +747,8 @@ const WAIT_RESERVE_MS = 20 * 1000;
747
747
  * answer `waiting_for_approval` though the person approved, so the agent runs it again instead.
748
748
  */
749
749
  const APPROVED_RESERVE_MS = 30 * 1000;
750
+ /** Kept from `sign-in --wait`'s budget for its one approval read after a stop (the read's own 3 s timeout + 1 s). */
751
+ const APPROVAL_READ_RESERVE_MS = 4 * 1000;
750
752
  /** How often a running download is looked at again. */
751
753
  const DOWNLOAD_POLL_MS = 1000;
752
754
  /** The uninstall barrier (`probe.shared.updates.uninstall_barrier.path`). */
@@ -834,13 +836,17 @@ function sleep(ms) {
834
836
 
835
837
  /** Run an agent's call (`step`) under the backstop; a call it had to stop answers `run_again` (75). */
836
838
  async function runAgentCall(cmd, cmdArgs, startedMs, step, watch = null) {
837
- const ran = await agentRun.runWithBackstop(cmd, cmdArgs, { deadlineMs: startedMs + agentRun.AGENT_BUDGET_MS });
839
+ // `sign-in --wait` keeps APPROVAL_READ_RESERVE_MS of the budget for the approval read below (#4602 review).
840
+ const deadlineMs = startedMs + agentRun.AGENT_BUDGET_MS - (watch ? APPROVAL_READ_RESERVE_MS : 0);
841
+ const ran = await agentRun.runWithBackstop(cmd, cmdArgs, { deadlineMs });
838
842
  if (ran.stopped) {
839
843
  // `sign-in --wait`'s (fixes-1108): a call stopped unsaved still says whether the person approved, read once
840
- // after the CLI is gone, so the agent never says "still waiting" to someone who approved.
841
- if (watch) await watch.update();
844
+ // after the CLI is gone, so the agent never says "still waiting" to someone who approved. Only while the
845
+ // sign-in still waits: a CLI stopped mid-save already took it, and the server still answers "approved".
846
+ const isWaiting = Boolean(watch && signIn.loadPending());
847
+ if (isWaiting) await watch.update();
842
848
  await refuseAgent(step, agentRun.Reason.RUN_AGAIN, "Stopped at the agent's time limit: run the same command again.",
843
- agentRun.EXIT_AGAIN, watch ? watch.getFacts() : {});
849
+ agentRun.EXIT_AGAIN, isWaiting ? watch.getFacts() : {});
844
850
  }
845
851
  if (ran.error) await refuseAgent(step, agentRun.Reason.INCOMPLETE, `could not run ${cmd}: ${ran.error}`, 1);
846
852
  if (SHIM_REASONS[ran.code]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "probe-research",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Setup wizard for Probe Research in your coding agents. Runs from zero with npx.",
5
5
  "bin": {
6
6
  "probe-research": "bin/probe-research.js"