{"record":{"id":"9c3a8f79b7a121b3","repo":"yikart/AiToEarn","slug":"no-response-from-gemini-9c3a8f","errorCode":null,"errorMessage":"No response from Gemini","messagePattern":"No response from Gemini","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"project/aitoearn-backend/apps/aitoearn-ai/src/core/agent/mcp/video-utils.mcp.ts","lineNumber":402,"sourceCode":"            parts: [\n              {\n                inlineData: {\n                  mimeType: 'audio/mp3',\n                  data: audioBuffer.toString('base64'),\n                },\n              },\n              { text: prompt },\n            ],\n          }],\n          config: {\n            responseMimeType: 'application/json',\n            responseJsonSchema: z.toJSONSchema(srtNodesSchema),\n          },\n        })\n\n        const responseText = response.text\n        if (!responseText) {\n          throw new Error('No response from Gemini')\n        }\n\n        const result = z.safeParse(srtNodesSchema, JSON.parse(responseText))\n        if (!result.success) {\n          throw new Error(`Invalid subtitle data: ${z.prettifyError(result.error)}`)\n        }\n        const subtitleData = result.data.map(node => ({\n          type: 'cue',\n          data: {\n            ...node,\n            start: srtTimestampToMs(node.start),\n            end: srtTimestampToMs(node.end),\n          },\n        } as const))\n\n        const srtContent = subtitle.stringifySync(subtitleData, { format: 'SRT' })\n\n        this.logger.debug('Uploading SRT file')","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-backend/apps/aitoearn-ai/src/core/agent/mcp/video-utils.mcp.ts#L384-L420","documentation":"revokeAuth requires accountId in the JSON body; when it is absent or empty the controller throws BadRequestException('accountId是必须的') before calling tikTokAuthService.revokeAuthorization. The authenticated system token is required but the account to revoke must also be named.","triggerScenarios":"POST to the revoke-auth route with a body that lacks accountId, sends { \"accountId\": \"\" }, or sends form-encoded data the JSON body parser doesn't pick up.","commonSituations":"Client forgets Content-Type: application/json so @Body('accountId') is undefined, payload key mismatch (e.g. account_id vs accountId), or the disconnect flow passes the wrong object to the API wrapper.","solutions":["Send JSON body { \"accountId\": \"<id>\" } with Content-Type: application/json.","Verify the payload key is exactly accountId (camelCase), not account_id.","Confirm the request is not sent as form-data/text where the body decorator yields undefined."],"exampleFix":"// before\nawait api.post('/plat/tiktok/auth/revoke', { account_id: id });\n// after\nawait api.post('/plat/tiktok/auth/revoke', { accountId: id }, { headers: { 'Content-Type': 'application/json' } });","handlingStrategy":"validation","validationCode":"const body = { accountId };\nif (!body.accountId) throw new Error('accountId是必须的');\nawait api.post('/plat/tiktok/auth/revoke', body, { headers: { 'Content-Type': 'application/json' } });","typeGuard":"function isRevokeBody(v): v is { accountId: string } {\n  return typeof v === 'object' && v !== null && typeof (v as any).accountId === 'string' && (v as any).accountId.length > 0;\n}","tryCatchPattern":"try {\n  await api.post('/plat/tiktok/auth/revoke', { accountId });\n} catch (e) {\n  if (e.response?.status === 400) console.error('请求体缺少accountId，检查序列化与Content-Type');\n  throw e;\n}","preventionTips":["Always set Content-Type: application/json for body-based endpoints","Use camelCase keys (accountId) matching the server DTO","Wrap API calls in typed client functions that require the parameter at compile time"],"tags":["validation","missing-parameter","request-body"],"backgroundTag":"missing-required-parameter","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}