fix(hyperguild): remove redundant subcommand prefixes from error messages

dispatch() already prefixes errors with 'hyperguild <subcmd>: ', so
handlers re-prefixing with their own name produced stuttered output
like 'hyperguild brain: brain query: topic required'. Strip the
redundant prefixes from the seven affected errors.New / fmt.Errorf
calls in brain.go and mode.go.

Also fix the LITELLM_BASE_URL usage text — it's optional (empty
falls through to airplane tier), not required, matching the
README.
This commit is contained in:
2026-05-03 22:06:33 +02:00
parent 317ec20392
commit ab4cfaaeb7
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ func runMode(ctx context.Context, args []string, _ io.Reader, stdout, stderr io.
// Pull the first positional (mode name) out so flags after it still parse
// with stdlib flag (which stops at the first non-flag arg).
if len(args) < 1 {
return errors.New("mode: name required (cloud|client-local|sovereign)")
return errors.New("name required (cloud|client-local|sovereign)")
}
name := args[0]
if err := fs.Parse(args[1:]); err != nil {
@@ -39,12 +39,12 @@ func runMode(ctx context.Context, args []string, _ io.Reader, stdout, stderr io.
case "sovereign":
doc = modeSovereign(brainURL)
default:
return fmt.Errorf("mode: unknown mode: %s (expected cloud|client-local|sovereign)", name)
return fmt.Errorf("unknown mode: %s (expected cloud|client-local|sovereign)", name)
}
if !*force {
if _, err := os.Stat(*out); err == nil {
return fmt.Errorf("mode: %s exists (use --force to overwrite)", *out)
return fmt.Errorf("%s exists (use --force to overwrite)", *out)
}
}