[PR #227] [MERGED] fix(hopper): cancel startup before closing #1878

Closed
opened 2026-10-16 21:12:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/227
Author: @N0zoM1z0
Created: 7/14/2026
Status: ✅ Merged
Merged: 7/14/2026
Merged by: @morluto

Base: main ← Head: agent/hopper-client-lifecycle


📝 Commits (2)

  • 6cc2fdf fix(hopper): cancel startup before closing
  • 6de726f test(hopper): retry after cancelled startup

📊 Changes

2 files changed (+120 additions, -12 deletions)

View changed files

📝 src/hopper/HopperClient.ts (+57 -11)
📝 tests/hopperClient.test.ts (+63 -1)

📄 Description

Summary

  • give each Hopper startup attempt an internal cancellation generation
  • make close() abort and await the exact startup already in flight
  • check cancellation after asynchronous session-directory creation
  • separate internal cleanup from public close to avoid startup/close self-deadlock
  • serialize starts requested while a close is still completing

The root cause was a lifecycle gap before the launcher existed: an immediate close saw no resources and returned while mkdtemp() was still pending, then the abandoned startup resumed and succeeded.

Verification

  • 28 HopperClient tests, including immediate close, restart after close, and start during close
  • npm run typecheck
  • npm run knip
  • scoped oxlint (one pre-existing cleanup-depth warning)
  • scoped Prettier
  • diff check

Real Hopper verification was not performed in this Linux environment.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/227 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `agent/hopper-client-lifecycle` --- ### 📝 Commits (2) - [`6cc2fdf`](https://github.com/morluto/rea/commit/6cc2fdf80ce2d0220fe996ddbed2f0378f5397cd) fix(hopper): cancel startup before closing - [`6de726f`](https://github.com/morluto/rea/commit/6de726ffddc54ea354e6970f022eaab2f0863586) test(hopper): retry after cancelled startup ### 📊 Changes **2 files changed** (+120 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/hopper/HopperClient.ts` (+57 -11) 📝 `tests/hopperClient.test.ts` (+63 -1) </details> ### 📄 Description ## Summary - give each Hopper startup attempt an internal cancellation generation - make `close()` abort and await the exact startup already in flight - check cancellation after asynchronous session-directory creation - separate internal cleanup from public close to avoid startup/close self-deadlock - serialize starts requested while a close is still completing The root cause was a lifecycle gap before the launcher existed: an immediate close saw no resources and returned while `mkdtemp()` was still pending, then the abandoned startup resumed and succeeded. ## Verification - 28 HopperClient tests, including immediate close, restart after close, and start during close - `npm run typecheck` - `npm run knip` - scoped oxlint (one pre-existing cleanup-depth warning) - scoped Prettier - diff check Real Hopper verification was not performed in this Linux environment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1878
No description provided.