666ghj/MiroFish · error · Error

t('step5.noResponse')

Error message

t('step5.noResponse')

What it means

Thrown in sendToAgent when the interviewAgents call succeeded (res.success && res.data) but the per-agent response could not be extracted: the results dictionary (keys like reddit_<id> / twitter_<id>) had no entry for the selected agent_id, or the entry existed but contained neither response nor answer. It marks a shape/empty-content mismatch between what the backend interview pipeline returned and what the component expects.

Source

Thrown at frontend/src/components/Step5Interaction.vue:769

      const twitterKey = `twitter_${agentId}`
      const agentResult = resultsDict[redditKey] || resultsDict[twitterKey] || Object.values(resultsDict)[0]
      if (agentResult) {
        responseContent = agentResult.response || agentResult.answer
      }
    } else if (Array.isArray(resultsDict) && resultsDict.length > 0) {
      // 兼容数组格式
      responseContent = resultsDict[0].response || resultsDict[0].answer
    }
    
    if (responseContent) {
      chatHistory.value.push({
        role: 'assistant',
        content: responseContent,
        timestamp: new Date().toISOString()
      })
      addLog(t('log.agentReplied', { name: selectedAgent.value.username }))
    } else {
      throw new Error(t('step5.noResponse'))
    }
  } else {
    throw new Error(res.error || t('step5.requestFailed'))
  }
}

const scrollToBottom = () => {
  nextTick(() => {
    if (chatMessages.value) {
      chatMessages.value.scrollTop = chatMessages.value.scrollHeight
    }
  })
}

// Survey Methods
const toggleAgentSelection = (idx) => {
  const newSet = new Set(selectedAgents.value)
  if (newSet.has(idx)) {

View on GitHub (pinned to b5b53acc57)

Solutions

  1. Log the raw resultsDict (res.data.result.results) when the error fires to see which keys the backend actually returned.
  2. Check the backend interview/simulation logs for the failing agent_id to find the worker or LLM failure.
  3. Confirm the key mapping: the component looks up `reddit_${agentId}` then `twitter_${agentId}` then the first value — verify agentId matches the backend's numbering.
  4. If keys exist but values are empty, fix the LLM call for that agent (prompt/model/timeout) server-side.
  5. Add a schema check on the backend so it always returns response or answer per requested agent_id, or an explicit per-agent error entry.

Example fix

// before
if (agentResult) {
  responseContent = agentResult.response || agentResult.answer
}
// ...
} else {
  throw new Error(t('step5.noResponse'))
}

// after - include the agent id and returned keys for diagnosis
if (agentResult) {
  responseContent = agentResult.response || agentResult.answer
}
// ...
} else {
  throw new Error(
    t('step5.noResponse') +
    ` (agent_id=${agentId}, keys=${Object.keys(resultsDict).join(',')})`
  )
}
Defensive patterns

Strategy: type-guard

Validate before calling

const resultData = res.data.result || res.data
const resultsDict = resultData.results || resultData
const agentId = selectedAgentIndex.value
const hasEntry =
  (typeof resultsDict === 'object' && resultsDict !== null && !Array.isArray(resultsDict) &&
    (resultsDict[`reddit_${agentId}`] || resultsDict[`twitter_${agentId}`] || Object.values(resultsDict).length > 0)) ||
  (Array.isArray(resultsDict) && resultsDict.length > 0)

Type guard

function extractAgentResponse(resultsDict, agentId) {
  if (Array.isArray(resultsDict)) {
    const hit = resultsDict[0]
    return hit?.response ?? hit?.answer ?? null
  }
  if (resultsDict && typeof resultsDict === 'object') {
    const entry = resultsDict[`reddit_${agentId}`] || resultsDict[`twitter_${agentId}`] || Object.values(resultsDict)[0]
    return entry?.response ?? entry?.answer ?? null
  }
  return null
}

Try / catch

try {
  const responseContent = extractAgentResponse(resultsDict, agentId)
  if (!responseContent) {
    throw new Error(`${t('step5.noResponse')} (agent_id=${agentId}, keys=${Object.keys(resultsDict).join(',')})`)
  }
  /* push assistant message */
} catch (err) {
  addLog(t('log.sendFailed', { error: err.message }))
}

Prevention

When it happens

Trigger: interviewAgents returns results keyed for different agent ids (e.g. reddit_0 exists but user selected agent 2); the platform worker for that agent crashed so its key is missing; the LLM returned an empty string so response/answer are empty; or the backend changed its results schema (renamed fields, nested deeper).

Common situations: Agent id mismatch after profiles list and results list get out of sync (frontend indexes by array position, backend by platform agent id); one social-platform worker failing silently in a multi-platform simulation; upstream schema drift after a backend update; LLM returning empty content under strict token limits.

Related errors


AI-assisted analysis of 666ghj/MiroFish@b5b53acc57 (2026-08-14). Data as JSON: /api/errors/98932e5954474d4a. Report an issue: GitHub.