@pushpalsdev/cli 1.1.40 → 1.1.41
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.
package/package.json
CHANGED
|
@@ -119,6 +119,7 @@ _DEFAULT_NO_EDIT_RECHECK_S = 120
|
|
|
119
119
|
_NO_EDIT_RECOVERY_RECHECK_S = 30
|
|
120
120
|
_DEFAULT_NO_EDIT_COMMAND_GRACE_S = 240
|
|
121
121
|
_DEFAULT_NO_EDIT_COMMAND_PROGRESS_CAP_S = 360
|
|
122
|
+
_BACKGROUND_NO_EDIT_COMMAND_PROGRESS_CAP_S = 120
|
|
122
123
|
_NO_EDIT_RECOVERY_COMMAND_PROGRESS_CAP_S = 120
|
|
123
124
|
_DEFAULT_STARTUP_STALL_WATCHDOG_S = 210
|
|
124
125
|
_RECOVERY_STARTUP_STALL_WATCHDOG_S = 150
|
|
@@ -817,6 +818,7 @@ def _resolve_no_edit_command_progress_cap_seconds(
|
|
|
817
818
|
communicate_timeout_s: Optional[int],
|
|
818
819
|
no_edit_command_grace_s: Optional[int],
|
|
819
820
|
recovery_attempt: int = 0,
|
|
821
|
+
prompt: str = "",
|
|
820
822
|
) -> Optional[int]:
|
|
821
823
|
if not communicate_timeout_s or no_edit_command_grace_s is None:
|
|
822
824
|
return None
|
|
@@ -834,11 +836,12 @@ def _resolve_no_edit_command_progress_cap_seconds(
|
|
|
834
836
|
else:
|
|
835
837
|
return max(1, min(parsed, max(1, communicate_timeout_s - 1)))
|
|
836
838
|
|
|
837
|
-
|
|
838
|
-
_NO_EDIT_RECOVERY_COMMAND_PROGRESS_CAP_S
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
839
|
+
if recovery_attempt > 0:
|
|
840
|
+
default_s = _NO_EDIT_RECOVERY_COMMAND_PROGRESS_CAP_S
|
|
841
|
+
elif _looks_like_background_autonomy_prompt(prompt):
|
|
842
|
+
default_s = _BACKGROUND_NO_EDIT_COMMAND_PROGRESS_CAP_S
|
|
843
|
+
else:
|
|
844
|
+
default_s = _DEFAULT_NO_EDIT_COMMAND_PROGRESS_CAP_S
|
|
842
845
|
upper = max(1, communicate_timeout_s - 1)
|
|
843
846
|
return max(1, min(default_s, upper))
|
|
844
847
|
|
|
@@ -2713,6 +2716,7 @@ def _run_codex_task(
|
|
|
2713
2716
|
communicate_timeout_s,
|
|
2714
2717
|
no_edit_command_grace_s,
|
|
2715
2718
|
recovery_attempt=recovery_depth,
|
|
2719
|
+
prompt=prompt,
|
|
2716
2720
|
)
|
|
2717
2721
|
startup_stall_watchdog_s = _resolve_startup_stall_watchdog_seconds(
|
|
2718
2722
|
communicate_timeout_s,
|
|
@@ -45,6 +45,7 @@ from openai_codex_executor import (
|
|
|
45
45
|
_has_credible_shell_wrapper_progress,
|
|
46
46
|
_load_prompt_template,
|
|
47
47
|
_mask_repo_local_codex_files,
|
|
48
|
+
_minimum_recovery_attempt_seconds,
|
|
48
49
|
_repo_root_for_prompt_loading,
|
|
49
50
|
_restore_repo_local_codex_files,
|
|
50
51
|
_resolve_codex_command_prefix,
|
|
@@ -249,6 +250,41 @@ class OpenAICodexRuntimeConfigTests(unittest.TestCase):
|
|
|
249
250
|
)
|
|
250
251
|
self.assertEqual(_resolve_rollout_watchdog_seconds(prompt, 1200, no_edit), 90)
|
|
251
252
|
|
|
253
|
+
def test_background_autonomy_caps_patchless_command_progress_before_recovery_reserve(self) -> None:
|
|
254
|
+
prompt = (
|
|
255
|
+
"Task planning contract from PushPals:\n"
|
|
256
|
+
"- Planning summary: intent=code_change, risk=low, priority=background\n"
|
|
257
|
+
"- Origin=autonomy targetPaths=[app/__tests__/opportunity-graph.contract.test.ts]\n"
|
|
258
|
+
"Add focused contract coverage without broad discovery.\n"
|
|
259
|
+
)
|
|
260
|
+
child_budget_s = 570
|
|
261
|
+
|
|
262
|
+
with mock.patch.dict(
|
|
263
|
+
os.environ,
|
|
264
|
+
{
|
|
265
|
+
"WORKERPALS_OPENAI_CODEX_NO_EDIT_COMMAND_GRACE_S": "",
|
|
266
|
+
"WORKERPALS_OPENAI_CODEX_NO_EDIT_COMMAND_PROGRESS_CAP_S": "",
|
|
267
|
+
"WORKERPALS_OPENAI_CODEX_STARTUP_STALL_WATCHDOG_S": "",
|
|
268
|
+
},
|
|
269
|
+
clear=False,
|
|
270
|
+
):
|
|
271
|
+
command_grace_s = _resolve_no_edit_command_grace_seconds(child_budget_s)
|
|
272
|
+
command_cap_s = _resolve_no_edit_command_progress_cap_seconds(
|
|
273
|
+
child_budget_s,
|
|
274
|
+
command_grace_s,
|
|
275
|
+
prompt=prompt,
|
|
276
|
+
)
|
|
277
|
+
startup_stall_s = _resolve_startup_stall_watchdog_seconds(child_budget_s)
|
|
278
|
+
|
|
279
|
+
self.assertEqual(command_grace_s, 240)
|
|
280
|
+
self.assertEqual(command_cap_s, 120)
|
|
281
|
+
self.assertEqual(startup_stall_s, 210)
|
|
282
|
+
first_attempt_patchless_ceiling_s = startup_stall_s + command_cap_s
|
|
283
|
+
self.assertGreaterEqual(
|
|
284
|
+
child_budget_s - first_attempt_patchless_ceiling_s,
|
|
285
|
+
2 * _minimum_recovery_attempt_seconds(child_budget_s),
|
|
286
|
+
)
|
|
287
|
+
|
|
252
288
|
def test_runtime_config_prefers_explicit_config_dir_override(self) -> None:
|
|
253
289
|
import executor_base
|
|
254
290
|
|