Skip to content

fix(completion): fall back on invalid manifests - #2298

Merged
jackwener merged 2 commits into
jackwener:mainfrom
Whxuan0701:fix/completion-invalid-manifest-fallback
Aug 22, 2026
Merged

fix(completion): fall back on invalid manifests#2298
jackwener merged 2 commits into
jackwener:mainfrom
Whxuan0701:fix/completion-invalid-manifest-fallback

Conversation

@Whxuan0701

Copy link
Copy Markdown
Contributor

Description

Preserve shell completion when a compiled CLI manifest exists but cannot be used:

  • return an explicit fallback signal for unreadable, malformed, or non-array manifests
  • let the main entry point continue through full adapter discovery on that signal
  • keep the fast path unchanged for valid manifests

Previously the fast path converted a parse failure into an empty completion list and exited successfully, hiding all completion candidates.

Related issue: N/A (independently identified)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

npm run typecheck
> tsc --noEmit

npm run build
✅ Manifest compiled: 1331 entries

npm test
Test Files  591 passed (591)
Tests       6739 passed | 1 skipped (6740)

Risks / Known Gaps

Fallback discovery is slower than the manifest fast path, but it runs only when a manifest is unusable. Valid-manifest completion behavior is unchanged.

@jackwener
jackwener force-pushed the fix/completion-invalid-manifest-fallback branch from eb9cf2d to d66a26d Compare August 22, 2026 19:16
@jackwener
jackwener merged commit 0789842 into jackwener:main Aug 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants