Skip to content

[CLI] Misc parser/type bugs: cobra eats -X.Y, perp :USDT doubling, --invested-after type mismatch #10

Description

@JamesDaizs

Summary

Three small but reproducible CLI/argument-parsing bugs surfaced in the CAIA-bench batch. Bundled because each is a one-line fix.

Bug 1 — Cobra parser consumes -X.Y substrings inside --q

surf search-web --q "Kit AI ... -voice -s.ai"invalid argument "s.ai" for "-t, --rsh-timeout" flag: time: invalid duration "s.ai". The cobra parser is treating -s as the -t short alias.

Fix: require --q="..." form OR ---terminate, OR use cobra.UnknownFlags() for the search subcommands.

Reproducer: pi-grok-4-2/GT071.

Bug 2 — exchange-perp re-appends :QUOTE even when input has it

Input BTCUSDT → API call BTCUSDT:USDT. Input BTC/USDT → API call BTC/USDT:USDT. Result: 8 NOT_FOUND errors.

Fix:

if !strings.Contains(symbol, ":") {
    symbol += ":" + quote
}

Reproducer: claude-opus-oauth/GT082.

Bug 3 — fund-portfolio --invested-after is int-typed but documented like a date

surf fund-portfolio --id <uuid> --invested-after 2023-01-01invalid argument "2023-01-01" for "--invested-after" flag: strconv.ParseInt: parsing "2023-01-01": invalid syntax.

Fix: accept date string AND int (parse string as ISO date), OR rename to --invested-after-ts with clear int docs.

Reproducer: pi-grok-4-2/GT058.

Source

cyberconnecthq/research-evalreviews/surf_cli_vulns.md sections D9, E1, E2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions