Skip to content

Comments

refactor: migrate Bun.spawn to Process utility with timeout and cleanup#14448

Open
thdxr wants to merge 11 commits intodevfrom
feature/remove-bun-spawn
Open

refactor: migrate Bun.spawn to Process utility with timeout and cleanup#14448
thdxr wants to merge 11 commits intodevfrom
feature/remove-bun-spawn

Conversation

@thdxr
Copy link
Contributor

@thdxr thdxr commented Feb 20, 2026

Summary

Sync branch with latest dev changes.

Changes Included

  • App: Refactored session composer, terminal panel improvements, prompt input updates
  • Desktop: CLI argument fixes, server improvements
  • Core: Removed Bun.spawn usage, PTY output isolation, process utilities
  • Provider: Transform improvements
  • Tests: Session prompt tests, skill discovery tests
  • UI: Dock components, message styling updates
  • Docs: Korean translations, provider docs updates
  • Misc: Package version bumps, e2e test cleanup

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.
@thdxr thdxr requested a review from adamdotdevin as a code owner February 20, 2026 14:38
@thdxr thdxr changed the title refactor: migrate from Bun.Glob to npm glob package sync: merge dev into feature/remove-bun-spawn Feb 20, 2026
@Sir-Goose
Copy link

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.
@thdxr thdxr changed the title sync: merge dev into feature/remove-bun-spawn refactor: migrate Bun.spawn to Process utility and Bun.Glob to npm glob Feb 20, 2026
@thdxr thdxr changed the title refactor: migrate Bun.spawn to Process utility and Bun.Glob to npm glob refactor: migrate Bun.spawn to Process utility with timeout and cleanup Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants