feat: support context length shorthand (64k, 128k)#64
Merged
Andyyyy64 merged 5 commits intoMay 26, 2026
Conversation
This was referenced May 22, 2026
Owner
|
Thanks, this is the implementation I’d like to go with for #59. Could you make one small adjustment before we merge? Could you also carry over the CLI docs coverage from #60? After that this looks good to merge. |
…thand Switch k/m/b multipliers from decimal (1000) to binary (1024) so that 64k parses as 65536, matching LLM context window conventions. Add shorthand examples and updated option descriptions to docs/cli.md for all four commands (main, plan, upgrade, run).
Contributor
Author
|
Thanks for the feedback! I've pushed the changes:
All 202 tests pass, ruff clean. |
Owner
|
Sorry for the slow follow-up, work has been busy on my end. This looks good now. The 1024-based shorthand behavior matches how people usually talk about context windows, and the CLI docs coverage is in place. |
4 tasks
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.
What
Add shorthand notation for the
--context-length/-cflag across allcommands (
whichllm,plan,upgrade,run). Users can now writewhichllm -c 64kinstead ofwhichllm -c 64000.Supported formats: plain integers (
4096), k/K suffix (64k= 64000),m/M suffix (
1m= 1000000), fractional (1.5k= 1500). Case-insensitive.Why
Closes #59. Converting context lengths to raw integers is annoying when
the values are commonly expressed as 64k, 128k, etc.
Testing
uv run pytest, 202/202)test_utils.pycovering valid inputs,edge cases, and rejection of bad values)
Notes
ContextLengthTypeis a customclick.ParamTypeinutils.pythathandles parsing before typer sees it
--context-lengthoptions incli.pywired viaclick_type=CONTEXT_LENGTH