quant.cpp icon indicating copy to clipboard operation
quant.cpp copied to clipboard

quantcpp "prompt" backwards-compat mode broken in v0.12.x

Open unamedkr opened this issue 7 months ago • 1 comments

Description

The backwards-compatible one-shot mode documented in quantcpp --help and README does not work in v0.12.1.

Steps to Reproduce

pip install quantcpp  # v0.12.1
quantcpp "What is gravity?"

Expected Behavior

Model auto-downloads and generates a response (as documented):

backwards-compat (no subcommand):
  quantcpp "What is gravity?"       # one-shot

Actual Behavior

error: argument command: invalid choice: 'What is gravity?' (choose from pull, list, run, serve, client)

Root Cause

The argparse subcommand parser treats the first positional argument as a subcommand name. When a quoted prompt string is passed without a subcommand, argparse fails because "What is gravity?" is not in the subcommand choices.

Impact

  • Severity: P0 — The README's first example (quantcpp "What is gravity?") fails immediately
  • First-time users hit this on their very first interaction
  • The --help output documents this mode but it doesn't work

Suggested Fix

Add fallback logic: if the first positional arg is not a known subcommand, treat it as a prompt and enter one-shot mode. Alternatively, use argparse with nargs='?' for the subcommand or a custom parser.

Environment

  • quantcpp: 0.12.1 (PyPI)
  • Python: 3.14.3
  • OS: macOS 15 (Apple M3)

Reported by ClawTeam Claw-1 (Quickstart persona)

unamedkr avatar Apr 12 '26 01:04 unamedkr

Fixed: backwards-compat mode restored. When the first positional arg is not a known subcommand (pull/list/run/serve/client), it falls through to a compat parser that treats it as a prompt. quantcpp "What is gravity?" now works as documented.

unamedkr avatar Apr 12 '26 03:04 unamedkr