Skip to content

test(daemon): e2e regression guard for spawn cwd stability#3005

Open
illegalcall wants to merge 1 commit into
mainfrom
test/daemon-cwd-stability-e2e
Open

test(daemon): e2e regression guard for spawn cwd stability#3005
illegalcall wants to merge 1 commit into
mainfrom
test/daemon-cwd-stability-e2e

Conversation

@illegalcall

Copy link
Copy Markdown
Collaborator

Summary

Adds a small end-to-end regression guard for the daemon spawn working-directory
fix (#2871, RCA #2780 / symptom #2775). It runs the real ao daemon and
real tmux, mirroring the style of test/cli/install-check.sh.

test/daemon/cwd-stability-check.sh asserts:

  1. Daemon self-stabilizes. Launched from a directory that is then deleted
    (the Squirrel/ShipIt "poisoned cwd"), the daemon stays healthy, has chdir'd
    to its data dir, and preserves its startup cwd in /healthz
    (startupWorkingDirectory).
  2. Relative AO_DATA_DIR is absolutized. No reldata/reldata double-nest
    after the daemon chdirs.
  3. tmux cd <ws> || exit guard. The pane lands in the workspace even
    against a tmux server whose own cwd was deleted.

Each daemon is discovered via its own running.json, so the check is immune to
port collisions (the daemon falls back to an ephemeral port when its configured
one is taken). The tmux check skips cleanly when tmux is absent.

Test

$ go build -o ./ao ./backend/cmd/ao
$ AO_BIN=./ao test/daemon/cwd-stability-check.sh
...
RESULT: 11 passed, 0 failed

Notes

  • Not wired into CI here — it's a manual/opt-in check for now. Happy to add a
    workflow step (build ao, run the script) if wanted.
  • Honest caveat baked into Test 3: it asserts the guard produces the correct
    cwd; the -c-ignored tmux failure mode it defends against is
    version/OS-specific and does not reproduce on every host.

🤖 Generated with Claude Code

Adds test/daemon/cwd-stability-check.sh: a small, linear end-to-end check
against the real `ao daemon` and real tmux, mirroring test/cli/install-check.sh.

Verifies:
- a daemon launched from a directory that is then deleted stays healthy, has
  chdir'd to its data dir, and preserves its startup cwd in /healthz;
- a relative AO_DATA_DIR is absolutized (no reldata/reldata double-nest);
- the tmux `cd <ws> || exit` launch guard lands the pane in the workspace even
  against a poisoned (deleted-cwd) tmux server.

Each daemon is discovered via its own running.json, so the check is immune to
port collisions (the daemon falls back to an ephemeral port). tmux check skips
cleanly when tmux is absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@somewherelostt

Copy link
Copy Markdown
Collaborator

Thanks for contributing to Agent Orchestrator.

This PR is being picked up by the current external contributor on-call pair:

If someone is already working on this, please continue as usual.
The on-call pair is added for visibility, tracking, and support, not to take over the work.
If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @Pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here:
https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

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.

3 participants