fix(agent): handle clean recovered exits#1630
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #1629
Solution summaryImplemented, pushed, and finalized PR 1630: #1630 What changed:
Verification:
Online references used for the case-study collection are documented in Useful follow-ups:
This summary was automatically extracted from the AI working session output. |
|
Double check all conclusions from previous analysis and implemented solution. Do we really log everything, found real root cause and have actually fixed it? We need to ensure all changes are correct, consistent, validated, tested, logged and fully meet each and all discussed requirements (check issue description and all comments in issue and in pull request). Ensure all CI/CD checks pass. |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-19T19:00:10.206Z 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. |
…enarios Add Test 28 and Test 29 to tests/test-agent-error-detection.mjs covering the real NDJSON event shape observed in the Hive Mind case study log at docs/case-studies/issue-1629/logs/solution-draft-6aeb182b868a97770a8ed3ff525819f6.log: - Test 28 exercises the full gate chain (streaming → post-hoc → fallback) against the actual production payload where the TypeError is nested at error.data.message inside a type:"error" event, followed by the clean Agent exiting event with hasError:false. - Test 29 independently verifies that the raw NDJSON fullOutput would match the fallback pattern if the gate were not in place, confirming the Issue #1629 fix is actually necessary rather than redundant. Addresses the maintainer's request in PR #1630 to double-check that the implemented solution validates against the real logs and fully meets the requirements discussed in the issue.
Double-check summary (per #1630 (comment))Verified each link in the chain: Logs
Root cause
Fix (already in this PR)
Tests
CI
All conclusions re-verified against real logs, and the fix now has explicit production-shape test coverage. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $5.359954📊 Context and tokens usage:Claude Opus 4.7: (2 session segments)
Total: (202.6K + 6.3M cached) input tokens, 37.2K output tokens, $5.359954 cost 🤖 Models used:
📎 Log file uploaded as Gist (2517KB)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 |
This reverts commit f43810f.
Summary
docs/case-studies/issue-1629, including PR 1833 metadata, comments/reviews/timeline data, 16 Actions logs, 5 solution-draft logs, related issue 1826 data, and related PR 1839 data.{"type":"log","message":"Agent exiting","hasError":false}marks the run as successfully recovered.type:errordetection when the agent exits with code 0 and a success marker, preventing recovered internal usage errors from failing the solution draft.usage.inputTokens.totalTypeError followed by cleanAgent exiting.Case Study Findings
hasError:falseand exit code 0.docs/case-studies/issue-1629/README.md; the artifact inventory is indocs/case-studies/issue-1629/data/data-inventory.tsv.Jhon-Crow/godot-topdown-MVPbecause the project issue was later resolved by PR 1839; the actionable fix is Hive-side.Verification
node tests/test-agent-error-detection.mjsnpx prettier --check src/agent.lib.mjs tests/test-agent-error-detection.mjs docs/case-studies/issue-1629/README.md docs/case-studies/issue-1629/research/online-sources.mdnpm run lintnpm testgit diff --cached --check -- src/agent.lib.mjs tests/test-agent-error-detection.mjs .changeset/issue-1629-agent-exit.md docs/case-studies/issue-1629/README.md docs/case-studies/issue-1629/research/online-sources.mdNote: dependency installation completed with an expected local engine warning because this environment runs Node 20 while
package.jsonrequires Node >=24.Fixes #1629