time create and time update panic on --start
Summary
clickup-cli time create and clickup-cli time update panic during argument parsing whenever --start is passed, making it impossible to log a time entry for a past interval. clickup-cli time list --start is unaffected.
The panic comes from clap, not from the API layer — it happens before any network call.
Version / environment
clickup-cli 0.14.0
- macOS,
Darwin arm64
- Installed via
npm i -g @nick.bester/clickup-cli
Reproduction
clickup-cli time create --start 1753800000000 --duration 3600000
thread 'main' (8147786) panicked at
/Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.6.0/src/parser/error.rs:32:9:
Mismatch between definition and access of `start`.
Could not downcast to TypeId(0xae6c4318bb07632e00428affbea41961),
need to downcast to TypeId(0x54661232f4503ad5453a68e57906db78)
Exit code 101. Same panic for:
clickup-cli time update <entry_id> --start 1753800000000
Blast radius
| Command |
--start |
Result |
time create |
1753800000000 |
panic, exit 101 |
time update <id> |
1753800000000 |
panic, exit 101 |
time list |
1753800000000 |
works, exit 0 |
comment list --task <id> |
— |
works, exit 0 |
Likely cause
clickup-cli time create --help shows two semantically different --start-family options on the same command:
--start <START> Start time (Unix ms)
--start-id <START_ID> Boundary comment id (v2 start-id-based comment endpoints). Pair with --start
The global/shared option block appears to register --start as the comment-pagination boundary (a string), while time create / time update register their own --start as a numeric Unix-ms timestamp. clap stores the value under one type and the subcommand reads it back as the other, so ArgMatches::get_one::<T>("start") fails the downcast and panics.
time list presumably survives because its --start is declared as a string (--start ISO|ms), matching what the shared block registered.
Two things worth noting:
- The shared pagination flags (
--start-id, --cursor, --page, --limit, --all) are surfaced on time create, where none of them apply. Scoping the pagination block to the commands that actually paginate would remove the collision at the source.
- A type mismatch like this is detectable at startup —
Command::debug_assert() in a test would have caught it before release.
Expected
time create --start <ms> --duration <ms> creates the entry and prints it, matching the documented usage in time create --help.
time createandtime updatepanic on--startSummary
clickup-cli time createandclickup-cli time updatepanic during argument parsing whenever--startis passed, making it impossible to log a time entry for a past interval.clickup-cli time list --startis unaffected.The panic comes from clap, not from the API layer — it happens before any network call.
Version / environment
clickup-cli 0.14.0Darwin arm64npm i -g @nick.bester/clickup-cliReproduction
clickup-cli time create --start 1753800000000 --duration 3600000Exit code
101. Same panic for:Blast radius
--starttime create1753800000000time update <id>1753800000000time list1753800000000comment list --task <id>Likely cause
clickup-cli time create --helpshows two semantically different--start-family options on the same command:The global/shared option block appears to register
--startas the comment-pagination boundary (a string), whiletime create/time updateregister their own--startas a numeric Unix-ms timestamp. clap stores the value under one type and the subcommand reads it back as the other, soArgMatches::get_one::<T>("start")fails the downcast and panics.time listpresumably survives because its--startis declared as a string (--start ISO|ms), matching what the shared block registered.Two things worth noting:
--start-id,--cursor,--page,--limit,--all) are surfaced ontime create, where none of them apply. Scoping the pagination block to the commands that actually paginate would remove the collision at the source.Command::debug_assert()in a test would have caught it before release.Expected
time create --start <ms> --duration <ms>creates the entry and prints it, matching the documented usage intime create --help.