perf: eliminate string(paramsJSON) conversion in codex CLI provider

Use sb.Write(paramsJSON) to write []byte directly to Builder
instead of converting to string first, matching the claude CLI
provider optimization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-02-24 15:45:41 +09:00
parent 005254c39d
commit 4507ace9e3

View file

@ -152,7 +152,9 @@ func (p *CodexCliProvider) buildToolsPrompt(tools []ToolDefinition) string {
} }
if len(tool.Function.Parameters) > 0 { if len(tool.Function.Parameters) > 0 {
paramsJSON, _ := json.Marshal(tool.Function.Parameters) paramsJSON, _ := json.Marshal(tool.Function.Parameters)
sb.WriteString(fmt.Sprintf("Parameters:\n```json\n%s\n```\n", string(paramsJSON))) sb.WriteString("Parameters:\n```json\n")
sb.Write(paramsJSON)
sb.WriteString("\n```\n")
} }
sb.WriteString("\n") sb.WriteString("\n")
} }