Documentation
¶
Overview ¶
Package client identifies AI clients and request correlation metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GuessSessionID ¶
GuessSessionID attempts to retrieve a session ID which may have been sent by the client. If Claude Code has no usable session header, it reads and restores r.Body to inspect the payload. Other clients use only request headers.
func GuessSessionIDFromPayload ¶
GuessSessionIDFromPayload retrieves a session ID from recognized request headers and a pre-read payload, without reading, closing, or replacing r.Body. A nil or empty payload permits only header-based lookup.
Types ¶
type Type ¶
type Type string
Type identifies an AI client application.
const ( // Possible values for the "client" field in interception records. // Must be kept in sync with documentation: https://github.com/coder/coder/blob/3cf867f84aa32d2febf7a26dc7e52be6beb8a2ac/docs/ai-coder/ai-gateway/monitoring.md?plain=1#L47-L57 ClaudeCode Type = "Claude Code" Codex Type = "Codex" Zed Type = "Zed" CopilotVSC Type = "GitHub Copilot (VS Code)" CopilotCLI Type = "GitHub Copilot (CLI)" Kilo Type = "Kilo Code" CoderAgents Type = "Coder Agents" Crush Type = "Charm Crush" Xum Type = "Xum" Roo Type = "Roo Code" Cursor Type = "Cursor" OpenCode Type = "OpenCode" Junie Type = "Junie" Unknown Type = "Unknown" )
func GuessClient ¶
GuessClient attempts to guess the client application from the request headers. Not all clients set proper user agent headers, so this is a best-effort approach. Based on https://github.com/coder/aibridge/issues/20#issuecomment-3769444101.