Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
8ae9957
Add support for gpt-5.1 models
claude Nov 17, 2025
4637ed8
Merge pull request #1 from thebtf/claude/add-gpt-5.1-support-01V9oRCS…
thebtf Nov 17, 2025
494e234
feat: Add Docker PUID/PGID support and project documentation
claude Nov 17, 2025
eca6972
feat: Add GitHub Container Registry support and automated builds
claude Nov 17, 2025
2d2de30
fix: Update container registry paths to use thebtf fork
claude Nov 17, 2025
14b16b5
docs: Add fork disclaimer to README
claude Nov 17, 2025
5e19d75
Merge pull request #2 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 17, 2025
fb686b4
docs: Add manual build instructions and scripts
claude Nov 17, 2025
ce10622
fix: Replace su-exec with gosu for better compatibility
claude Nov 17, 2025
34802ca
docs: Add release v1.4.0 instructions
claude Nov 17, 2025
3148368
docs: Add PR creation guide and description
claude Nov 17, 2025
e0e668d
Merge pull request #3 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 17, 2025
8f42dca
feat: Add linux/arm/v7 architecture support and comprehensive archite…
claude Nov 17, 2025
77e3104
feat: Add linux/386 and linux/arm/v6 architecture support
claude Nov 17, 2025
131dbb2
Merge pull request #4 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 17, 2025
65d0243
feat: Add production-ready features - Gunicorn, WebUI, and Traefik in…
claude Nov 17, 2025
bed5517
Merge pull request #5 from thebtf/claude/faster-docker-release-0147A1…
thebtf Nov 17, 2025
04a0ae9
docs: Update README with WebUI, performance improvements, and compreh…
claude Nov 17, 2025
215082b
Merge pull request #6 from thebtf/claude/faster-docker-release-0147A1…
thebtf Nov 17, 2025
afa792e
feat: Add automated macOS application builds and GitHub Releases
claude Nov 18, 2025
f71f92e
Merge pull request #7 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 18, 2025
ba7713a
fix: Update requirements.txt with valid package versions
claude Nov 18, 2025
8915d97
fix: Merge requirements.txt from main and fix package versions
claude Nov 18, 2025
2d2d7c8
Resolve merge conflict in requirements.txt
claude Nov 18, 2025
45e8f18
Merge pull request #8 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 18, 2025
7c83f8b
refactor: Reorganize documentation and fix requirements.txt
claude Nov 18, 2025
694ebe6
Merge pull request #9 from thebtf/claude/update-docs-docker-01Qptso9T…
thebtf Nov 18, 2025
f37833f
fix: Add build dependencies to Dockerfile for package compilation
claude Nov 18, 2025
923c45d
Merge pull request #10 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
3c4461b
fix: Improve GHCR login detection in build script
claude Nov 18, 2025
45aea37
Merge pull request #11 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
5710a23
feat: Add WebUI dashboard with modern Prometheus-like design
claude Nov 18, 2025
3e49cc0
feat: Add GPT-5.1 models toggle with experimental warning
claude Nov 18, 2025
d33ff93
Merge pull request #12 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
ef6d4a5
fix: Require authentication in WebUI and fix OAuth login
claude Nov 18, 2025
952d83e
Merge pull request #13 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
8254c14
feat: OAuth callback on main server port (no separate login service)
claude Nov 18, 2025
9c51524
Merge pull request #14 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
6e87f77
Revert "feat: OAuth callback on main server port"
claude Nov 18, 2025
417139f
feat: Add WEBUI_PASSWORD protection for WebUI access
claude Nov 18, 2025
df0f932
Merge pull request #15 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
c989cdd
fix: Set CHATGPT_LOCAL_HOME in Dockerfile ENV
claude Nov 18, 2025
3dabf0f
Merge pull request #16 from thebtf/claude/update-docs-docker-01Qptso9…
thebtf Nov 18, 2025
a1e8d24
changed settings
Nov 20, 2025
2da9e13
Merge upstream/main with conflict resolution
Nov 20, 2025
e3f4984
Add comprehensive statistics collection system for dashboard
Nov 20, 2025
16d909c
Add testing script and documentation for statistics system
Nov 20, 2025
e712049
Add GPT-5.1 models support and mark as production ready
Nov 20, 2025
453238d
Add generic experimental models support mechanism
Nov 20, 2025
f84cea5
Merge pull request #18 from thebtf/feature/real-dashboard-stats
thebtf Nov 20, 2025
03b2a6f
Move documentation files to docs/ directory
Nov 20, 2025
23c864b
Move prompt documentation to docs/ directory
Nov 20, 2025
d8abbc9
Organize test files into tests/ directory
Nov 20, 2025
2ac68d9
Add Claude Code local settings to .gitignore
Nov 20, 2025
19aa1fd
Update test_stats.py with ASCII markers after move
Nov 20, 2025
c88c7d1
Organize project structure: move docs and tests
Nov 20, 2025
75202f0
Merge pull request #20 from thebtf/feature/real-dashboard-stats
thebtf Nov 20, 2025
e082ec4
Merge remote-tracking branch 'origin/main' into feature/organize-proj…
Nov 20, 2025
a89c491
Merge pull request #19 from thebtf/feature/organize-project-structure
thebtf Nov 20, 2025
5c44f0b
Fix Docker build: invalid tag format
Nov 20, 2025
aa0cebe
Fix macOS build: update path to prompt.md
Nov 20, 2025
808535e
Revert: move prompt files back to root
Nov 20, 2025
080e628
Improve experimental models UI: generic naming and conditional visibi…
Nov 20, 2025
cb4ea32
Merge upstream/main: Add gpt-5.1-codex-max support with xhigh reasoning
claude Nov 24, 2025
66f275c
Update WebUI and documentation for xhigh reasoning effort and gpt-5.1…
claude Nov 24, 2025
69de994
Add comprehensive PR description for upstream merge
claude Nov 24, 2025
f86bfc7
Merge pull request #21 from thebtf/claude/merge-additions-updates-01B…
thebtf Nov 24, 2025
f340d74
fix: prevent 400 error from OpenAI Responses API
Dec 1, 2025
309eebf
Merge upstream/main: Add GPT-5.2 support with xhigh reasoning
Dec 14, 2025
7819865
Add experimental Responses API support (#23)
thebtf Dec 14, 2025
4f40b47
Clean up repo: remove IDE/agent configs from tracking
Dec 14, 2025
06b9f5f
Add GET /v1/responses endpoint (returns empty list)
Dec 14, 2025
4d50f2a
Add debug logging and conversation_id support
Dec 14, 2025
5b47ac9
Add session persistence and improve input handling
Dec 14, 2025
cc7212a
Fix ENV variables for VERBOSE and DEBUG_LOG
Dec 14, 2025
26a7142
Add API key authentication support
Dec 14, 2025
62ba997
docs: Add v1.4.7 changelog and API key authentication docs
Dec 14, 2025
40acf43
Fix content array normalization for ChatGPT upstream
Dec 15, 2025
694b502
More aggressive content array flattening
Dec 15, 2025
af91c98
Properly normalize input items by type for Responses API
Dec 15, 2025
1ca75ea
Add JSON payload dump for debugging Responses API
Dec 15, 2025
f427092
Fix reasoning items: content must be empty array
Dec 15, 2025
9310094
Smart normalization with stats logging
Dec 15, 2025
c66c4f7
Add CLIProxyAPI-inspired improvements
Dec 15, 2025
8a1f2e3
Skip base prompt if client sends official instructions
Dec 15, 2025
acb2db1
docs: Add v1.4.8 changelog
Dec 15, 2025
5d8b884
Fix_web_search_parameter_extraction
Dec 15, 2025
2d63775
"Add_detailed_logging_for_web_search"
Dec 15, 2025
9b0b882
"Expand_web_search_parameter_extraction_with_nested_field_support"
Dec 15, 2025
ec46e5e
"Release_v0.1.1_web_search_parameter_extraction_fix"
Dec 15, 2025
03d72c8
"Release_v1.4.9"
Dec 15, 2025
70fdb8e
Add unified debug logging for payload dumps
Dec 15, 2025
c89d5cb
Fix tools conversion: support flat format (Cursor style)
Dec 16, 2025
39a2532
Add missing API params passthrough to Chat Completions
Dec 16, 2025
16328d2
Add full API params passthrough
Dec 16, 2025
8b15fb8
Add detailed upstream error logging
Dec 16, 2025
a336ef8
Fix error reading from streaming responses
Dec 16, 2025
ac107d8
Fix: Remove metadata param (unsupported by ChatGPT)
Dec 16, 2025
afff5de
Fix: Remove user param (unsupported by ChatGPT internal API)
Dec 16, 2025
ff05c8a
Fix: Handle mixed format input (Chat + Responses API)
Dec 16, 2025
12cb8d2
Fix: Prevent double finish_reason (tool_calls then stop)
Dec 16, 2025
c5aa6ec
docs: Add workflow rules and debugging notes to CLAUDE.md
Dec 16, 2025
34370f2
debug: Add CHATMOCK_DEBUG_STREAM for finish_reason logging
Dec 16, 2025
2a2ce2a
debug: Log model text output when no tools called
Dec 16, 2025
1840f0b
Add debug logging for system prompts (client vs ChatMock)
Dec 16, 2025
2a69ee8
Smart instruction handling: use client prompts when official
Dec 16, 2025
66b8977
Fix: Debug prompt logging writes to CHATGPT_LOCAL_HOME/data
Dec 16, 2025
372203b
Add smart debug loop for instructions bisect
Dec 17, 2025
4495b9b
Add minimal instructions test before bisect loop
Dec 17, 2025
80f828d
Add tools bisect when instructions test passes
Dec 17, 2025
780fcec
Debug bisect: test BASE_INSTRUCTIONS and empty input
Dec 17, 2025
5dbb3c3
Cleanup old debug_* files on startup when debug mode enabled
Dec 17, 2025
6967050
Debug: try hybrid instructions (BASE first line + client rest)
Dec 17, 2025
0f1bd60
Debug: try prefixed instructions (BASE + separator + client)
Dec 17, 2025
bda20eb
Implement fallback: BASE_INSTRUCTIONS + client prompt as user message
Dec 17, 2025
038eb2f
GPT-5.2: Always use BASE_INSTRUCTIONS + client prompt as user message
Dec 17, 2025
14bf455
Debug: log tool call arguments when VERBOSE=true
Dec 17, 2025
028d0ad
Always log tool call arguments (independent of VERBOSE)
Dec 17, 2025
d79aa5c
Add IDE environment context for GPT-5.2 tool priority
Dec 17, 2025
f9e37f4
Use developer role for client system prompt (higher authority)
Dec 17, 2025
4dcd812
Add model-specific prompts and instruction concatenation
Dec 17, 2025
0a59c01
Rename separator: project-doc -> ide-context
Dec 17, 2025
c536365
Remove hardcoded Cursor IDE context
Dec 17, 2025
4ceb74f
Revert to developer message approach for client prompts
Dec 17, 2025
4b87778
Add upstream request/response debug logging
Dec 17, 2025
835cd42
Add file-based logging for streaming responses
Dec 17, 2025
6116a96
Fix: Support custom type tools (apply_patch)
Dec 17, 2025
8701972
Fix: Convert custom tools to function format for GPT-5.2
Dec 17, 2025
043da9c
Fix: Pass apply_patch content as raw string to Cursor
Dec 17, 2025
82cdf32
Fix: Proper custom tools support per Responses API spec
Dec 17, 2025
87b995f
Debug: Add logging to see raw ChatGPT tool call response format
Dec 17, 2025
2fd5fda
Fix: Don't wrap raw strings for function_call (may be custom tool)
Dec 17, 2025
124f369
Stream custom_tool_call arguments in chunks like OpenAI does
Dec 17, 2025
44535c1
Add role: assistant and content: null to tool call streaming chunks
Dec 17, 2025
f5d0770
Debug: Add logging to trace tool result (function_call_output) proces…
Dec 17, 2025
f12f7f8
Debug: Add comprehensive logging to trace message flow from Cursor
Dec 18, 2025
bf27f47
Fix: Add custom_tool_call types to Responses API passthrough
Dec 18, 2025
dfc216a
Refactor: Gate debug logging behind DEBUG_LOG env variable
Dec 18, 2025
4984075
Debug: capture temperature passthrough evidence for aider
Dec 25, 2025
9d135c6
Fix: ignore unsupported temperature for GPT-5.2
Dec 25, 2025
ffedb6a
Debug: stdout evidence for dropped params
Dec 25, 2025
f20a8a8
Fix: drop temperature for gpt-5.2 at API boundary
Dec 25, 2025
7910e4a
Chore: remove custom debug logger
Dec 25, 2025
2093276
Merge upstream/main: add GPT-5.2-Codex model
Jan 14, 2026
a495fe9
fix: auto-retry on unsupported parameter rejection (v1.4.10)
Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .README.md.swp
Binary file not shown.
90 changes: 78 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,23 +1,89 @@
# Port
PORT=8000
# ============================================================================
# ChatMock Configuration
# ============================================================================

# Auth dir
CHATGPT_LOCAL_HOME=/data
# ============================================================================
# Server Configuration
# ============================================================================

# Port for the server to listen on
PORT=8000

# show request/stream logs
# Enable verbose logging (1, true, yes, on = enabled)
VERBOSE=false

# OAuth client id (modify only if you know what you're doing)
# Use Gunicorn for production deployment (1 = enabled, 0 = use Flask dev server)
USE_GUNICORN=1

# Number of Gunicorn worker processes (default: CPU count * 2 + 1)
# GUNICORN_WORKERS=4

# ============================================================================
# ChatGPT Configuration
# ============================================================================

# Directory for storing authentication tokens and data
CHATGPT_LOCAL_HOME=/data

# OAuth client ID (default is provided, override only if needed)
# CHATGPT_LOCAL_CLIENT_ID=app_EMoamEEZ73f0CkXaXp7hrann

# Reasoning controls
CHATGPT_LOCAL_REASONING_EFFORT=medium # minimal|low|medium|high
CHATGPT_LOCAL_REASONING_SUMMARY=auto # auto|concise|detailed|none
CHATGPT_LOCAL_REASONING_COMPAT=think-tags # legacy|o3|think-tags|current
# OAuth issuer URL (default: https://auth.openai.com)
# CHATGPT_LOCAL_ISSUER=https://auth.openai.com

# Bind address for login server (default: 127.0.0.1, use 0.0.0.0 for Docker)
CHATGPT_LOCAL_LOGIN_BIND=0.0.0.0

# ============================================================================
# User/Group Configuration (Docker)
# ============================================================================

# User ID for file permissions (set to your user's UID to avoid permission issues)
PUID=1000

# Group ID for file permissions (set to your user's GID to avoid permission issues)
PGID=1000

# ============================================================================
# Reasoning Configuration
# ============================================================================

# Reasoning effort level: minimal, low, medium, high, xhigh
# Controls how much computational effort is spent on reasoning
# Note: xhigh is only available for gpt-5.1-codex-max
CHATGPT_LOCAL_REASONING_EFFORT=medium

# Reasoning summary verbosity: auto, concise, detailed, none
# Controls how reasoning is presented in responses
CHATGPT_LOCAL_REASONING_SUMMARY=auto

# Reasoning compatibility mode: legacy, o3, think-tags, current
# Controls how reasoning is exposed to API clients
CHATGPT_LOCAL_REASONING_COMPAT=think-tags

# Expose reasoning effort variants as separate models (true/false)
# When enabled, models like gpt-5-high, gpt-5-low will appear in /v1/models
CHATGPT_LOCAL_EXPOSE_REASONING_MODELS=false

# Enable default web search tool
# ============================================================================
# Feature Toggles
# ============================================================================

# Enable web search by default when no tools are specified (true/false)
CHATGPT_LOCAL_ENABLE_WEB_SEARCH=false

# Force a specific model name
# Force a specific model for all requests (useful for testing)
# CHATGPT_LOCAL_DEBUG_MODEL=gpt-5

# ============================================================================
# Traefik Configuration (for reverse proxy integration)
# ============================================================================

# Domain for the ChatMock service
# CHATMOCK_DOMAIN=chatmock.example.com

# Traefik network name (must match your Traefik network)
# TRAEFIK_NETWORK=traefik

# Email for Let's Encrypt certificate notifications
# TRAEFIK_ACME_EMAIL=admin@example.com
70 changes: 70 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Release

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:

jobs:
build-macos:
name: Build macOS Application
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-build.txt

- name: Build macOS DMG
run: |
python build.py --name ChatMock --dmg

- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: ChatMock-macOS
path: dist/ChatMock.dmg
retention-days: 5

create-release:
name: Create GitHub Release
needs: [build-macos]
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: ChatMock-macOS
path: artifacts/

- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
files: |
artifacts/ChatMock.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docker Build and Publish

on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: thebtf/chatmock

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Image digest
run: echo ${{ steps.meta.outputs.digest }}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ venv/
# Packaging artifacts
build/
dist/
!chatmock/webui/dist/
*.egg-info/

# Tool caches
Expand All @@ -19,3 +20,26 @@ dist/

# OS clutter
.DS_Store

# Claude Code local settings
.claude/settings.local.json

# IDE and editor configs
.vscode/
.vs/
.cursor/
*.swp
*.swo
*~

# AI/Agent tool configs
.roo/
.claude/
.mcp.json
.codex/
.serena/
.agent/
.agent_profiles/
.mcp-debug-tools/
.qdrant_sets.json
.netcoredbg_hist
Loading