fix(manifest): preserve dynamic TS arg metadata in help output#536
Merged
jackwener merged 2 commits intojackwener:mainfrom Mar 28, 2026
Merged
fix(manifest): preserve dynamic TS arg metadata in help output#536jackwener merged 2 commits intojackwener:mainfrom
jackwener merged 2 commits intojackwener:mainfrom
Conversation
68715ad to
9d97797
Compare
Merged
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.
Description
This PR fixes a production-only manifest/help gap for TS adapters.
build-manifestcurrently relies on static source parsing for TS command metadata. That works for literal arg definitions, but it drops or corrupts metadata when adapters use runtime values such as shared choice arrays or computed help text. In practice this causes manifest-backed commands to losechoices, lose help text, or mis-parse defaults indisteven though the source adapter registers the correct metadata.This change hydrates TS manifest entries from the runtime-registered command metadata during manifest compilation, while keeping YAML handling unchanged. It also shortens long
choiceslists in the appended help footer so manifest-backed help stays readable.Concrete regressions covered by this PR:
chatgpt/modelnow keeps itsMODEL_CHOICESindist/cli-manifest.jsonchatgpt/askandchatgpt/sendnow keep theirmodelchoices indist/cli-manifest.jsonchatgpt/askno longer mis-parses thetimeoutdefault as"30)"choiceslists instead of printing the entire array inlineRelated issue:
Type of Change
Checklist
Documentation (if adding/modifying an adapter)
docs/adapters/(if new adapter)docs/adapters/index.mdtable (if new adapter)docs/.vitepress/config.mts(if new adapter)README.md/README.zh-CN.mdwhen command discoverability changedCliErrorsubclasses instead of rawErrorScreenshots / Output
Verified locally:
Observed results:
npm run buildsucceedednpx vitest run src/build-manifest.test.ts src/serialization.test.tspassed (2 files,8 tests)Example output after the fix: