Skip to content

agentcore invoke local log always shows Session ID: none even when --session-id is provided #890

@jimhanmer

Description

@jimhanmer

Description

When using agentcore invoke with --session-id, the local CLI log files always record Session ID: none in the header. The session ID is correctly sent to Runtime (confirmed via CloudWatch GenAI Observability sessions console), so this is a logging-only issue.

Steps to Reproduce

  1. Run agentcore invoke "Testing session ID logging" --session-id test-session-id-logging-000000001 --stream
  2. Check the local log file in <project>/agentcore/.cli/logs/invoke/

Expected Behavior

Log header shows Session ID: test-session-id-logging-000000001.

Actual Behavior

Log header shows Session ID: none:

================================================================================
AGENTCORE INVOKE LOG
Agent: itresearchagent
Session ID: none
Started: 2026-04-19T10:43:13.160Z
================================================================================

[11:43:13.161] INVOKE REQUEST (Session: none)

--- REQUEST ---
{
  "timestamp": "2026-04-19T10:43:13.161Z",
  "agent": "itresearchagent",
  "runtimeArn": "arn:aws:bedrock-agentcore:eu-west-1:...",
  "region": "eu-west-1",
  "prompt": "Testing session ID logging"
}

The session ID does reach Runtime — it appears correctly in the CloudWatch GenAI Observability sessions view.

Related

CLI Version

0.9.1 (@aws/agentcore)

Operating System

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions