{"record":{"id":"b0dea41fd7a49fe0","repo":"chenhg5/cc-connect","slug":"missing-q","errorCode":null,"errorMessage":"missing --q","messagePattern":"missing --q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/tuitui.go","lineNumber":76,"sourceCode":"\turl        string\n\toutDir     string\n\tmaxBytes   int64\n\tchannelID  string\n\tparentID   string\n\tmessage    string\n\tstdin      bool\n}\n\nfunc runTuiTuiMessages(command string, args []string) {\n\topts, err := parseTuiTuiArgs(args)\n\tif err != nil {\n\t\tfatalTuiTui(err)\n\t}\n\tif opts.chatID == \"\" {\n\t\tfatalTuiTui(errors.New(\"missing --chat\"))\n\t}\n\tif command == \"search\" && strings.TrimSpace(opts.query) == \"\" {\n\t\tfatalTuiTui(errors.New(\"missing --q\"))\n\t}\n\tp, err := loadTuiTuiPlatform(opts)\n\tif err != nil {\n\t\tfatalTuiTui(err)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)\n\tdefer cancel()\n\tresult, err := p.FetchHistory(ctx, opts.chatID, opts.chatType, tuitui.HistoryOptions{\n\t\tRelativeTime: opts.relative,\n\t\tStartTime:    opts.startTime,\n\t\tEndTime:      opts.endTime,\n\t\tCursor:       opts.cursor,\n\t\tLimit:        opts.limit,\n\t\tOrderAsc:     opts.orderAsc,\n\t})\n\tif err != nil {\n\t\tfatalTuiTui(err)\n\t}","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/tuitui.go#L58-L94","documentation":"A sentinel validation error raised by runTuiTuiMessages when the tuitui subcommand is 'search' but the parsed options contain a blank/whitespace --q value. It fires because the search operation requires a query string and none was supplied (or it was only whitespace).","triggerScenarios":"Running `cc-connect tuitui search --chat <id>` without `--q <query>`, or with `--q \"   \"` (whitespace only).","commonSituations":"Building the command dynamically and an empty query variable, quoting issues that swallow the argument, or forgetting search needs both --chat and --q.","solutions":["Add a non-empty `--q <search term>` argument","Quote the query if it contains spaces: `--q \"deploy failed\"`","Check that the variable holding the query is not empty in your script"],"exampleFix":"// before\ncc-connect tuitui search --chat oc_123 --q \"\"\n// after\ncc-connect tuitui search --chat oc_123 --q \"deploy failed\"","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(query) == \"\" {\n    return errors.New(\"search requires a non-empty --q\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote search terms containing spaces","Assert query variables are non-empty in scripts before calling the CLI","Remember search requires both --chat and --q"],"tags":["cli","tuitui","arguments","search"],"backgroundTag":"missing-required-flag","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}