Skip to content

[Bug]: Voice Agent agent.greeting makes the first aws_bedrock request assistant-first, which Bedrock rejects #760

Description

@dg-edcharbeneau

Summary

Setting agent.greeting with the aws_bedrock think provider sends Bedrock a conversation starting with role: assistant, which Converse rejects with ValidationException, killing the session on the first user utterance.

What happened?

Actual: The greeting is spoken normally. The first user utterance then fails. Deepgram relays AWS's error verbatim (this part is well done):

THINK_REQUEST_FAILED: Error making request to AWS Bedrock-style think provider.
  Details: ValidationException { message: "A conversation must start with a user message.
  Try again with a conversation that starts with a user message." }
FAILED_TO_THINK: Failed to think. Please check your agent.think settings.

It retries three times and then terminates the session.

Expected: greeting works the same across think providers, as it does for open_ai.

Cause, confirmed outside Deepgram

greeting is added to conversation history as an assistant turn, so the first Converse request is [assistant, user]. Bedrock rejects an assistant-first conversation. Calling converse_stream directly with the same shape reproduces the identical error with no Deepgram in the loop:

us.amazon.nova-micro-v1:0  + leading assistant message -> ValidationException (identical text)
us.amazon.nova-micro-v1:0  + leading user message      -> 'The capital of France is Paris.'

Note the validation is per-model, which is why this is easy to misattribute: openai.gpt-oss-120b-1:0 accepts an assistant-first conversation, so someone testing with that model sees a working greeting and blames something else.

Reproduces identically with real microphone audio through Flux turn detection and with InjectUserMessage.

Requested fix

Drop or reposition the greeting turn when building the first Bedrock request — omit an assistant-first message, or fold the greeting into the system prompt. Failing that, document that greeting is unsupported on aws_bedrock and warn at handshake time when both are set, since the two settings are individually valid and only conflict in combination.

Steps to reproduce

  1. pip install "websockets>=14"
  2. export DEEPGRAM_API_KEY=... and export AWS_REGION=us-east-2 AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
  3. python bedrock-repro.py — the same script attached to the linked issue
  4. Observe the ISSUE 2 block: identical Settings, greeting ON vs OFF.

Requires Bedrock model access for us.amazon.nova-micro-v1:0 in the target region. Use a model that enforces the rule — nova-micro does, gpt-oss-120b does not.

Observed output:

ISSUE 2 - greeting makes the first Bedrock request assistant-first
  nova-micro     / aws_bedrock  greeting ON                  FAILED THINK_REQUEST_FAILED, FAILED_TO_THINK
  nova-micro     / aws_bedrock  greeting OFF                 REPLIED 'The capital of France is Paris.'

Minimal code sample

# The ONLY difference between working and broken is the "greeting" key.
def settings(with_greeting):
    agent = {
        "listen": {"provider": {"type": "deepgram", "model": "flux-general-en", "version": "v2"}},
        "think": {
            "provider": {
                "type": "aws_bedrock",
                "model": "us.amazon.nova-micro-v1:0",   # enforces user-first; gpt-oss does not
                "credentials": {
                    "type": "iam",
                    "region": "us-east-2",
                    "access_key_id": "...",
                    "secret_access_key": "...",
                },
            },
            "endpoint": {"url": "https://bedrock-runtime.us-east-2.amazonaws.com/"},
            "prompt": "You are a helpful assistant. Keep responses brief.",
        },
        "speak": {"provider": {"type": "deepgram", "model": "flux-alexis-en"}},
    }
    if with_greeting:
        agent["greeting"] = "Hello! I'm a Deepgram voice agent. What would you like to talk about?"
    return {
        "type": "Settings",
        "audio": {
            "input": {"encoding": "linear16", "sample_rate": 24000},
            "output": {"encoding": "linear16", "sample_rate": 24000},
        },
        "agent": agent,
    }

# settings(False) -> 'The capital of France is Paris.'
# settings(True)  -> THINK_REQUEST_FAILED / FAILED_TO_THINK, session terminated

Logs / traceback

THINK_REQUEST_FAILED: Error making request to AWS Bedrock-style think provider.
  Details: ValidationException { message: "A conversation must start with a user message.
  Try again with a conversation that starts with a user message." }
FAILED_TO_THINK: Failed to think. Please check your agent.think settings.

(retried three times, then the session is terminated)

Environment

Field Value
Transport WebSocket
API endpoint / path /v1/agent/converse
Model(s) used us.amazon.nova-micro-v1:0 (rejects assistant-first); openai.gpt-oss-120b-1:0 (accepts it — masks the bug)
How often? Always
Is this a regression? No — not known to have ever worked
SDK version 7.6.0 (the repro itself uses no SDK — raw WebSocket)
Python version 3.13.14
Install method pip
OS macOS (Apple Silicon)

Repro talks to wss://agent.deepgram.com/v1/agent/converse directly with websockets, no Deepgram SDK, so this can't be attributed to SDK version or client-side serialization. AWS region us-east-2, IAM long-lived key, credentials type iam. Confirmed against Bedrock directly with boto3 converse_stream — the same [assistant, user] message shape produces the identical ValidationException with Deepgram entirely out of the loop.


A note on venue: server-side Voice Agent API defect rather than a Python SDK defect — the reproduction uses no SDK code. Filed here as the reachable public tracker for this surface; please transfer if there's a better home.

Provenance: output above is from a run on 2026-08-09 with working IAM credentials.


Related: #759 — the other aws_bedrock defect found in the same investigation. Together they make the BYO-Bedrock path unusable for a first-time user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions