Skip to content

System instability detected in Nova 2 sonic

1

I am using Nova-2 Sonic in the ap-northeast-1 region, and I am regularly encountering errors during live conversations. The system frequently returns the error “System instability detected.”

Error logs:

2025-12-17 08:48:32.461 | ERROR    | app.twilio_server.server:_process_responses:1839 - [AWS_STREAM] Unexpected receive error: ValidationException: System instability detected
2025-12-17 08:48:32.465 | WARNING  | app.twilio_server.server:_process_responses:2099 - [AWS_STREAM] Stream error (non-fatal): ValidationException: System instability detected

What is the reason for this error?

2 Answers
0

When encountering the "System instability detected" error with Amazon Nova Sonic, this is likely a validation exception that occurs during the streaming process.

To handle this error properly, you should follow these recommended steps:

  1. Send the promptEnd event
  2. Send the sessionEnd event
  3. If audio streaming has already started, also send the contentEnd event

These steps will help free up GPU resources and memory that might be causing the instability.

The error could be related to several factors:

  • Input validation issues where unsupported parameter values are being used
  • Resource constraints on the GPU or memory
  • Potential issues with the bidirectional streaming API

For more reliable operation, you might want to review your inference parameters. Setting the temperature to 0 (enabling greedy decoding) and ensuring your maximum token count is appropriate for your use case can help improve stability.

If the issue persists, you may need to implement a conversation resumption approach to recover from these errors and maintain the user experience.
Sources
Handling errors with Amazon Nova Sonic - Amazon Nova
Error handling - Amazon Nova
Tool usage - Amazon Nova

answered 10 months ago

0

I'm encurring in a similar situation. I'm using Strands Agents SDK with BidiAgent, with a very simple situation on AgentCore.

# Configure Nova Sonic model
sonic_model = BidiNovaSonicModel(
    model_id=MODEL_ID,
    provider_config={
        "audio": {
            "voice": "tiffany",
            "input_rate": INPUT_SAMPLE_RATE,
            "output_rate": OUTPUT_SAMPLE_RATE,
            "channels": CHANNELS,
            "format": FORMAT
        },
        "inference": {
            "temperature":0
        },
        "turn_detection": { # solo v2, opzionale
          "endpointingSensitivity": "MEDIUM",  # "HIGH" | "MEDIUM" | "LOW"
        },
    },
    client_config={
        "region": BEDROCK_REGION
    },
)

# Health check endpoint (required by AgentCore)
@app.get("/ping")
async def ping():
    """Health check endpoint for AgentCore Runtime"""
    return {"status": "Healthy", "time_of_last_update": int(datetime.now().timestamp())}

# WebSocket endpoint for bidirectional voice chat
@app.websocket("/ws")
async def voice_chat(websocket: WebSocket) -> None:
    """
    WebSocket endpoint for bidirectional voice streaming.

    Connects to the MCP endpoint to load tools (add, greet, echo) then runs
    the BidiAgent for the duration of the WebSocket connection.
    """
    mcp_tools = mcp_client.list_tools_sync()

    voice_agent = BidiAgent(
        model=sonic_model,
        tools=[*mcp_tools],
        hooks=[ToolCallLogger()],
        system_prompt=SYSTEM_PROMPT
    )

    try:
        await websocket.accept()
        print("WebSocket connection accepted")

        _greeting_sent = False

        async def receive_input():
            nonlocal _greeting_sent
            if not _greeting_sent:
                _greeting_sent = True
                # asyncio.sleep(0) yields to the event loop so _run_model registers
                # on the output stream before the greeting arrives.
                await asyncio.sleep(0)
                await voice_agent.send({"type": "bidi_text_input", "text": "Start conversation greeting the user.", "role": "user"})
            return await websocket.receive_json()

        await voice_agent.run(
            inputs=[receive_input],
            outputs=[websocket.send_json]
        )

    except WebSocketDisconnect:
        print("Client disconnected")
    except Exception as e:
        print(f"Error in voice chat: {e}")
        import traceback
        traceback.print_exc()
    finally:
        try:
            await voice_agent.stop()
        except Exception:
            pass
        try:
            await websocket.close()
        except Exception as cleanup_error:
            print(f"Error during WebSocket close: {cleanup_error}")

I have the temperature set to 0. I've changed max tokens parameter (128,512,1024). I've experienced this both in eu-north-1 than in us-east-1.

Both local and AgentCore environments got:

aws_sdk_bedrock_runtime.models.ValidationException: System instability detected

Full logs are:

[BACKEND] INFO:     connection open
[BACKEND] Traceback (most recent call last):
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/strands_agent.py", line 196, in voice_chat
[BACKEND]     await voice_agent.run(
[BACKEND]     ...<2 lines>...
[BACKEND]     )
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/agent/agent.py", line 392, in run
[BACKEND]     async with _TaskGroup() as task_group:
[BACKEND]                ~~~~~~~~~~^^
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/_async/_task_group.py", line 59, in __aexit__
[BACKEND]     raise cast(BaseException, exception)
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/agent/agent.py", line 379, in run_outputs
[BACKEND]     async for event in self.receive():
[BACKEND]         await asyncio.gather(*[output(event) for output in outputs])
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/agent/agent.py", line 294, in receive
[BACKEND]     async for event in self._loop.receive():
[BACKEND]         yield event
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/agent/loop.py", line 170, in receive
[BACKEND]     raise event
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/agent/loop.py", line 218, in _run_model
[BACKEND]     async for event in self._agent.model.receive():
[BACKEND]     ...<18 lines>...
[BACKEND]             )
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/strands/experimental/bidi/models/nova_sonic.py", line 369, in receive
[BACKEND]     event_data = await output.receive()
[BACKEND]                  ^^^^^^^^^^^^^^^^^^^^^^
[BACKEND]   File "/Users/davidedesio/Desktop/github/air-s2s-sonic-agent/agent/venv/lib/python3.13/site-packages/smithy_aws_event_stream/aio/__init__.py", line 154, in receive
[BACKEND]     raise value
[BACKEND] aws_sdk_bedrock_runtime.models.ValidationException: System instability detected
[BACKEND] INFO:     connection closed

Is there any official solution to this?

answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.