{"record":{"id":"33456fc3d247a1f1","repo":"chenhg5/cc-connect","slug":"missing-chat","errorCode":null,"errorMessage":"missing --chat","messagePattern":"missing --chat","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/tuitui.go","lineNumber":73,"sourceCode":"\tlimit      int\n\torderAsc   *bool\n\tquery      string\n\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})","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/tuitui.go#L55-L91","documentation":"runTuiTuiMessages requires a target chat for the `messages` command; if parseTuiTuiArgs leaves opts.chatID empty it aborts via fatalTuiTui. The CLI cannot know which conversation to fetch without --chat.","triggerScenarios":"Running `cc-connect tuitui messages` (or `search`) without passing `--chat <id>` on the command line.","commonSituations":"Forgetting the flag when scripting, assuming a default chat exists (none does), or copying a command example that omitted the argument.","solutions":["Add `--chat <chat_id>` to the tuitui command","Find the chat id via `cc-connect tuitui search --chat <id> --q <term>` after supplying a known chat, or from the platform UI","Run `cc-connect tuitui --help` to confirm the flag name"],"exampleFix":"// before\ncc-connect tuitui messages\n// after\ncc-connect tuitui messages --chat oc_123456","handlingStrategy":"validation","validationCode":"if len(os.Args) > 0 && !slices.Contains(os.Args, \"--chat\") {\n    return errors.New(\"missing --chat\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --chat explicitly; there is no default chat","Store the chat id in a script variable and assert it is non-empty before invoking","Check `cc-connect tuitui --help` when unsure which subcommand needs which flag"],"tags":["cli","tuitui","arguments"],"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-14T00:17:10.932Z"}