Skip to content

Bug: Unexpected enableTrace Parameter Injection in BedrockFlowsAgent Calls #163

@guisartori88

Description

@guisartori88

Expected Behaviour

When invoking the BedrockFlowsAgent in a Lambda environment, setting enableTrace=False (or not specifying it at all) should result in no enableTrace parameter being sent to Bedrock. If enableTrace=True is supported as per documentation, it should also not cause the request to fail due to unknown parameters.

Current Behaviour

In AWS Lambda, requests to Bedrock Flows fail with the following error, whether enableTrace is not specified or explicitly set to True:

Parameter validation failed: Unknown parameter in input: "enableTrace", must be one of: flowAliasIdentifier, flowIdentifier, inputs

This issue does not occur when running the same code locally. It appears that enableTrace is being injected internally or not recognized by Bedrock, causing the Bedrock API to reject the payload.

Code snippet

from multi_agent_orchestrator.agents import BedrockFlowsAgent, BedrockFlowsAgentOptions

def my_flow_input_encoder(agent, input, **kwargs):
    # Minimal input encoder
    return {"inputs": {"file_key": input["inputs"]["file_key"]}}

# Tried both with and without enableTrace:
# - Without enableTrace parameter
# - With enableTrace=True as per documentation

sentiment_agent = BedrockFlowsAgent(BedrockFlowsAgentOptions(
    name="sentiment-agent",
    description="Agent for sentiment analysis",
    flowIdentifier="yy",
    flowAliasIdentifier="yy",
    flow_input_encoder=my_flow_input_encoder,
    # enableTrace=True or omitted entirely still causes the error
))

Possible Solution

Investigate if a specific library version or global configuration variable injects enableTrace unexpectedly.

Steps to Reproduce

  1. Deploy the above code to an AWS Lambda function with the multi_agent_orchestrator library.
  2. Attempt to invoke the function:
  • With enableTrace omitted.
  • With enableTrace=True included in BedrockFlowsAgentOptions.
  1. Observe the error indicating enableTrace is an unknown parameter, despite the local environment running the same code without issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions