发布

  • feat(cli): send x-cli-session-id header on every request (#3430)

    frostbyte_neo 发布于 2026-05-16 20:47:21 +00:00

    Summary

    • Pulls the per-cwd CLI session id (already generated by
      getCurrentCwdSessionId() and used as cli_session_id on analytics
      events) and attaches it as the x-cli-session-id header on every
      request from the composio client.
    • Backend reads the header off requestInfo, threads it through
      enrichSessionInfo, and writes session_info.cli_session_id on every
      tool execution log row.

    Companion hermes PR: ComposioHQ/hermes#9990

    Why

    The CLI already tracks a stable per-cwd session id for analytics, but
    tool execution logs are blind to it — there's no way to filter the logs
    UI / retool back to a single CLI session. Wiring the header through lets
    us group all tool calls from one CLI workflow together.

    Test plan

    • pnpm --filter @composio/cli typecheck clean
    • Run composio tools execute <slug> against a build with the
      hermes companion deployed, confirm ClickHouse tool log has
      session_info.cli_session_id
    • Confirm header is absent (and log field absent) when no cwd
      session is cached

    🤖 Generated with Claude Code

    Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com

    下载附件