{"record":{"id":"07702e8c53a84867","repo":"chenhg5/cc-connect","slug":"yuanbao-bot-token-is-required-format-app-key-ap-07702e","errorCode":null,"errorMessage":"yuanbao: bot_token is required (format: app_key:app_secret)","messagePattern":"yuanbao: bot_token is required \\(format: app_key:app_secret\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/yuanbao/sign.go","lineNumber":201,"sourceCode":"\t\t}\n\t\tif result.Data == nil {\n\t\t\treturn nil, fmt.Errorf(\"yuanbao: sign token response missing data\")\n\t\t}\n\t\treturn &tokenData{\n\t\t\ttoken: result.Data.Token, botID: result.Data.BotID,\n\t\t\tduration: result.Data.Duration, product: result.Data.Product,\n\t\t\tsource: result.Data.Source,\n\t\t}, nil\n\t}\n\treturn nil, lastErr\n}\n\n// VerifyCredentials probes the sign-token API with app_key/app_secret and\n// returns the bot_id on success. Used by `cc-connect yuanbao setup` so users\n// see a clear error before the platform starts retrying on a background loop.\nfunc VerifyCredentials(appKey, appSecret, apiDomain, routeEnv string) (botID string, err error) {\n\tif strings.TrimSpace(appKey) == \"\" || strings.TrimSpace(appSecret) == \"\" {\n\t\treturn \"\", fmt.Errorf(\"yuanbao: bot_token is required (format: app_key:app_secret)\")\n\t}\n\tdata, err := fetchToken(appKey, appSecret, apiDomain, routeEnv)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(data.botID), nil\n}\n","sourceCodeStart":183,"sourceCodeEnd":209,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/yuanbao/sign.go#L183-L209","documentation":"VerifyCredentials rejects the call when either app_key or app_secret is empty/whitespace, before any network call is made. The yuanbao bot_token config value must be in `app_key:app_secret` format; this guard surfaces a config problem clearly during `cc-connect yuanbao setup` instead of letting the platform fail later in a background retry loop.","triggerScenarios":"Calling VerifyCredentials (or `cc-connect yuanbao setup`) with an empty bot_token, a token missing the `:` separator yielding an empty secret, or a value of only whitespace.","commonSituations":"Fresh install where bot_token was left empty in config.toml, user pasted only the app_key without the secret, or split the token into the wrong config fields.","solutions":["Set bot_token in config.toml to `app_key:app_secret`, e.g. bot_token = \"abc123:shhh-secret\".","Run `cc-connect yuanbao setup` to validate the token interactively before starting the platform.","Check for quoting mistakes that drop part of the value (secret containing special characters should be fine inside TOML quotes).","If the secret is stored in an env-injection system, confirm it is actually populated at daemon start."],"exampleFix":"// before (config.toml)\nbot_token = \"\"\n// after\nbot_token = \"app_key_value:app_secret_value\"","handlingStrategy":"validation","validationCode":"parts := strings.SplitN(strings.TrimSpace(botToken), \":\", 2)\nif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n    return errors.New(\"bot_token must be app_key:app_secret\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fill bot_token as app_key:app_secret in config.toml","Run `cc-connect yuanbao setup` to validate before daemon start","Fail fast at config-load time on empty credentials"],"tags":["config","validation","credentials"],"backgroundTag":"missing-required-config","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"}