8000 Keep a run whose kept workspace cannot be tidied yet by ruiling-smartbear · Pull Request #73 · Infini-AI-Lab/hermit · GitHub
[go: up one dir, main page]

Skip to content

Keep a run whose kept workspace cannot be tidied yet - #73

Open
ruiling-smartbear wants to merge 4 commits into
Infini-AI-Lab:mainfrom
ruiling-smartbear:fix/clean-busy-mount-point
Open

ruiling-smartbear wants to merge 4 commits into
Infini-AI-Lab:mainfrom
ruiling-smartbear:fix/clean-busy-mount-point

Conversation

@ruiling-smartbear
@ruiling-smartbear ruiling-smartbear commented Nov 4, 2026 •
Copy link
Copy Markdown
Contributor

Change

After a workspace agent's session has answered, _clean tidies the kept workspace: it removes links out of it and
the empty mount points. Docker Desktop can still hold a bind mount's target a moment after its container exits;
reading or removing it then raises PermissionError, which failed the run, so a session that had answered was
scored as a pipeline failure ("the pipeline failed: PermissionError: [Errno 13] Permission denied:
'.../work/docs/root_1'").

_clean now leaves such a directory in place (hermit/agent/acting/workspace.py). Tidying is for inspection only;
nothing reads the empty mount point afterwards.

Core change: hermit/agent/acting/workspace.py, _clean only. CHANGELOG: one entry under Fixed.

Validation

  • tests/core/test_cli_agent.py::test_a_mount_point_still_held_is_left_and_the_rest_tidied: a mount point whose listing
    raises PermissionError is left and the rest is still tidied. It fails without the change.
  • python -m pytest tests/core/test_cli_agent.py: 44 passed, 1 failed
    (test_a_stream_replaced_by_a_link_is_not_read_as_the_sessions, which fails the same way on main on this
    machine, macOS).
  • Seen on OfficeQA (Codex in a container per session, Docker Desktop on macOS, 8-10 sessions at once) on
    2026-11-04: 21 sessions, 11 in two trainings (run again by the Evolvers) and 10 in one 172-question evaluation,
    where each answered question became a 0.

Not verified: Linux Docker (the error was seen on Docker Desktop only).

Review

  • Tests and documentation cover the affected behavior, where applicable.
  • Commands, defaults, and public interfaces are consistent: no interface changes.
  • Shared logs and examples contain no credentials or private data.
  • Documentation-only: not applicable.
  • Test checklist.
    • Group: tests/core/test_cli_agent.py, beside the existing _clean test; python -m pytest --changed selects it.
    • Name and docstring: the name states the behaviour; the docstring names the Docker Desktop hold it guards.
    • Asserts: the held directory is kept and a sibling empty directory is still removed. It fails without the fix
      (PermissionError on docs/root_1), checked by running it against main's workspace.py.
    • Entry point: _clean directly, as the neighbouring tidy test does; the Docker hold is simulated by making
      Path.iterdir raise for that one directory.
    • Isolation, time and order: tmp_path only, no network, CLI or sign-in, no sleeps.
  • Implementation correctness and failures: only the tidy step's OSError is caught; the session's own failures,
    the answer and collect are unchanged.
  • Independent review (post-PR audit at 7f25045): no defects. Its one finding, a docstring that claimed more than
    the code covers, is fixed in 7046e87.

After a container session answered, tidying the kept workspace removed the
empty mount points; Docker Desktop can still hold a bind mount's target a
moment after its container exits, and reading or removing it raised
PermissionError, which failed the run and scored the answer as a pipeline
failure. Seen on OfficeQA's docs/root_1, about one session in a hundred under
load. The directory is now left in place.
@iamziyuzhao
iamziyuzhao self-requested a review November 4, 2026 19:16
@ruiling-smartbear
ruiling-smartbear force-pushed the fix/clean-busy-mount-point branch from fb3bdd8 to b1f53a0 Compare November 6, 2026 04:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0