t8y2/dbx · error
agent did not become ready: %s
Error message
agent did not become ready: %s
What it means
After a successful Scan, startAgent validates the readiness line contains "ready":true. If the first stdout line is something else, the agent is killed and this error includes the unexpected text verbatim, signaling a protocol violation on the startup handshake.
Source
Thrown at agents/drivers/rabbitmq/bench/agent_compare.go:328
stdout, err := process.command.StdoutPipe()
if err != nil {
return nil, 0, err
}
process.command.Stderr = os.Stderr
process.stdin = stdin
process.reader = bufio.NewScanner(stdout)
process.reader.Buffer(make([]byte, 64*1024), 512*1024*1024)
start := time.Now()
if err := process.command.Start(); err != nil {
return nil, 0, err
}
if !process.reader.Scan() {
process.kill()
return nil, 0, fmt.Errorf("agent did not become ready: %v", process.reader.Err())
}
if !strings.Contains(process.reader.Text(), `"ready":true`) {
process.kill()
return nil, 0, fmt.Errorf("agent did not become ready: %s", process.reader.Text())
}
return process, time.Since(start), nil
}
func (process *agentProcess) call(method string, params map[string]any) (json.RawMessage, error) {
process.nextID++
request := map[string]any{
"jsonrpc": "2.0",
"id": process.nextID,
"method": method,
"params": params,
}
payload, err := json.Marshal(request)
if err != nil {
return nil, err
}
if _, err := process.stdin.Write(append(payload, '\n')); err != nil {
return nil, errView on GitHub (pinned to c0390bff16)
Solutions
- Configure all agent logging to stderr, keeping stdout for the JSON protocol
- Confirm the agent prints {"ready":true} exactly once as the first stdout line
- Align the agent version with what the benchmark expects (ready-line contract)
- Inspect the %s text in the error to see exactly what was emitted instead
Example fix
// before
log.Printf("agent starting") // goes to stdout by default in some setups
fmt.Println(`{"ready":true}`)
// after
log.SetOutput(os.Stderr)
fmt.Println(`{"ready":true}`) Defensive patterns
Strategy: validation
Validate before calling
// enforce stdout purity: in the agent, before anything else
if os.Getenv("AGENT_PROTOCOL_STDOUT") == "1" {
log.SetOutput(os.Stderr)
} Try / catch
if err != nil && strings.Contains(err.Error(), "agent did not become ready") {
log.Fatalf("ready-line protocol violation: %v", err)
} Prevention
- Keep stdout reserved exclusively for the JSON protocol
- Add a startup handshake integration test comparing the first stdout line
- Pin agent versions in the benchmark matrix to match the ready-line contract
When it happens
Trigger: The agent emits a log line, warning, or banner on stdout as its first output instead of the JSON readiness line, or prints a readiness line with different formatting (e.g. "ready": false or plain text).
Common situations: A logging library configured to write INFO logs to stdout pollutes the handshake; agent version changed its ready-line format; agent prints deprecation warnings before readiness.
Related errors
- timed out waiting for agent readiness
- agent did not become ready: %v
- Unknown method: {method}
- Unknown method: <method>
- agent exited before {method}
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/0678202866cc453b.
Report an issue: GitHub.