{"record":{"id":"60401771bb5af070","repo":"bytedance/deer-flow","slug":"failed-to-submit-feedback-res-status","errorCode":null,"errorMessage":"Failed to submit feedback: ${res.status}","messagePattern":"Failed to submit feedback: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/core/api/feedback.ts","lineNumber":26,"sourceCode":"  comment: string | null;\n}\n\nexport async function upsertFeedback(\n  threadId: string,\n  runId: string,\n  rating: number,\n  comment?: string,\n): Promise<FeedbackData> {\n  const res = await fetch(\n    `${getBackendBaseURL()}/api/threads/${encodeURIComponent(threadId)}/runs/${encodeURIComponent(runId)}/feedback`,\n    {\n      method: \"PUT\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify({ rating, comment: comment ?? null }),\n    },\n  );\n  if (!res.ok) {\n    throw new Error(`Failed to submit feedback: ${res.status}`);\n  }\n  return res.json();\n}\n\nexport async function deleteFeedback(\n  threadId: string,\n  runId: string,\n): Promise<void> {\n  const res = await fetch(\n    `${getBackendBaseURL()}/api/threads/${encodeURIComponent(threadId)}/runs/${encodeURIComponent(runId)}/feedback`,\n    { method: \"DELETE\" },\n  );\n  if (!res.ok && res.status !== 404) {\n    throw new Error(`Failed to delete feedback: ${res.status}`);\n  }\n}\n","sourceCodeStart":8,"sourceCodeEnd":43,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/core/api/feedback.ts#L8-L43","documentation":"Raised when default_peer_id fails is_safe_peer_id: it must start with a lowercase letter or digit, be at most 64 characters, and contain only lowercase letters, digits, '_' or '-'. Peer ids become actor identifiers inside OpenViking, so the charset is restricted to keep them canonical and safe.","triggerScenarios":"Setting default_peer_id to a value with uppercase letters, spaces, dots, or other disallowed characters, one longer than 64 chars, or one starting with '_' or '-'. Accidental forms include 'DeerFlow', 'deer flow', 'deer.flow', 'agent#1'.","commonSituations":"Using a display name or email as the peer id; migrating from a system with wider identifier rules; generated ids containing uppercase UUID hex; copy-paste adding a trailing space or unicode lookalike.","solutions":["Rewrite the id to the allowed charset: lowercase letters, digits, '_', '-'; start with a letter or digit; max 64 chars, e.g. deerflow, agent-main, worker_2.","If the id is generated, normalize first: value.lower() or uuid4().hex.","Check for invisible whitespace or unicode with repr(value)."],"exampleFix":"# before\nbackend_config:\n  default_peer_id: DeerFlow Agent\n\n# after\nbackend_config:\n  default_peer_id: deerflow-agent","handlingStrategy":"type-guard","validationCode":"import re\n\nSAFE_PEER_ID_RE = re.compile(r'^[a-z0-9][a-z0-9_-]{0,63}$')\n\n\ndef normalize_peer_id(value: str) -> str:\n    slug = re.sub(r'[^a-z0-9_-]+', '-', value.lower()).strip('-')\n    return slug[:64] or 'peer'","typeGuard":"def is_safe_peer_id(value: str) -> bool:\n    import re\n    return bool(re.fullmatch(r'[a-z0-9][a-z0-9_-]{0,63}', value))","tryCatchPattern":null,"preventionTips":["Generate peer ids programmatically: uuid4().hex or slugified lowercase names.","Reject human display names as peer ids at the input boundary.","Unit-test id normalization before it reaches config."],"tags":["openviking","configuration","validation","identifiers"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}