Commit Graph

24 Commits

  • **docs(internal): add Codex instruction guides for GPT-5 CLI**
    - Added `gpt_5_1_prompt.md` and `gpt_5_codex_prompt.md` to document Codex instruction guidelines.
    - These detail the behavior, constraints, and execution policies for GPT-5-based Codex agents in the CLI environment.
  • **feat(registry): add GPT-5.1 Codex Max model definitions and support**
    - Introduced `gpt-5.1-codex-max` variants to model definitions (`low`, `medium`, `high`, `xhigh`).
    - Updated executor logic to map effort levels for Codex Max models.
    - Added `lastCodexMaxPrompt` processing for `gpt-5.1-codex-max` prompts.
    - Defined instructions for `gpt-5.1-codex-max` in a new file: `codex_instructions/gpt-5.1-codex-max_prompt.md`.
  • **feat(instructions): add detailed agent behavior guidelines for Codex CLI**
    Introduce comprehensive agent instruction documentation (`gpt_5_1_prompt.md`) for Codex CLI. Specify agent behavior, personality, planning requirements, task execution, sandboxing rules, and validation processes to standardize interactions and improve usability.
  • docs(instructions): add Codex operational and review guidelines
    Added detailed operational instructions for Codex agents based on GPT-5, covering shell usage, editing constraints, sandboxing policies, and approval mechanisms. Also included comprehensive review process guidelines for flagging and communicating issues effectively.
  • 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.
  • feat(store): introduce GitTokenStore for token persistence via Git backend
    - Added `GitTokenStore` to handle token storage and metadata using Git as a backing storage.
    - Implemented methods for initialization, save, retrieval, listing, and deletion of auth files.
    - Updated `go.mod` and `go.sum` to include new dependencies for Git integration.
    - Integrated support for Git-backed configuration via `GitTokenStore`.
    - Updated server logic to clone, initialize, and manage configurations from Git repositories.
    - Added helper functions for verifying and synchronizing configuration files.
    - Improved error handling and contextual logging for Git operations.
    - Modified Dockerfile to include `config.example.yaml` for initial setup.
    - Added `gitCommitter` interface to handle Git-based commit and push operations.
    - Configured `Watcher` to detect and leverage Git-backed token stores.
    - Implemented `commitConfigAsync` and `commitAuthAsync` methods for asynchronous change synchronization.
    - Enhanced `GitTokenStore` with `CommitPaths` method to support selective file commits.
  • feat(translator): add user metadata generation for Claude transformation requests
    - Introduced unique `user_id` metadata generation in OpenAI to Claude transformation functions.
    - Utilized `uuid` and `sha256` for deterministic `account`, `session`, and `user` values.
    - Embedded `user_id` into request payloads to enhance request tracking and identification.
  • feat(logging): introduce centralized logging with custom format and Gin integration
    - Implemented a global logger with structured formatting for consistent log output.
    - Added support for rotating log files using Lumberjack.
    - Integrated new logging functionality with Gin HTTP server for unified log handling.
    - Replaced direct `log.Info` calls with `fmt.Printf` in non-critical paths to simplify core functionality.
  • chore(docs): add and refine package-level comments across modules
    - Added detailed package-level comments to improve documentation coverage.
    - Clarified parameter descriptions, return types, and functionality of exported methods across packages.
    - Enhanced overall code readability and API documentation consistency.
  • refactor(headers): centralize header logic using EnsureHeader utility
    - Introduced `EnsureHeader` in `internal/misc/header_utils.go` to streamline header setting across executors.
    - Updated Codex, Claude, and Gemini executors to utilize `EnsureHeader` for consistent header application.
    - Incorporated Gin context headers (if available) into request header manipulation for better integration.
  • refactor(auth): Centralize logging for saving credentials
    The logic for logging the path where credentials are saved was duplicated across several client implementations.
    
    This commit refactors this behavior by creating a new centralized function, `misc.LogSavingCredentials`, to handle this logging. The `SaveTokenToFile` method in each authentication token storage struct now calls this new function, ensuring consistent logging and reducing code duplication.
    
    The redundant logging statements in the client-level `SaveTokenToFile` methods have been removed.
  • 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.
  • Add OAuth support for Gemini CLI, Claude, Codex, and Qwen authentication
    - Implemented new handlers (`RequestGeminiCLIToken`, `RequestAnthropicToken`, `RequestCodexToken`, `RequestQwenToken`) for initiating OAuth flows.
    - Added endpoints for authorization URLs in management API.
    - Extracted `GenerateRandomState` to a reusable utility in `misc` package.
    - Refactored related logic in `openai_login.go` and `anthropic_login.go` for consistency.
    
    Add endpoints for initiating OAuth flows in management API documentation
    
    - Documented new endpoints for Anthropic, Codex, Gemini CLI, and Qwen login URLs.
    - Provided request and response examples for each endpoint in both English and Chinese versions.