Skip to content

fix(teardown): keep state cleanup running when treehouse return fails - #498

Closed
e-jung wants to merge 3 commits into
kunchenguid:mainfrom
e-jung:fm/teardown-return-nonfatal-focused
Closed

e-jung wants to merge 3 commits into
kunchenguid:mainfrom
e-jung:fm/teardown-return-nonfatal-focused

Conversation

@e-jung

@e-jung e-jung commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Make treehouse return non-fatal in bin/fm-teardown.sh so task state is always cleaned up even when treehouse return fails, while keeping lock-refused cases fatal. Rebase the existing PR onto latest main to resolve merge conflict.

What Changed

  • Treehouse return failures other than persistent lock refusals no longer abort teardown: they print a warning and continue with task-state and tasktmp cleanup so a finished task is not left half-dismantled.
  • Lock-refused returns (TEARDOWN_TREEHOUSE_LOCK_REFUSED) remain fatal for ordinary tasks, and unpushed-work safety refusals still fire before the treehouse return path, preserving both safety guarantees.
  • Added tests covering the non-fatal cleanup path and the unpushed-work refusal still holding when treehouse return would fail.

Risk Assessment

✅ Low: The change is narrowly scoped to one caller's error handling (non-lock treehouse return failures become warning-only while lock-refused stays fatal), is well-tested with two targeted tests, cleanly integrates the rebased main's lock-retry helper, and fully satisfies the stated intent.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 1 run (12m44s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⚠️ **Rebase** - 1 warning

Push main to origin, or rebase your branch onto origin/main, before gating.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@e-jung e-jung changed the title fix(teardown): keep state cleanup after non-lock treehouse return failure fix(teardown): make treehouse return non-fatal so task state is always cleaned up Jul 12, 2026
@e-jung e-jung changed the title fix(teardown): make treehouse return non-fatal so task state is always cleaned up fix(teardown): keep state cleanup after non-lock return failures Jul 12, 2026
@e-jung e-jung changed the title fix(teardown): keep state cleanup after non-lock return failures fix(teardown): make treehouse return non-fatal so task state is always cleaned up Jul 12, 2026
@kunchenguid

kunchenguid commented Jul 13, 2026 •

Copy link
Copy Markdown
Owner

Thanks for the PR! This branch currently has a merge conflict with the base branch.

When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again.

Noted for firstmate#498 at 72b33d41.

@e-jung
e-jung force-pushed the fm/teardown-return-nonfatal-focused branch from 72b33d4 to ddba4f6 Compare July 14, 2026 00:10
@e-jung e-jung changed the title fix(teardown): make treehouse return non-fatal so task state is always cleaned up fix(teardown): keep state cleanup running when treehouse return fails Jul 14, 2026
@kunchenguid kunchenguid removed the wheelhouse:pending-contributor-action Managed by Wheelhouse label Jul 14, 2026
@e-jung e-jung closed this Jul 17, 2026
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