Skip to content

[Hackathon] fix(doctor): use the shared parseRequestTimeoutFlag — local copy's message has drifted #364

Open

Description

@iamfirst

Verified against (commit SHA or released version)

commit 988c035 (v0.14.0)

Discord Username / User ID

outrageous_guava_90469_03877

What does this improvement do?

Every command validates --request-timeout through the shared
parseRequestTimeoutFlag in src/lib/client-factory.ts — except doctor,
which still carries a private copy in src/commands/doctor.ts (around
line 507). The shared helper's own comment says it replaced five identical
copies because drift between them would silently change timeout behaviour
depending on the command. The doctor copy was missed, and its error
message has already drifted from the shared one.

Details / implementation notes

Verified against commit 988c0355bb05631e9c6c1785e443937ff2a88c0e
(v0.14.0), built from source, Node v24.20.0, Linux x86_64:

$ testsprite doctor --request-timeout abc
Error: Invalid request.
Flag `--request-timeout` is invalid: must be a positive number of seconds (got "abc").

$ testsprite project list --dry-run --request-timeout abc
Error: Invalid request.
Flag `--request-timeout` is invalid: "abc" is not valid — must be a positive number of seconds.

$ testsprite auth status --request-timeout abc
Error: Invalid request.
Flag `--request-timeout` is invalid: "abc" is not valid — must be a positive number of seconds.
Same flag, same bad input — two different messages depending on the command.
Expected
doctor produces the same validation error as every other command, from
the single shared implementation, so the wording (and any future behaviour
change) cannot drift per command again.
Actual
doctor resolves its common options through its own local
parseRequestTimeoutFlag copy instead of importing the shared one from
src/lib/client-factory.ts, and the copy's message wording differs.
Suggested fix
Delete the local copy in src/commands/doctor.ts and import
parseRequestTimeoutFlag from ../lib/client-factory.js, like the other
commands do. Align any doctor tests that reference the old wording.
No behaviour change beyond the message text: both copies reject the same
inputs with exit 5 today.
Environment
CLI version: 0.14.0 (built from source at 988c035)
Node: v24.20.0
OS: Linux x86_64


### Confirmations

- [x] I have searched existing issues and this is not a duplicate.
- [x] I have provided my Discord identity above for reward coordination.

Activity

  1. iamfirst commented on Oct 10, 2026

    @iamfirst
    Author

    /assign

  2. testsprite-hob commented on Oct 10, 2026

    @testsprite-hob

    Thanks for the interest, @iamfirst! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it accepted once it is). Feel free to check back, or ping us on Discord if it's been quiet.

  3. x15967311210-crypto commented on Oct 11, 2026

    @x15967311210-crypto

    PR #370 is up for this one: it deletes the doctor-local parseRequestTimeoutFlag and imports the shared helper, plus a wiring test that pins doctor's message to the shared wording (verified non-vacuous — the test fails against the previous doctor.ts).

    Linking it here so it can be triaged. Getting this accepted would let the issue be claimed and the PR gate pass. Thanks!

  4. iamfirst commented on Oct 12, 2026

    @iamfirst
    Author

    Hi, I'm the author of this issue and I commented /assign on Oct 10 — I already have this fix ready locally and plan to open my PR when the hackathon window opens on Oct 16. Noting this so the claim order is clear during triage. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hackathonCLI hackathon submissionsneeds-triageNew issue/PR awaiting first triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions