Remove Docker publish workflow and update error handling in various modules

- Added handling for HTTP_STATUS.NOT_ACCEPTABLE in error types and messages.
- Enhanced the `prepareClaudeRequest` function to filter built-in tools for non-Anthropic providers and clean up empty tool arrays.
- Updated the `openaiToClaudeRequest` function to handle built-in tools more effectively and ensure proper tool conversion.
- Improved the `claudeToOpenAIResponse` function to skip processing for built-in server tool blocks.
- Refined error message handling in the `parseUpstreamError` function to ensure meaningful output.
- Adjusted command checks for tool installations across various settings routes to use `command -v` for better compatibility.
This commit is contained in:
decolua
2026-02-10 19:18:40 +07:00
parent 1d8251cb30
commit d3c3a4ae0a
10 changed files with 47 additions and 76 deletions

View File

@@ -34,6 +34,11 @@ export function claudeToOpenAIResponse(chunk, state) {
case "content_block_start": {
const block = chunk.content_block;
if (block?.type === "server_tool_use") {
// Built-in tool (web search) - Claude handles internally, skip
state.serverToolBlockIndex = chunk.index;
break;
}
if (block?.type === "text") {
state.textBlockStarted = true;
} else if (block?.type === "thinking") {
@@ -60,6 +65,8 @@ export function claudeToOpenAIResponse(chunk, state) {
}
case "content_block_delta": {
// Skip deltas for built-in server tool blocks (web search)
if (chunk.index === state.serverToolBlockIndex) break;
const delta = chunk.delta;
if (delta?.type === "text_delta" && delta.text) {
results.push(createChunk(state, { content: delta.text }));
@@ -82,6 +89,11 @@ export function claudeToOpenAIResponse(chunk, state) {
}
case "content_block_stop": {
// Skip stop for built-in server tool blocks (web search)
if (chunk.index === state.serverToolBlockIndex) {
state.serverToolBlockIndex = -1;
break;
}
if (state.inThinkingBlock && chunk.index === state.currentBlockIndex) {
results.push(createChunk(state, { reasoning_content: "" }));
state.inThinkingBlock = false;