Commit Graph

15 Commits

  • fix: use underscore suffix in short name mapping
    Replace the "~<n>" suffix with "_<n>" when generating unique short names in codex translators (Claude, Gemini, OpenAI chat).
    This avoids using a special character in identifiers, improving compatibility with downstream APIs while preserving length constraints.
  • Fixed: #193
    fix(translator): consolidate temperature and top_p conditionals in OpenAI Claude request
    
    Fixed: #169
    
    fix(translator): adjust instruction strings in Codex Claude and OpenAI responses
  • docs: add GPT-5 Codex guidelines for internal usage
    - Added comprehensive instructions for Codex CLI harness, sandboxing, approvals, and editing constraints to `internal/misc/codex_instructions/`.
    - Clarified `approval_policy` configurations and scenarios requiring escalated permissions.
    - Provided detailed style and structure guidelines for presenting results in the Codex CLI.
  • Fixed: #121
    feat(translator): map Claude web search tool type to Codex web_search
    
    - Added special handling to replace `web_search_20250305` tool type with `{"type":"web_search"}` in Claude request processing.
  • feat(translator): improve Claude request handling with enhanced content processing
    - Introduced helper functions (`appendTextContent`, `appendImageContent`, etc.) for structured content construction.
    - Refactored message generation logic for better clarity, supporting mixed content scenarios (text, images, and function calls).
    - Added `flushMessage` to ensure proper grouping of message contents.
  • feat: introduce custom provider example and remove redundant debug logs
    - Added `examples/custom-provider/main.go` showcasing custom executor and translator integration using the SDK.
    - Removed redundant debug logs from translator modules to enhance code cleanliness.
    - Updated SDK documentation with new usage and advanced examples.
    - Expanded the management API with new endpoints, including request logging and GPT-5 Codex features.
  • feat: implement model-specific Codex instructions for GPT-5
    - Added `CodexInstructions(modelName string)` function to dynamically select instructions based on the model (e.g., GPT-5 Codex).
    - Introduced `gpt_5_instructions.txt` and `gpt_5_codex_instructions.txt` for respective model configurations.
    - Updated translators to pass `modelName` and use the new instruction logic.
  • Update internal module imports to use v5 package path
    - Updated all `github.com/luispater/CLIProxyAPI/internal/...` imports to point to `github.com/luispater/CLIProxyAPI/v5/internal/...`.
    - Adjusted `go.mod` to specify `module github.com/luispater/CLIProxyAPI/v5`.
  • Add reverse mappings for original tool names and improve error logging
    - Introduced reverse mapping logic for tool names in translators to restore original names when shortened.
    - Enhanced error handling by logging API response errors consistently across handlers.
    - Refactored request and response loggers to include API error details, improving debugging capabilities.
    - Integrated robust tool name shortening and uniqueness mechanisms for OpenAI, Gemini, and Claude requests.
    - Improved handler retry logic to properly capture and respond to errors.