Skip to content

Invoking (with Auth) without session ID returns error #840

@rhbelson

Description

@rhbelson

Description

Once you convert your agent's inbound auth from Sigv4 to OAuth and forget to provide a Session ID, the CLI should return more verbose message such as Please specify session ID or, better yet, generate automatically.
agentcore invoke --bearer-token $BEARER_TOKEN "<your prompt>"

Error: 1 validation error for AgentCoreMemoryConfig
session_id
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.13/v/string_type

Log: /home/sagemaker-user/agentcore-runtime-quickstart/personalAgent/agentcore/.cli/logs/invoke/invoke-personalAgent-20260414-035442.log

Steps to Reproduce

  1. Deploy agent with Sigv4 inbound auth
  2. Switch auth to OAuth (I was using Cognito User Pools)
  3. Generate validate bearer token and forget to pass session ID to invoke function

Expected Behavior

Either:

  1. CLI generates valid session ID
  2. CLI errors "Error: please provide valid session Id using --session-id

Actual Behavior

Error: 1 validation error for AgentCoreMemoryConfig
session_id
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.13/v/string_type

Log: /home/sagemaker-user/agentcore-runtime-quickstart/personalAgent/agentcore/.cli/logs/invoke/invoke-personalAgent-20260414-035442.log

CLI Version

No response

Operating System

macOS

Additional Context

No response

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