fix: isolate file tool paths and cron script workdirs - #64894
Conversation
|
Thanks for the focused fixes. The reported behavior is present on current main: The PR changes dispatch to the validated path, passes an explicit child CWD through both normal and heartbeat script paths, and covers both no-agent and agent pre-run execution. Current production Automated hermes-sweeper review. |
SummarySix PRs are associated with this three-issue guardrail complex. #34614, #34778, and #43930 address repeated successful mutations; #41492 adds file-tool recovery hints; #57303 adds runtime-enforced soft blocks for repeated failures and read-only no-progress loops; and #64894 independently fixes task-root path dispatch and cron subprocess working directories. Related pull requests
Duplicates#34778 is the closed duplicate of #34614 for successful mutating-call repetition. #43930 overlaps that mechanism but bundles a distinct overwrite guard; #41492 and #57303 overlap on recovery guidance but are not strict duplicates because #57303 adds shared runtime enforcement. Suggested consolidationAuthor action: rebase #57303 onto main, or split out its default soft-block logic, rotating guidance, configuration/docs changes, and sequential/concurrent runtime tests for fresh focused review; this preserves its recorded best-fix status and visible keep_open review. Keep #34614 open with its reviewed salvage work, keep #41492 open for its complementary action_hint path and missing dedup assertion, retain #43930 and #64894 as separate salvage tracks, and leave #34778 closed as duplicate of #34614. Cross-PR triage: Reviewed 6 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 83 kB of PR diffs, 37 kB of issue/PR text, 7 kB of discussion (13 comments), 12 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
read_fileandsearch_filesbackend paths against the task's own validated root before dispatch, preventing a cross-task backend-CWD escape.workdir, falling back to the script directory when unset or invalid; child CWD selection does not use process-globalos.chdir.Validation
Focused suites passed:
tests/tools/test_file_tools.py -k 'TaskRootReadDispatch or WindowsMsysPathResolution': 6 passedtests/tools/test_read_loop_detection.py: 25 passedtests/cron/test_cron_no_agent.py tests/cron/test_cron_workdir.py tests/cron/test_cron_script.py: 79 passedtests/cron/test_script_claim_heartbeat.py: 3 passedtests/cron/test_scheduler.py::TestRunJobWakeGate::test_script_runs_only_once_on_wake: 1 passedgit diff --check: passedFull suite was run before and after the integration fixes. It is not clean on this macOS environment due to pre-existing platform/config/timing failures and 11 collection/import failures.
46e87b14fd6c943ef0d6671fb0d74c5dde5d4c6b: 36 failures across 17 files + 11 collection/import failures.HERMES_HOME; the approved-command interrupt node passed 3/3 direct runs in both worktrees; the atomic snapshot node flakes on base (1/3 failure).Scope
No configuration, lockfile, credentials, or global-CWD behavior changed.