Skip to content

Set a user agent suffix when used as a mcp server - #3395

Merged
gpeal merged 8 commits into
mainfrom
gpeal/user-agent-env-var
Sep 10, 2025
Merged

gpeal merged 8 commits into
mainfrom
gpeal/user-agent-env-var

Conversation

@gpeal

@gpeal gpeal commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

This automatically adds a user agent suffix whenever the CLI is used as a MCP server

@gpeal
gpeal marked this pull request as ready for review September 9, 2025 23:31
Comment thread codex-rs/core/src/default_client.rs Resolved

let sanitized: String = candidate
.chars()
.map(|ch| if matches!(ch, ' '..='~') { ch } else { '_' })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we want to allow symbols and spaces? Can't hurt, I guess?

@gpeal
gpeal force-pushed the gpeal/user-agent-env-var branch from 59c6b48 to b5e87dc Compare September 10, 2025 02:25
@gpeal
gpeal enabled auto-merge (squash) September 10, 2025 02:31
@gpeal
gpeal merged commit 8636bff into main Sep 10, 2025
@gpeal
gpeal deleted the gpeal/user-agent-env-var branch September 10, 2025 02:32
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants