Skip to content

bug: --stream polling fallback drops the error cause, reports internal instead of protocol #78

Description

@ConnorMoss02

Which area does this relate to?

  • CLI code

What happened?

When an agent doesn't support streaming, send --stream falls back to polling. If polling fails, the error has no cause, so it returns A2ACLI_ERR_INTERNAL with no a2aCode. task get --wait on the same task returns A2ACLI_ERR_PROTOCOL with a2aCode: TASK_NOT_FOUND.

internal/polling/polling.go:113 builds the error without %w err. The same check in WaitForTask (line 48) includes it.

Steps to reproduce

  1. Start a stub agent:
python3 - <<'PY'
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
CARD={"name":"stub","description":"stub","version":"1","capabilities":{"streaming":False},
 "defaultInputModes":["text/plain"],"defaultOutputModes":["text/plain"],"skills":[],
 "supportedInterfaces":[{"url":"http://127.0.0.1:18082/rpc","protocolBinding":"JSONRPC","protocolVersion":"1.0"}]}
class H(BaseHTTPRequestHandler):
    def reply(self,o):
        b=json.dumps(o).encode(); self.send_response(200); self.send_header("Content-Type","application/json")
        self.send_header("Content-Length",str(len(b))); self.end_headers(); self.wfile.write(b)
    def do_GET(self): self.reply(CARD)
    def do_POST(self):
        r=json.loads(self.rfile.read(int(self.headers["Content-Length"])))
        if r["method"]=="SendMessage":
            return self.reply({"jsonrpc":"2.0","id":r["id"],"result":{"task":{"id":"t-1","contextId":"c-1","status":{"state":"TASK_STATE_WORKING"}}}})
        self.reply({"jsonrpc":"2.0","id":r["id"],"error":{"code":-32001,"message":"task not found"}})
HTTPServer(("127.0.0.1",18082),H).serve_forever()
PY
  1. a2a task get -a http://127.0.0.1:18082 -o json --wait t-1 returns A2ACLI_ERR_PROTOCOL, a2aCode: TASK_NOT_FOUND.
  2. a2a send -a http://127.0.0.1:18082 -o json --stream hi returns:
{"error":{"code":"A2ACLI_ERR_INTERNAL","message":"streaming error: successive polling failure threshold exceeded for task \"t-1\""}}

CLI version

main @ f510ea4

Operating system & environment

macOS (Darwin 25.6.0), arm64

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions