refactor: migrate Bun.spawn to Process utility with timeout and cleanup#14448
Open
refactor: migrate Bun.spawn to Process utility with timeout and cleanup#14448
Conversation
Replace Bun.Glob usage with a new Glob utility wrapper around the npm 'glob' package. This moves us off Bun-specific APIs toward standard Node.js compatible solutions. Changes: - Add new src/util/glob.ts utility module with scan(), scanSync(), and match() - Default include option is 'file' (only returns files, not directories) - Add symlink option (default: false) to control symlink following - Migrate all 12 files using Bun.Glob to use the new Glob utility - Add comprehensive tests for the glob utility Breaking changes: - Removed support for include: 'dir' option (use include: 'all' and filter manually) - symlink now defaults to false (was true in most Bun.Glob usages) Files migrated: - src/util/log.ts - src/util/filesystem.ts - src/tool/truncation.ts - src/session/instruction.ts - src/storage/json-migration.ts - src/storage/storage.ts - src/project/project.ts - src/cli/cmd/tui/context/theme.tsx - src/config/config.ts - src/tool/registry.ts - src/skill/skill.ts - src/file/ignore.ts
Add symlink: true to all locations that previously had followSymlinks: true: - theme.tsx: custom themes - config.ts: commands, agents, modes, plugins - skill.ts: external, opencode, and custom skills - registry.ts: custom tools Also fix nodir to default to true (exclude directories) when include is not explicitly set to 'all'.
- Add tests for symlink following (default false, true when enabled) - Add tests for dot option (include/exclude dotfiles) - Add tests for scanSync - Verify directories excluded by default (nodir: true) - Verify directories included when include: 'all'
The pattern **/{favicon}.{ico,png,svg,jpg,jpeg,webp} doesn't work with
the npm glob package. Changed to **/favicon.{ico,png,svg,jpg,jpeg,webp}
which correctly matches favicon files with any of the specified extensions.
|
lgtm |
…dling Replace Bun-specific stream utilities with standard Node.js APIs for better compatibility. Add automatic SIGKILL fallback when processes don't terminate within timeout period. Fix process stream reading to properly handle cancellation and avoid buffer deadlocks.
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
Sync branch with latest dev changes.
Changes Included