{"record":{"id":"9f0795b6926da6a6","repo":"google-gemini/gemini-cli","slug":"no-response-from-remote-agent","errorCode":null,"errorMessage":"No response from remote agent.","messagePattern":"No response from remote agent\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/agents/remote-invocation.ts","lineNumber":217,"sourceCode":"            result: reassembler.toString(),\n          });\n        }\n\n        const {\n          contextId: newContextId,\n          taskId: newTaskId,\n          clearTaskId,\n        } = extractIdsFromResponse(chunk);\n\n        if (newContextId) {\n          this.contextId = newContextId;\n        }\n\n        this.taskId = clearTaskId ? undefined : (newTaskId ?? this.taskId);\n      }\n\n      if (!finalResponse) {\n        throw new Error('No response from remote agent.');\n      }\n\n      const finalOutput = reassembler.toString();\n\n      debugLogger.debug(\n        `[RemoteAgent] Final response from ${this.definition.name}:\\n${JSON.stringify(finalResponse, null, 2)}`,\n      );\n\n      const finalProgress: SubagentProgress = {\n        isSubagentProgress: true,\n        agentName,\n        state: SubagentState.COMPLETED,\n        result: finalOutput,\n        recentActivity: reassembler.toActivityItems(),\n      };\n\n      if (updateOutput) {\n        updateOutput(finalProgress);","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/core/src/agents/remote-invocation.ts#L199-L235","documentation":"Thrown at the end of RemoteAgentInvocation.execute() when the message stream completed without yielding a single chunk — finalResponse stayed undefined. The transport did not error and was not aborted; it simply produced zero SendMessageResult items.","triggerScenarios":"for await (const chunk of stream) never assigns finalResponse because the async iterator returned immediately with no items; the post-loop check `if (!finalResponse)` fires.","commonSituations":"Remote A2A server accepted the request but produced no events before closing the stream (server crash, empty task, misbehaving agent); a network/proxy layer closed the SSE/streaming connection without relaying anything; the agent's first action failed silently server-side; version skew between client and server streaming contract.","solutions":["Retry once — transient empty streams can occur on remote hiccups.","Confirm the remote A2A server is healthy and emits at least one message for the given query.","Check sendMessageStream input: ensure contextId/taskId (if resumed) are valid; a stale contextId can yield no output.","Inspect server-side logs for the task; if using a stored taskId, clear session state to start a fresh task.","Verify the client and server agree on the A2A streaming protocol version."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Health-check the remote agent before relying on it.\nasync function pingRemote(clientManager, name) {\n  const stream = clientManager.sendMessageStream(name, 'ping', {});\n  let got = false;\n  for await (const _ of stream) { got = true; break; }\n  if (!got) throw new Error('Remote agent produced no response on ping');\n}","typeGuard":null,"tryCatchPattern":"let attempt = 0;\nfor (;;) {\n  try {\n    return await invocation.execute(opts);\n  } catch (e) {\n    if (e instanceof Error && /No response from remote agent/.test(e.message) && attempt++ < 2) {\n      // clear stale session state and retry once\n      continue;\n    }\n    throw e;\n  }\n}","preventionTips":["Clear stale contextId/taskId before retrying a resumed task.","Monitor remote A2A server health.","Confirm protocol-version compatibility between client and server."],"tags":["a2a","agents","network","empty-response"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}