Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

fix: handle bun and npm workspaces without --yarn-workspaces flag#6

Merged
zedrdave merged 1 commit intoqualisero:mainfrom
austinm911:main
Jan 7, 2026
Merged

fix: handle bun and npm workspaces without --yarn-workspaces flag#6
zedrdave merged 1 commit intoqualisero:mainfrom
austinm911:main

Conversation

@austinm911
Copy link
Copy Markdown
Contributor

@austinm911 austinm911 commented Jan 7, 2026

Problems

1. Bun/npm workspace detection fails

When a project has workspaces in package.json but uses bun or npm as the packageManager, passing --yarn-workspaces to scip-typescript causes failures because:

  1. --yarn-workspaces triggers yarn workspaces info internally
  2. corepack intercepts and fails due to packageManager mismatch
  3. scip-typescript exits with code 1

2. Untruncated output causes context overflow

Large codebases would return massive SCIP results, causing:

Error: Context overflow: compaction failed. Your input may be too large for the context window.

Solutions

Workspace fix

Check the packageManager field before deciding on workspace flags:

  • bun@* → return [] (no flags, use root tsconfig with includes)
  • npm@* → return [] (scip-typescript lacks --npm-workspaces anyway)
  • yarn@* or unset → return ['--yarn-workspaces'] (existing behavior)

Output truncation

All tools now truncate output to 2000 lines / 50KB (whichever is hit first), matching other pi extensions like osgrep, fd, ast-grep, etc.

Additional Changes

  • scip_reindex tool: Added manual index regeneration tool
  • Tests: 8 new tests for workspace detection

Testing

All 67 tests pass.

When a project has 'workspaces' in package.json but uses bun or npm as the
packageManager, passing --yarn-workspaces to scip-typescript would cause
failures because:

1. --yarn-workspaces triggers 'yarn workspaces info' internally
2. corepack intercepts and fails due to packageManager mismatch
3. scip-typescript exits with code 1

This fix checks the packageManager field before deciding on workspace flags:
- bun@* → return [] (no flags, use root tsconfig with includes)
- npm@* → return [] (scip-typescript lacks --npm-workspaces anyway)
- yarn@* or unset → return ['--yarn-workspaces'] (existing behavior)

Also:
- Add scip_reindex tool for manual index regeneration
- Add output truncation (2000 lines / 50KB limit) matching other pi extensions
- Add comprehensive tests for workspace detection

Fixes indexing for bun monorepos and npm workspaces.
Copy link
Copy Markdown
Member

@zedrdave zedrdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and merging, but might want to look into outsourcing truncation to an external package…

@zedrdave zedrdave merged commit 437e9e0 into qualisero:main Jan 7, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants