Skip to content

Conversation

@caozhiyuan
Copy link
Contributor

This pull request introduces a new configuration system, structured logging, and support for the /v1/responses endpoint, along with improvements to model selection and request handling. The most important changes are grouped below:
Responses API Integration

  • Added full support for the /v1/responses endpoint, including a new handler (src/routes/responses/handler.ts) that validates model support, streams or returns results, and logs all activity.
  • Enhanced src/routes/messages/handler.ts to route requests to the Responses API when supported by the selected model, including translation logic for payloads and results. [1] [2]

Configuration System

  • Added src/lib/config.ts to provide persistent configuration management, including default prompts, small model selection, and reasoning effort levels for models. This enables dynamic model selection and custom prompt injection.
  • Updated src/lib/paths.ts to include a path for the configuration file and ensure its existence at startup.

Structured Logging

  • Implemented a robust logging system in src/lib/logger.ts that supports per-handler log files, log rotation, and verbosity control, replacing direct consola usage in request handlers.
  • Refactored request handlers in src/routes/chat-completions/handler.ts and src/routes/messages/handler.ts to use the new logger, improving log clarity and manageability. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Model Selection and Request Handling

  • Improved model selection logic to force the use of a "small" model for certain requests (e.g., warmup requests without tools) to optimize resource usage. [1] [2]
  • Added a verbose flag to the global state object to control logging verbosity across the application.

Documentation

  • Updated the API documentation in README.md to include the new /v1/responses endpoint and clarify its purpose.

…arsing and allign with vscode-copilot-chat extractThinkingData, otherwise it will cause miss cache occasionally
…ing small model if no tools are used

2.add bun idleTimeout = 0
3.feat: Compatible with Claude code JSONL file usage error scenarios, delay closeBlockIfOpen and map responses api to anthropic  support tool_use and fix spelling errors
4.feat: add configuration management with extra prompt handling and ensure config file creation
…just runServer to set verbose level correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants