Commit Graph

19 Commits

  • 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
  • refactor(translator): remove unused log dependency and comment out debug logging
    docs: add GPT-5 Codex guidelines for CLI usage
    
    - Added detailed guidelines for GPT-5 Codex in Codex CLI.
    - Expanded instructions on sandboxing, approvals, editing constraints, and style requirements.
    - Included presentation and response formatting best practices.
    
    fix(codex_instructions): update comparison logic to use prefix matching
    
    - Changed system instructions comparison to use `strings.HasPrefix` for improved flexibility.
  • 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 #91
    refactor(translator): streamline Codex response handling and remove redundant code
    
    - Updated `ConvertCodexResponseToOpenAIResponses` logic for clarity and consistency.
    - Simplified `ConvertCodexResponseToOpenAIResponsesNonStream` by removing unnecessary buffer setup and scanner logic.
    - Switched to using `sjson.SetRaw` for improved processing of raw input strings.
  • Fixed: #86
    feat(translator): add support for single input string in Codex responses parser
    
    - Modified input parsing logic to handle cases where input is a single string instead of an array.
    - Added functionality to convert single string inputs into structured JSON format.
  • feat(registry/runtime): add Gemini 2.5 model and increase buffer sizes
    - Added new "Gemini 2.5 Flash Image Preview" model definition, with enhanced image generation capabilities.
    - Increased scanner buffer size to 20,971,520 bytes across executors and translators to handle larger payloads.
  • fix(translator): remove unsupported token limit fields for Codex Responses API
    The OpenAI Codex Responses API (chatgpt.com/backend-api/codex/responses)
    rejects requests containing max_output_tokens and max_completion_tokens fields,
    causing Factory CLI to fail with "Unsupported parameter" errors.
    
    This fix strips these incompatible fields during request translation, allowing
    Factory CLI to work properly with CLIProxyAPI when using ChatGPT Plus/Pro OAuth.
    
    Fixes compatibility issue where Factory sends token limit parameters that aren't
    supported by the Codex Responses endpoint.
  • feat(translators): improve system instruction extraction and input handling for OpenAI and Claude responses
    - Enhanced support for extracting system instructions from input arrays.
    - Improved input message role and type determination logic for consistent message processing.
    - Refined instruction handling logic across translator types for better compatibility.
  • 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.
  • refactor: standardize constant naming and improve file-based auth handling
    - Renamed constants from uppercase to CamelCase for consistency.
    - Replaced redundant file-based auth handling logic with the new `util.CountAuthFiles` helper.
    - Fixed various error-handling inconsistencies and enhanced robustness in file operations.
    - Streamlined auth client reload logic in server and watcher components.
    - Applied minor code readability improvements across multiple packages.
  • refactor: remove redundant Codex instruction validation logic
    - Eliminated unnecessary calls to `misc.CodexInstructions` and corresponding checks in response processing.
    - Streamlined instruction handling by directly updating "instructions" field from the original request payload.
  • Refine Codex instructions for GPT-5 use case
    - Simplified `gpt_5_instructions.txt` by removing redundancy and aligning scope with AGENTS.md standard instructions.
    - Enhanced clarity and relevance of directives per Codex context.
  • 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`.