google-gemini/gemini-cli · error · Error

No response from remote agent.

Error message

No response from remote agent.

What it means

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.

Source

Thrown at packages/core/src/agents/remote-invocation.ts:217

            result: reassembler.toString(),
          });
        }

        const {
          contextId: newContextId,
          taskId: newTaskId,
          clearTaskId,
        } = extractIdsFromResponse(chunk);

        if (newContextId) {
          this.contextId = newContextId;
        }

        this.taskId = clearTaskId ? undefined : (newTaskId ?? this.taskId);
      }

      if (!finalResponse) {
        throw new Error('No response from remote agent.');
      }

      const finalOutput = reassembler.toString();

      debugLogger.debug(
        `[RemoteAgent] Final response from ${this.definition.name}:\n${JSON.stringify(finalResponse, null, 2)}`,
      );

      const finalProgress: SubagentProgress = {
        isSubagentProgress: true,
        agentName,
        state: SubagentState.COMPLETED,
        result: finalOutput,
        recentActivity: reassembler.toActivityItems(),
      };

      if (updateOutput) {
        updateOutput(finalProgress);

View on GitHub (pinned to 5024443c72)

Solutions

  1. Retry once — transient empty streams can occur on remote hiccups.
  2. Confirm the remote A2A server is healthy and emits at least one message for the given query.
  3. Check sendMessageStream input: ensure contextId/taskId (if resumed) are valid; a stale contextId can yield no output.
  4. Inspect server-side logs for the task; if using a stored taskId, clear session state to start a fresh task.
  5. Verify the client and server agree on the A2A streaming protocol version.
Defensive patterns

Strategy: retry

Validate before calling

// Health-check the remote agent before relying on it.
async function pingRemote(clientManager, name) {
  const stream = clientManager.sendMessageStream(name, 'ping', {});
  let got = false;
  for await (const _ of stream) { got = true; break; }
  if (!got) throw new Error('Remote agent produced no response on ping');
}

Try / catch

let attempt = 0;
for (;;) {
  try {
    return await invocation.execute(opts);
  } catch (e) {
    if (e instanceof Error && /No response from remote agent/.test(e.message) && attempt++ < 2) {
      // clear stale session state and retry once
      continue;
    }
    throw e;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12). Data as JSON: /api/errors/9f0795b6926da6a6. Report an issue: GitHub.