[PR #739] [MERGED] fix(hopper): retain shutdown request diagnostics #2206

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/739
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/hopper-shutdown-request-diagnostics


📝 Commits (1)

  • 7254871 fix(hopper): retain shutdown request diagnostics

📊 Changes

2 files changed (+184 additions, -9 deletions)

View changed files

➕ src/hopper/HopperCleanup.test.ts (+121 -0)
📝 src/hopper/HopperCleanup.ts (+63 -9)

📄 Description

Summary

  • retain rejected Hopper shutdown request causes in the existing HopperProcessError
  • identify the failed shutdown or shutdown_document operation in structured warnings
  • preserve cleanup sequencing, warning text, caller-visible cleanup errors, and resource retention

Closes #641.

Evidence

Both shutdown rejection handlers previously used .catch(() => err(new HopperProcessError(null))). That discarded the original rejection and did not attach an operation. The subsequent warnings exposed only status: "failed", so a primary document-close rejection and the process-cleanup fallback were indistinguishable.

The regression drives the production cleanupHopperSession coordinator through both rejection paths. It verifies that the existing typed incomplete-cleanup result remains unchanged while the warning retains HopperProcessError, the exact shutdown operation, and bounded JSON-safe error name/message/code fields.

Scope and behavior

This is diagnostics-only:

  • shutdown selection and fallback ordering are unchanged
  • transport release, owned-process cleanup, runtime-root cleanup, and retained-resource behavior are unchanged
  • warning messages and caller-visible error projections are unchanged
  • non-Error rejection values are reduced to JSON-safe type/value metadata

Validation

Passed:

  • npm run test:focused -- src/hopper/HopperCleanup.test.ts (2 tests)
  • npm exec --package=typescript@5.9.3 -- tsc --noEmit
  • npm run lint
  • npm run knip
  • npm run metadata:check
  • targeted oxfmt --check
  • git diff --check

Materially unverified locally:

  • tests/boundary/providers/hopper/hopperClient.cleanup.test.ts could not start its fake Hopper Unix-socket fixture in this sandbox; all six cases timed out before the health handshake.
  • the repository TypeScript 7 binary used by npm run check panics while resolving /proc/self/exe in this sandbox. The stable TypeScript check and the other check components passed independently.

No real Hopper workflow was run because this change covers the provider's defensive rejection seam rather than Hopper behavior.


🔄 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/739 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/hopper-shutdown-request-diagnostics` --- ### 📝 Commits (1) - [`7254871`](https://github.com/morluto/rea/commit/72548712fea972b920834663a5e2ceea4738ce1e) fix(hopper): retain shutdown request diagnostics ### 📊 Changes **2 files changed** (+184 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `src/hopper/HopperCleanup.test.ts` (+121 -0) 📝 `src/hopper/HopperCleanup.ts` (+63 -9) </details> ### 📄 Description ## Summary - retain rejected Hopper shutdown request causes in the existing `HopperProcessError` - identify the failed `shutdown` or `shutdown_document` operation in structured warnings - preserve cleanup sequencing, warning text, caller-visible cleanup errors, and resource retention Closes #641. ## Evidence Both shutdown rejection handlers previously used `.catch(() => err(new HopperProcessError(null)))`. That discarded the original rejection and did not attach an operation. The subsequent warnings exposed only `status: "failed"`, so a primary document-close rejection and the process-cleanup fallback were indistinguishable. The regression drives the production `cleanupHopperSession` coordinator through both rejection paths. It verifies that the existing typed incomplete-cleanup result remains unchanged while the warning retains `HopperProcessError`, the exact shutdown operation, and bounded JSON-safe error name/message/code fields. ## Scope and behavior This is diagnostics-only: - shutdown selection and fallback ordering are unchanged - transport release, owned-process cleanup, runtime-root cleanup, and retained-resource behavior are unchanged - warning messages and caller-visible error projections are unchanged - non-Error rejection values are reduced to JSON-safe type/value metadata ## Validation Passed: - `npm run test:focused -- src/hopper/HopperCleanup.test.ts` (2 tests) - `npm exec --package=typescript@5.9.3 -- tsc --noEmit` - `npm run lint` - `npm run knip` - `npm run metadata:check` - targeted `oxfmt --check` - `git diff --check` Materially unverified locally: - `tests/boundary/providers/hopper/hopperClient.cleanup.test.ts` could not start its fake Hopper Unix-socket fixture in this sandbox; all six cases timed out before the health handshake. - the repository TypeScript 7 binary used by `npm run check` panics while resolving `/proc/self/exe` in this sandbox. The stable TypeScript check and the other check components passed independently. No real Hopper workflow was run because this change covers the provider's defensive rejection seam rather than Hopper behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:41 +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#2206
No description provided.