Skip to content

feat(core): Refused a directory a tool call never came back from. - #21

Closed
moetemp wants to merge 1 commit into
moe/cross-host-checkfrom
moe/worktree-quarantine
Closed

moetemp wants to merge 1 commit into
moe/cross-host-checkfrom
moe/worktree-quarantine

Conversation

@moetemp

@moetemp moetemp commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

This PR refuses a project directory to a later step while a tool call of an earlier step may still be writing it.

A timeout settles the workflow's promise without stopping the process behind it, so after a step is abandoned its host can still be running that step's tool, and the next step to land on that host would rebuild or capture a directory the tool is writing. A marker is written beside the directory before a tool can touch anything and removed when its body returns (snapshot/writers.ts). While one stands for another step, the host refuses the directory. The refusal takes itself back where the host can show the call is over: its process is gone, nothing carrying the name the worker exported is running, nothing is left in its process group or control group, and nothing is standing in the directory. A directory this host built from packs is moved aside and rebuilt fresh instead of refused; somebody's own checkout is never moved.

The refusal crosses the activity boundary as retryable work with a retry delay of its own, so the step reaches another host in about the time one dispatch takes rather than climbing a failing activity's backoff.

The worker name the markers rely on is set on the first marker rather than at import, so loading the module changes nothing. A marker is written before its tool can spawn anything, so children still inherit it.

Tests: the quarantine and set-aside cases in worktree-materialize.test.ts, stepped-drain-writers.test.ts and boundary-refusal.test.ts.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

A timeout settles the workflow's promise without stopping the process behind it, so a later step landing on the same host can rebuild or capture a directory an abandoned tool is still writing. A marker is written before a tool can touch anything and removed when its body returns; while one stands for another step, the host refuses the directory, or moves it aside and rebuilds when it built the directory itself. The refusal crosses the activity boundary as retryable work with its own delay, so another host takes the step.
@moetemp
moetemp force-pushed the moe/worktree-quarantine branch from 7b4cf1b to 13bbae0 Compare September 15, 2026 01:01
@moetemp
moetemp force-pushed the moe/cross-host-check branch from 2a035ac to c61bb17 Compare September 15, 2026 01:01
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

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.

1 participant