[Bug] ar-supervisor hangs on exit when project root contains spaces

Open
#12 1 comment 0 reactions 0 assignees View on GitHub

@harman-2167 is already working on this.

Since Oct 15, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, shell
Domain
devops, tooling

Research direction

Start in ar-runtime/scripts/ar-supervisor.sh, reading monitor_pids() and reap_monitors() to trace how the project root is recovered and how cleanup waits for the monitor. Reproduce the issue with a root containing whitespace, then add the suggested supervisor cleanup test. Done means the monitor is stopped and reaped, the supervisor exits, and the run manifest is sealed.

Written by the indexing model from the issue text.

Description

Summary

monitor_pids() parses ps -eo pid=,command= output with line.split() and takes the next token after --project-root. A valid project path containing spaces is split into multiple tokens, so the monitor's actual root never matches ABS_PROJ.

On the first run for such a project, reap_monitors() consequently does not signal the monitor. It then waits on MONITOR_PID unconditionally; because that child is still running, the supervisor's EXIT trap blocks indefinitely.

Reproduction

  1. Run ar-runtime/scripts/ar-supervisor.sh with a project root such as /tmp/research project.
  2. Let the supervisor start its ar-gemini-monitor.py --project-root "/tmp/research project" child.
  3. Let the supervisor exit (for example after the retry budget is exhausted).
  4. Observe that the supervisor remains stuck in reap_monitors() waiting for the monitor; the monitor continues running.

The parser behavior is reproducible from a typical ps line: after splitting "... --project-root /tmp/research project ...", the value read for --project-root is only /tmp/research, not the original argument.

Expected behavior

The monitor is stopped and reaped, then the supervisor exits and seals the run manifest.

Suggested direction

Avoid recovering argv boundaries from the display-formatted ps command string, or use an encoding/quoting-aware process inspection method. Add a supervisor cleanup test whose project root contains whitespace.

Dominant language
Python
Stars
2.8k
Forks
250
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EvoMap/AutoResearch

All issues in EvoMap/AutoResearch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.