fix: mitigate transient spawn ENOENT during update windows#305
Open
liuxiaopai-ai wants to merge 3 commits intolukilabs:mainfrom
Open
fix: mitigate transient spawn ENOENT during update windows#305liuxiaopai-ai wants to merge 3 commits intolukilabs:mainfrom
liuxiaopai-ai wants to merge 3 commits intolukilabs:mainfrom
Conversation
Handle transient spawn ENOENT errors (e.g. during app bundle swap on auto-update) by retrying once after a short delay before surfacing the error. Refs lukilabs#268 Co-Authored-By: Craft Agent <agents-noreply@craft.do>
Prevent update install/restart while any session is actively processing to reduce bundle-swap race windows. Refs lukilabs#268 Co-Authored-By: Craft Agent <agents-noreply@craft.do>
Handle unexpected checker failures gracefully so install flow doesn’t crash if session state probing throws.\n\nRefs lukilabs#268\n\nCo-Authored-By: Craft Agent <agents-noreply@craft.do>
Author
|
Friendly ping for review when you have bandwidth 🙏\n\nThis PR addresses #268 with a conservative two-layer mitigation:\n- retry once on transient spawn ENOENT in ClaudeAgent\n- block update install while any session is actively processing\n\nFollow-up hardening included: session checker errors are handled defensively before install.\n\nValidation run locally:\n- bun run typecheck:all\n- bun run --cwd apps/electron typecheck\n- bun test packages/shared/src/agent/tests/\n- bun test apps/electron/src/main/tests/\n- targeted eslint on changed files\n\nHappy to adjust quickly based on maintainer feedback. |
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.
Summary
Mitigate transient
spawn ENOENTfailures reported in #268 during update/restart windows.This PR applies a two-layer fix:
ClaudeAgentChanges
packages/shared/src/agent/claude-agent.tsspawn+ENOENTin chat error flow_isRetryguard prevents loops)apps/electron/src/main/auto-update.tssetHasActiveProcessingSessionsChecker()callbackinstallUpdate(), block installation if any session is currently processingapps/electron/src/main/index.tsSessionManagerinto auto-update checker viasession.isProcessingWhy this approach
Validation
bun test packages/shared/src/agent/__tests__/base-agent.test.ts✅bun x tsc -p apps/electron/tsconfig.json --noEmit✅Fixes #268