fix(solve): preserve success after confirmed merge (#2117) - #2118
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #2117
❌ Work session failed (exit code: 1), yet pull request was merged at the same time
Working session summaryImplemented and finalized issue #2117.
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (432.6K + 15.9M cached) input tokens, 44.3K output tokens, $22.173839 cost 🤖 Models used:
📎 Log file uploaded as Gist (6136KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Did we fix the root cause of exit code 1? We need to make sure that will never happen again. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit f743a21.
|
🤖 AI Work Session Started Starting automated work session at 2026-07-30T07:49:26.906Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
|
Yes—for the root failure class that allowed Hive Mind itself to turn a confirmed merge into exit code 1, this is now fixed in The original implementation kept merge success only as a return value. Any later cleanup/logging/diagnostic exception could still reach an unconditional exit-1 handler, and
The regression uses real child processes: pre-merge One evidence boundary is important: the retained historical log ends almost three minutes before the merge, and the original container/final outer log were gone, so the exact statement that threw in that 2026-07-30 run cannot be named honestly. The reproducible lifecycle defect that made the contradiction possible is closed. An uncatchable SIGKILL/OOM/host removal cannot be converted by Node code; those external events remain observable, with the Telegram fallback reporting both the merged PR and runner failure instead of claiming the whole task failed. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (763.9K + 30.7M cached) input tokens, 76.3K output tokens, $41.775664 cost 🤖 Models used:
📎 Log file uploaded as Gist (11425KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Fixes the lifecycle defect behind #2117, where GitHub had already merged the requested pull request but a later internal error could still make
solveexit with code 1.awaitsolveRoot cause and evidence boundary
GitHub records
link-foundation/use-m#69merged at2026-07-30T06:38:12Z, and Hive Mind posted its merge-success comment one second later. The Telegram runner failure arrived afterward. Before this fix, merge success was only a return value; every exception/rejection/main-error path could still unconditionally request exit 1, and two handler pairs could race.The exact historical statement that threw is not recoverable: the retained attached log ends almost three minutes before the merge, and the original container, final start-command footer, and Docker state are gone. The PR therefore fixes the concrete, reproducible lifecycle invariant that allowed any internal post-merge exception to contradict the durable GitHub result. Uncatchable host/container termination remains observable rather than being hidden.
The full evidence timeline and boundary audit are in
docs/case-studies/issue-2117/README.md.Reproduction
The new regression starts real Node child processes:
safeExit(1)exits with status 1;safeExit(1)logs the late failure and exits with status 0;It also statically verifies that all four merge-success/already-merged branches latch before post-merge work and that
solveno longer installs duplicate process-error handlers.Tests
npm test— all 357 selected test files pass after merging currentmainnpm run lintnpm run format:checknode tests/test-issue-2117-post-merge-exit-guard.mjs— 16/16 on Node 20npx --yes node@24 tests/test-issue-2117-post-merge-exit-guard.mjs— 16/16node tests/test-issue-2117-merged-pr-exit.mjs— 10/10Visual verification
Fixes #2117