feat: ask user how to proceed on network/proxy issues - #1
Open
feng2919013386-oss wants to merge 1 commit into
Open
feat: ask user how to proceed on network/proxy issues#1feng2919013386-oss wants to merge 1 commit into
feng2919013386-oss wants to merge 1 commit into
Conversation
When a tool call fails with a network, proxy, connectivity, or rate-limit error (timeout, ECONNREFUSED, ENOTFOUND, ETIMEDOUT, proxy error, 429, 502/503/504, quota exceeded, certificate issues, ...), the model should stop and ask the user how to proceed instead of silently retrying or switching approaches. - Add NETWORK_ISSUE_PROMPT injected alongside CLARIFY_PROMPT into the system prompt forbidding silent retries and approach switches - Detect network/proxy error signatures in failed tool results and append a reminder nudging the model to call clarify_prompt with remedy options (retry / switch proxy or network / wait / fallback / skip) - Governed by the existing /clarify toggle; no-op without interactive UI - Add unit tests for detection and prompt injection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a tool call fails with a network, proxy, connectivity, or rate-limit error (timeout,
ECONNREFUSED,ENOTFOUND,ETIMEDOUT,ECONNRESET, proxy error,429,502/503/504, quota exceeded, certificate issues, ...), the model should stop and ask the user how to proceed instead of silently retrying or switching approaches.Changes
clarify-utils.ts: addNETWORK_ISSUE_PROMPTsystem-prompt section (injected alongsideCLARIFY_PROMPT),NETWORK_ERROR_PATTERNregex,isNetworkIssueResult()detection, andbuildNetworkReminderResult()tool-result patch helperindex.ts: listen totool_result— when an errored result matches network/proxy/rate-limit signatures, append a reminder nudging the model to callclarify_promptwith remedy options (retry / switch proxy or network / wait / fallback / skip)index.test.ts: 7 new unit tests (prompt content, detection coverage incl. Chinese error strings, no false positives on unrelated errors, prompt injection, reminder patch shape)README.md: document the new behaviorBehavior
/clarifytoggleisError: trueto avoid false positives