Skip to content

ChatGPT CLI v1.10.0

Choose a tag to compare

@kardolus kardolus released this 09 Jan 19:14
· 66 commits to main since this release

New Features:

  • MCP session management with on-disk cache:
    • Automatic MCP session initialization, reuse, and rotation via a new SessionTransport layer.
    • Sessions are cached per-endpoint in a filesystem-backed store to reduce round trips and latency between CLI invocations.
    • Cache location defaults to ~/.chatgpt-cli/cache/mcp/sessions and can be customized via OPENAI_CACHE_HOME.
    • Code references: api/client/mcp.go, cache/*, internal/utils.go, cmd/chatgpt/main.go
  • New Makefile targets for local MCP testing:
    • mcp-http: Run a local FastMCP HTTP server (JSON responses).
    • mcp-sse: Run a local FastMCP SSE server (text/event-stream).
    • Code reference: Makefile

Improvements:

  • More robust MCP transport and response handling:
    • New MCPHTTPTransport returns a richer MCPResponse (status, headers, parsed message).
    • Unified handling of application/json and text/event-stream by auto-detecting SSE “data:” frames.
    • Canonical and case-insensitive header handling for mcp-session-id.
    • Code reference: api/client/mcp.go, api/mcp.go
  • HTTP client enhancements:
    • New PostWithHeadersResponse method returns status, headers, and body for better error and session handling.
    • Expanded tests for Get, Post, PostWithHeaders, and PostWithHeadersResponse.
    • Code references: api/http/http.go, api/http/http_test.go, api/responses.go
  • CLI usability:
    • Unit tests can now accept additional arguments via make unit ARGS=...
    • Code reference: Makefile
  • Documentation and configuration:
    • Documented new cache directory and OPENAI_CACHE_HOME environment variable.
    • Code reference: README.md, internal/utils.go, internal/utils_test.go

Bug Fixes:

  • Stable MCP header behavior and error propagation:
    • Properly forwards user-specified headers to MCP calls.
    • Improves detection of invalid or missing MCP sessions and retries once after re-initialization.
    • Preserves server-rotated session IDs and updates cache accordingly.
    • Code reference: api/client/mcp.go
  • SSE parsing resilience:
    • Simplified and more reliable extraction of JSON payloads from SSE “data:” lines.
    • Code reference: api/client/mcp.go

Other Changes:

  • Breaking flag rename for MCP tool parameters:
    • --param → --mcp-param
    • --params → --mcp-params
    • All examples and help text updated accordingly.
    • Code references: README.md, cmd/chatgpt/main.go, test/mcp/http/README.md
  • New cache package:
    • FileStore with atomic writes and a simple JSON Entry format.
    • SHA-256 keying per endpoint to avoid filename concerns.
    • Unit and integration tests included.
    • Code references: cache/*
  • Dependency updates:
    • github.com/onsi/gomega → v1.39.0
    • golang.org/x/sys → v0.40.0
    • Code reference: go.mod, go.sum
  • Test coverage expansions:
    • Additional unit tests for MCP session transport and HTTP caller behavior.
    • Integration tests for cache read/write/delete and persistence across runs.
    • Code references: api/client/mcp_test.go, api/client/transportmocks_test.go, test/integration/integration_test.go

Upgrade Notes:

  • Flag changes (breaking):
    • Replace --param with --mcp-param.
    • Replace --params with --mcp-params.
    • Update scripts, aliases, and documentation accordingly.
  • New cache directory:
    • Session cache defaults to ~/.chatgpt-cli/cache. Override with OPENAI_CACHE_HOME if desired.
  • How to update:
    • If you installed via Homebrew: brew upgrade chatgpt-cli
    • Or download the latest binaries for your operating system directly from the releases page.