# workbuddy-codex-bridge **Repository Path**: sjdhhcy/workbuddy-codex-bridge ## Basic Information - **Project Name**: workbuddy-codex-bridge - **Description**: workbuddy-codex-bridge - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-07 - **Last Updated**: 2026-07-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # workbuddy-codex-bridge A local Go bridge for WorkBuddy custom models. This service accepts OpenAI-style `POST /v1/chat/completions` requests from WorkBuddy and forwards them to an upstream that behaves like Codex/Responses behind a chat-completions endpoint. It normalizes request and response shapes so WorkBuddy can keep using a standard custom model configuration. ## What it does - Accepts WorkBuddy `chat/completions` requests on a local HTTP endpoint - Converts `messages` or Responses-like `input` payloads into upstream chat messages - Normalizes OpenAI-style tool schemas into the flattened tool schema required by some compatible upstreams - Converts Responses-style SSE back into standard `chat.completion.chunk` events - Aggregates upstream stream responses back into standard non-stream `chat.completion` JSON when needed - Preserves session affinity via configurable headers or body fields ## Layout - `main.go`: service entrypoint - `internal/bridge`: request translation logic - `internal/server`: HTTP server and stream adaptation - `internal/upstream`: upstream client and session handling - `bridge.example.yaml`: example runtime config ## Requirements - Go 1.26+ - A compatible upstream endpoint and API key ## Run locally 1. Copy `bridge.example.yaml` to `bridge.yaml` 2. Fill in your upstream URL and API key 3. Start the service: ```powershell go run . -config bridge.yaml ``` Or on Windows: ```powershell .\run-bridge.ps1 ``` The default local endpoint is: ```text http://127.0.0.1:4010/v1/chat/completions ``` ## WorkBuddy model example Point the WorkBuddy custom model URL to the local bridge: ```json { "id": "gpt-5.5", "name": "gpt-5.5", "provider": "openai", "apiKey": "bridge-local", "url": "http://127.0.0.1:4010/v1/chat/completions", "useCustomProtocol": true } ``` ## Notes - Do not commit `bridge.yaml`; it contains local secrets. - `bridge.example.yaml` is safe to share. - Runtime logs, PID files, and compiled executables are ignored by git. ## License MIT