Skip to content

feature about copilot responses api#140

Closed
caozhiyuan wants to merge 17 commits into
ericc-ch:masterfrom
caozhiyuan:feature/gpt-5-codex
Closed

feature about copilot responses api#140
caozhiyuan wants to merge 17 commits into
ericc-ch:masterfrom
caozhiyuan:feature/gpt-5-codex

Conversation

@caozhiyuan

Copy link
Copy Markdown
Contributor

This pull request introduces a new /responses API endpoint, refactors the message handling logic to support it, and adds a configuration system for model-specific prompts and defaults. The changes improve flexibility for model selection, enable advanced response streaming, and lay groundwork for future tool integrations.

New /responses API endpoint

  • Added the /responses endpoint with both native and streaming support, including request validation, error handling, and SSE streaming for compatible models (src/routes/responses/handler.ts, src/routes/responses/route.ts, src/server.ts, README.md). [1] [2] [3] [4] [5]

Message handling and routing refactor

  • Refactored handleCompletion to dynamically route requests to either the legacy chat completions API or the new responses API, based on model capabilities and payload contents (src/routes/messages/handler.ts). [1] [2] [3]

Configuration system and model selection

  • Introduced a config file (config.json) for storing extra prompts and default small model selection, with automatic file creation and access helpers (src/lib/config.ts, src/lib/paths.ts). [1] [2]
  • Added logic to force use of a small model for non-tool requests, optimizing resource usage (src/routes/messages/handler.ts).

Utility and support functions

  • Added utility functions to extract request options (vision, initiator) and analyze payloads for agent/vision features, supporting the new responses API (src/routes/responses/utils.ts).

Minor protocol update

  • Added a signature field to the AnthropicThinkingBlock interface for improved traceability (src/routes/messages/anthropic-types.ts).

…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
@caozhiyuan

Copy link
Copy Markdown
Contributor Author

@ericc-ch Submitted a new PR; the feature has been in use for nearly a month without issues.

@ShalomObongo

Copy link
Copy Markdown

This PR has been a life saver! It should be merged

@caozhiyuan caozhiyuan closed this Nov 3, 2025
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