mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-09 04:02:35 +00:00
fix(web-search): clarify endpoint recovery guidance
This commit is contained in:
@@ -314,8 +314,8 @@ function searchEndpointError(endpoint: string, message: string, cause?: unknown)
|
||||
return new WebError(
|
||||
`${message}\n\nThe web search request used endpoint ${JSON.stringify(endpoint)}. `
|
||||
+ 'Search endpoint configuration is separate from chat. If that endpoint is not intended, '
|
||||
+ 'tell the user to set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted '
|
||||
+ 'Anthropic-compatible Messages API base. Do not choose or change the endpoint for them.',
|
||||
+ 'the user can set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted '
|
||||
+ 'Anthropic-compatible Messages API base. Only the user should choose or change the endpoint.',
|
||||
'WEB_PROVIDER_ERROR',
|
||||
cause === undefined ? undefined : { cause },
|
||||
)
|
||||
|
||||
@@ -338,8 +338,8 @@ describe('DeepSeekSearchProvider error handling', () => {
|
||||
message: 'DeepSeek API error (HTTP 429): rate limited\n\n'
|
||||
+ 'The web search request used endpoint "https://api.deepseek.test/anthropic/v1/messages". '
|
||||
+ 'Search endpoint configuration is separate from chat. If that endpoint is not intended, '
|
||||
+ 'tell the user to set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted '
|
||||
+ 'Anthropic-compatible Messages API base. Do not choose or change the endpoint for them.',
|
||||
+ 'the user can set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted '
|
||||
+ 'Anthropic-compatible Messages API base. Only the user should choose or change the endpoint.',
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
@@ -12,34 +12,27 @@
|
||||
{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"system":"{{system}}","tools":"{{tools}}"},"reason":"initial"}}
|
||||
{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":1,"index":0,"dt":[85,23,0,0,0,1,0,23,1,0,23,0,0,0,1,0,25,1,0,0,0,0],"texts":["The"," user"," wants"," me"," to"," use"," web","_search"," exactly"," once"," to"," search"," for"," \"","DS","H"," endpoint"," configuration"," snapshot","\"."," If"," it"," fails"]}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":1,"index":0,"dt":[1,31,1,0,0,0,0,18,1,0,0,97,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,10,1,0,0,0,0,23,0,1,0],"texts":[","," do"," not"," ret","ry","."," Report"," only"," the"," endpoint"," and"," the"," configuration"," or"," restriction"," facts"," stated"," in"," the"," tool"," error","."," Do"," not"," infer"," why"," it"," failed"," or"," whether"," the"," endpoint"," is"," correct",".\n\n","Let"," me"," do"," exactly"," one"," web","_search"," call"]}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"reasoning-delta","index":0,"text":"."}}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":1,"index":0,"dt":[85,23,0,0,0,1,0,23,1,0,23,0,0,0,1,0,25,1,0,0,0,0,-183,1,31,1,0,0,0,0,18,1,0,0,97,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,10,1,0,0,0,0,23,0,1,0,-189],"texts":["The"," user"," wants"," me"," to"," use"," web","_search"," exactly"," once"," to"," search"," for"," \"","DS","H"," endpoint"," configuration"," snapshot","\"."," If"," it"," fails",","," do"," not"," ret","ry","."," Report"," only"," the"," endpoint"," and"," the"," configuration"," or"," restriction"," facts"," stated"," in"," the"," tool"," error","."," Do"," not"," infer"," why"," it"," failed"," or"," whether"," the"," endpoint"," is"," correct",".\n\n","Let"," me"," do"," exactly"," one"," web","_search"," call","."]}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"block-start","index":1,"blockType":"tool-call"}}}
|
||||
{"type":"tool-call-chunks","data":{"turn":1,"step":1,"index":1,"dt":[23,1,0,23,1,0,21,0,1,0,0,0,24,22],"id":"call_00_EX8x3Ucuhk8yukDc5kzA9014","name":"web_search","args":["","{","\"","qu","eries","\"",": ","[\"","DS","H"," endpoint"," configuration"," snapshot","\"]","}"]}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The user wants me to use web_search exactly once to search for \"DSH endpoint configuration snapshot\". If it fails, do not retry. Report only the endpoint and the configuration or restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct.\n\nLet me do exactly one web_search call."}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"block-end","index":1,"block":{"type":"tool-call","id":"call_00_EX8x3Ucuhk8yukDc5kzA9014","name":"web_search","arguments":"{\"queries\": [\"DSH endpoint configuration snapshot\"]}"}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"usage","usage":{"inputTokens":7834,"outputTokens":118,"totalTokens":7952,"cacheReadTokens":0,"reasoningTokens":67}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":1,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The user wants me to use web_search exactly once to search for \"DSH endpoint configuration snapshot\". If it fails, do not retry. Report only the endpoint and the configuration or restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct.\n\nLet me do exactly one web_search call."},{"type":"tool-call","id":"call_00_EX8x3Ucuhk8yukDc5kzA9014","name":"web_search","arguments":"{\"queries\": [\"DSH endpoint configuration snapshot\"]}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:3}}"},"usage":{"inputTokens":7834,"outputTokens":118,"totalTokens":7952,"cacheReadTokens":0,"reasoningTokens":67}},"sourceEventSeqs":[[12,99]],"surfaceOp":"append"}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The user wants me to use web_search exactly once to search for \"DSH endpoint configuration snapshot\". If it fails, do not retry. Report only the endpoint and the configuration or restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct.\n\nLet me do exactly one web_search call."},{"type":"tool-call","id":"call_00_EX8x3Ucuhk8yukDc5kzA9014","name":"web_search","arguments":"{\"queries\": [\"DSH endpoint configuration snapshot\"]}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:3}}"},"usage":{"inputTokens":7834,"outputTokens":118,"totalTokens":7952,"cacheReadTokens":0,"reasoningTokens":67}},"sourceEventSeqs":[12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],"surfaceOp":"append"}
|
||||
{"type":"tool/call","data":{"turn":1,"step":1,"callId":"call_00_EX8x3Ucuhk8yukDc5kzA9014","name":"web_search","arguments":"{\"queries\": [\"DSH endpoint configuration snapshot\"]}"}}
|
||||
{"type":"web/deepseek-search-llm-request","data":{"endpoint":"http://127.0.0.1:43118/anthropic/v1/messages","apiVersion":"2023-06-01","body":{"model":"deepseek-v4-flash","max_tokens":4096,"messages":[{"role":"user","content":[{"type":"text","text":"Perform a web search for the query: DSH endpoint configuration snapshot"}]}],"tools":[{"type":"web_search_20250305","name":"web_search","max_uses":5}]}}}
|
||||
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"source":{"kind":"tool","callId":"call_00_EX8x3Ucuhk8yukDc5kzA9014"},"content":[{"type":"tool-result","toolCallId":"call_00_EX8x3Ucuhk8yukDc5kzA9014","content":[{"type":"text","text":"Error: DeepSeek API error (HTTP 401): invalid snapshot API key\n\nThe web search request used endpoint \"http://127.0.0.1:43118/anthropic/v1/messages\". Search endpoint configuration is separate from chat. If that endpoint is not intended, tell the user to set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted Anthropic-compatible Messages API base. Do not choose or change the endpoint for them."}],"isError":true}],"role":"user","id":"{{message:4}}"},"error":{"name":"WebError","code":"WEB_PROVIDER_ERROR"}},"sourceEventSeqs":[101],"surfaceOp":"append"}
|
||||
{"type":"tool/result","data":{"turn":1,"step":1,"message":{"source":{"kind":"tool","callId":"call_00_EX8x3Ucuhk8yukDc5kzA9014"},"content":[{"type":"tool-result","toolCallId":"call_00_EX8x3Ucuhk8yukDc5kzA9014","content":[{"type":"text","text":"Error: DeepSeek API error (HTTP 401): invalid snapshot API key\n\nThe web search request used endpoint \"http://127.0.0.1:43118/anthropic/v1/messages\". Search endpoint configuration is separate from chat. If that endpoint is not intended, the user can set DEEPSEEK_SEARCH_BASE_URL or web-search-deepseek.baseURL to a trusted Anthropic-compatible Messages API base. Only the user should choose or change the endpoint."}],"isError":true}],"role":"user","id":"{{message:4}}"},"error":{"name":"WebError","code":"WEB_PROVIDER_ERROR"}},"sourceEventSeqs":[101],"surfaceOp":"append"}
|
||||
{"type":"step/end","data":{"turn":1,"step":1}}
|
||||
{"type":"step/start","data":{"turn":1,"step":2}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"block-start","index":0,"blockType":"reasoning"}}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":2,"index":0,"dt":[93,89,1,0,0,0,1,0,0,0,1,0,0,10,0,0],"texts":["The"," web","_search"," failed"," with"," an"," error","."," Per"," the"," user","'s"," instructions",":"," do"," not"," ret"]}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":2,"index":0,"dt":[0,0,0,1,0,77,0,1,0,0,0,0,1,0,10,1,0,0,0,0,22,1,0,0,25,0,0,0,1,0],"texts":["ry",","," report"," only"," the"," endpoint"," and"," configuration","/","rest","riction"," facts"," stated"," in"," the"," tool"," error","."," Do"," not"," infer"," why"," it"," failed"," or"," whether"," the"," endpoint"," is"," correct","."]}}
|
||||
{"type":"reasoning-chunks","data":{"turn":1,"step":2,"index":0,"dt":[93,89,1,0,0,0,1,0,0,0,1,0,0,10,0,0,-195,0,0,0,1,0,77,0,1,0,0,0,0,1,0,10,1,0,0,0,0,22,1,0,0,25,0,0,0,1,0],"texts":["The"," web","_search"," failed"," with"," an"," error","."," Per"," the"," user","'s"," instructions",":"," do"," not"," ret","ry",","," report"," only"," the"," endpoint"," and"," configuration","/","rest","riction"," facts"," stated"," in"," the"," tool"," error","."," Do"," not"," infer"," why"," it"," failed"," or"," whether"," the"," endpoint"," is"," correct","."]}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"block-start","index":1,"blockType":"text"}}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[0,23,0,0,1,0],"texts":["The"," single"," web","_search"," call"," failed"," with"]}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[0,0,0,23,0,0,0,23,0,1,0,0,0,22,1,0,24,0,0,0,21,0,0,0,1,23,0,0,0,0,22,0,0,0,1,0,22,0,0],"texts":[" an"," error","."," Per"," your"," instructions",","," I"," did"," not"," ret","ry","."," Here"," is"," exactly"," what"," the"," tool"," error"," states",":\n\n","-"," **","Endpoint"," used",":**"," `","http","://","127",".","0",".","0",".","1",":","431","18"]}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[1,0,0,1,0,22,1,0,0,0,0,24,18,1,0,0,23,0,1,0,0,0,21,1,0,0,0,0,23,0,22,0,1,0,0,0,26,0],"texts":["/an","throp","ic","/v","1","/m","essages","`\n","-"," **","Error",":**"," Deep","Se","ek"," API"," error"," (","HTTP"," ","401","):"," invalid"," snapshot"," API"," key","\n","-"," **","Configuration","/","rest","riction"," facts"," stated"," in"," the"," error",":"]}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[1,0,0,0,0,21,1,0,0,23,0,0,0,0,22,1,0,0,0,1,27,0,17,1,0,0,1,0,21,1,0,0,0,0,23,1,0,0,0,0,22,0,1,0,0,0],"texts":["**\n"," "," -"," Search"," endpoint"," configuration"," is"," separate"," from"," chat",".\n"," "," -"," If"," that"," endpoint"," is"," not"," intended",","," the"," user"," should"," set"," `","D","EEP","SEE","K","_SE","ARCH","_B","ASE","_URL","`"," or"," `","web","-search","-de","ep","seek",".base","URL","`"," to"," a"]}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[0,0,1,0,0,12,0,23,0,0,0,22,57,1,10,0,0,0,1,0,34,0,0,0],"texts":[" trusted"," Anthrop","ic","-com","patible"," Messages"," API"," base",".\n"," "," -"," The"," instruction"," states"," not"," to"," choose"," or"," change"," the"," endpoint"," for"," the"," user","."]}}
|
||||
{"type":"text-chunks","data":{"turn":1,"step":2,"index":1,"dt":[0,23,0,0,1,0,-24,0,0,0,23,0,0,0,23,0,1,0,0,0,22,1,0,24,0,0,0,21,0,0,0,1,23,0,0,0,0,22,0,0,0,1,0,22,0,0,-184,1,0,0,1,0,22,1,0,0,0,0,24,18,1,0,0,23,0,1,0,0,0,21,1,0,0,0,0,23,0,22,0,1,0,0,0,26,0,-186,1,0,0,0,0,21,1,0,0,23,0,0,0,0,22,1,0,0,0,1,27,0,17,1,0,0,1,0,21,1,0,0,0,0,23,1,0,0,0,0,22,0,1,0,0,0,-185,0,0,1,0,0,12,0,23,0,0,0,22,57,1,10,0,0,0,1,0,34,0,0,0],"texts":["The"," single"," web","_search"," call"," failed"," with"," an"," error","."," Per"," your"," instructions",","," I"," did"," not"," ret","ry","."," Here"," is"," exactly"," what"," the"," tool"," error"," states",":\n\n","-"," **","Endpoint"," used",":**"," `","http","://","127",".","0",".","0",".","1",":","431","18","/an","throp","ic","/v","1","/m","essages","`\n","-"," **","Error",":**"," Deep","Se","ek"," API"," error"," (","HTTP"," ","401","):"," invalid"," snapshot"," API"," key","\n","-"," **","Configuration","/","rest","riction"," facts"," stated"," in"," the"," error",":","**\n"," "," -"," Search"," endpoint"," configuration"," is"," separate"," from"," chat",".\n"," "," -"," If"," that"," endpoint"," is"," not"," intended",","," the"," user"," should"," set"," `","D","EEP","SEE","K","_SE","ARCH","_B","ASE","_URL","`"," or"," `","web","-search","-de","ep","seek",".base","URL","`"," to"," a"," trusted"," Anthrop","ic","-com","patible"," Messages"," API"," base",".\n"," "," -"," The"," instruction"," states"," not"," to"," choose"," or"," change"," the"," endpoint"," for"," the"," user","."]}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"block-end","index":0,"block":{"type":"reasoning","text":"The web_search failed with an error. Per the user's instructions: do not retry, report only the endpoint and configuration/restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct."}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"block-end","index":1,"block":{"type":"text","text":"The single web_search call failed with an error. Per your instructions, I did not retry. Here is exactly what the tool error states:\n\n- **Endpoint used:** `http://127.0.0.1:43118/anthropic/v1/messages`\n- **Error:** DeepSeek API error (HTTP 401): invalid snapshot API key\n- **Configuration/restriction facts stated in the error:**\n - Search endpoint configuration is separate from chat.\n - If that endpoint is not intended, the user should set `DEEPSEEK_SEARCH_BASE_URL` or `web-search-deepseek.baseURL` to a trusted Anthropic-compatible Messages API base.\n - The instruction states not to choose or change the endpoint for the user."}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"usage","usage":{"inputTokens":129,"outputTokens":207,"totalTokens":8272,"cacheReadTokens":7936,"reasoningTokens":48}}}}
|
||||
{"type":"assistant/chunk","data":{"turn":1,"step":2,"chunk":{"type":"finish","reason":{"kind":"stop"}}}}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The web_search failed with an error. Per the user's instructions: do not retry, report only the endpoint and configuration/restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct."},{"type":"text","text":"The single web_search call failed with an error. Per your instructions, I did not retry. Here is exactly what the tool error states:\n\n- **Endpoint used:** `http://127.0.0.1:43118/anthropic/v1/messages`\n- **Error:** DeepSeek API error (HTTP 401): invalid snapshot API key\n- **Configuration/restriction facts stated in the error:**\n - Search endpoint configuration is separate from chat.\n - If that endpoint is not intended, the user should set `DEEPSEEK_SEARCH_BASE_URL` or `web-search-deepseek.baseURL` to a trusted Anthropic-compatible Messages API base.\n - The instruction states not to choose or change the endpoint for the user."}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":129,"outputTokens":207,"totalTokens":8272,"cacheReadTokens":7936,"reasoningTokens":48}},"sourceEventSeqs":[[106,317]],"surfaceOp":"append"}
|
||||
{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"reasoning","text":"The web_search failed with an error. Per the user's instructions: do not retry, report only the endpoint and configuration/restriction facts stated in the tool error. Do not infer why it failed or whether the endpoint is correct."},{"type":"text","text":"The single web_search call failed with an error. Per your instructions, I did not retry. Here is exactly what the tool error states:\n\n- **Endpoint used:** `http://127.0.0.1:43118/anthropic/v1/messages`\n- **Error:** DeepSeek API error (HTTP 401): invalid snapshot API key\n- **Configuration/restriction facts stated in the error:**\n - Search endpoint configuration is separate from chat.\n - If that endpoint is not intended, the user should set `DEEPSEEK_SEARCH_BASE_URL` or `web-search-deepseek.baseURL` to a trusted Anthropic-compatible Messages API base.\n - The instruction states not to choose or change the endpoint for the user."}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:5}}"},"usage":{"inputTokens":129,"outputTokens":207,"totalTokens":8272,"cacheReadTokens":7936,"reasoningTokens":48}},"sourceEventSeqs":[106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317],"surfaceOp":"append"}
|
||||
{"type":"step/end","data":{"turn":1,"step":2}}
|
||||
{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}}
|
||||
|
||||
Reference in New Issue
Block a user