feat: launcher self-healing for missing extracted modules + ENABLE_TOOL_SEARCH default false (2.1.251 payload 2+3) - #347
Merged
bash0816 merged 4 commits intoAug 30, 2026
Conversation
…ted modules (2.1.251 payload 2+3)
## Summary
Implement self-recovery mechanism for missing extracted modules in the ESM-chunked launcher:
### Payload 2: Loader self-healing
- Add recovery state tracking (REEXTRACT, consecutive failures, throttle)
- Implement recoverMissing() function with exponential backoff
- Apply recovery to 4 critical paths:
- tryHoistCycleBreakingImports() path existence check
- resolve() missing module detection
- load() readFileSync ENOENT handling
- __bunfsMetaRequire prelude error handling (3 branches)
- Recovery is guarded: only triggers on disk absence, not on internal module errors
- Throttled to 1 attempt per 3s to prevent cascading failures
- Capped at MAX_CONSEC_FAILURES=3 to prevent infinite loops
### Payload 3: Tool search override
- Export ENABLE_TOOL_SEARCH="${ENABLE_TOOL_SEARCH:-false}" from wrapper shell
- Defaults to "false" (standard mode), disabling dynamic ToolSearch
- Respects settings.json "force" value override
- Wire up reExtract callback to both esmChunkedMain copies in .sh
### Testing
- Added 10 new unit tests covering all recovery scenarios
- All 21 bunfs-esm-loader tests pass
- No regression in existing test coverage (pass count stable)
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ts (G3 non-blocker)
bash0816
deleted the
feat/claude-code-2.1.251-launcher-selfheal-toolsearch
branch
August 30, 2026 17:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2.1.251 の launcher-only 変更 (payload 2+3)。native/manifest/config/package.json は 2.1.248 のまま未変更。
payload 2: チャンク欠落 self-heal
bunfs-esm-loader.mjsにrecoverMissing()を追加。抽出済みモジュールが実行時に消えていた場合 (bunfs meta-require: missing extracted module) に、BunFS モジュール表から同一 process-owned dir へ同期再展開して回復する。対象パスが実際に不存在の場合のみ発火し、MODULE_NOT_FOUND 全般は隠さない。連続失敗3回で停止・3秒スロットル。helper/bootstrap 両経路に配線。payload 3: ENABLE_TOOL_SEARCH 既定 false
未設定時のみ
falseを export (ユーザーの明示指定は上書きしない)。ゲート
G1/G2/G3/G4 すべて Go (terra)。
node --test lib/bunfs-esm-loader.test.js23/23 pass。terra G4 注記: これは launcher-only 先行マージの Go。upstream 2.1.251 publish/promote には別 PR の payload 1 (native/manifest 監査・バンプ) を束ねる必要がある。