Skip to content

fix(openai): sanitize message names for API requests#2352

Closed
logicwu0 wants to merge 1 commit into
agentscope-ai:mainfrom
logicwu0:fix/2345-sanitize-openai-message-name
Closed

fix(openai): sanitize message names for API requests#2352
logicwu0 wants to merge 1 commit into
agentscope-ai:mainfrom
logicwu0:fix/2345-sanitize-openai-message-name

Conversation

@logicwu0

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.0.1-SNAPSHOT

Description

OpenAI-compatible APIs only allow letters, digits, underscores, and hyphens in the message name field.

This change sanitizes unsupported characters when converting user and assistant messages, while preserving the original agent name inside AgentScope.

Fixes #2345

Checklist

  • Code has been formatted with mvn spotless:apply
  • All relevant tests are passing
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated
  • Code is ready for review

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jujn

jujn commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

fixed in: #2346

@jujn jujn closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agent name contains space resulting gpt model bad request error

2 participants