ac4af582301a4e8a29245dbba767eba31334ddf9
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2027bb5a6d |
gateway: a filter's finish code after the reply began asks the group's next member (#5075)
A vendor that answers with a canned refusal line as the content and has its finish_reason "content_filter" follow (#5075: CodeArts's deepseek-v4.1-flash, 10/10 on the same body, 47 tokens out, the line byte-identical) was a try that stood as a success: the line had gone out as content, so the scan's refusal paths were past, only refusedAfter was marked, the group's next member was never asked, and a client that reads finish reasons — Pi's and DeepSeek Harness's mapStopReason, Claude Code — failed the whole turn on it. Another member of the same group answered 620 tokens. refusalAfter now hands the try over (handOffAfter) when the refusal is the vendor's own finish code (eventRefusal), the reply is passing, a candidate stands behind it reading Chat chunks, and no call of the reply has gone by: what of the write went by before the code goes out with the reply, the code, its usage and [DONE] do not, and the next member's chunks follow in the same stream, as a refusal after reasoning is (handOver). The member isn't set aside: the request was refused, not the account (#248). A refusal still held goes through the scan's own paths (flow, handOver) as before; an error event mid-reply stays as it came (#733); an Anthropic or Responses client's stream is numbered and what of it has gone by is untracked, so its refusal keeps going as it came. TestRefusalAfterThinkingAndTextStays becomes TestRefusalAfterThinkingAndTextFailsOver: a Chat client is handed over now, where it ended on the vendor's finish code before. Fixes #5075 Reviewed and ported: composes with #2972 (passthrough holds the end, the hold writer sees the error event). The hand-off is held to Chat streams that sent no tool call (handsOff checks h.calls); that guard had no test, so TestFilterFinishAfterACallStays is added here: a content_filter finish after a tool_call stays with the first member and the call reaches the client. On mote, -run 'Refusal|CannedRefusal|FilterFinish': with the non-test part reverted, red: "TestCannedRefusalFinishFailsOver ... chat: 200" and "TestRefusalAfterThinkingAndTextFailsOver ... 200 (a 1, b 0)"; with the calls guard removed by hand, TestFilterFinishAfterACallStays red; green with the patch. Whole package: ok (906.6s). Not tried: a real vendor's canned refusal (CodeArts, qoder). The refusal text already streamed stays in the client's stream before the next member's answer. Generated-by: GLM-5.3-Flash (ZCode) Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
0a5dc40abc |
gateway: a group's trusted Claude, GPT and Gemini thinking streams as it comes, a refusal or error after it going to the next member (#4166)
A try whose model's vendor may refuse after its reasoning (#248) had its reasoning held while another candidate could answer, whatever the member had answered lately. Through a routing group Claude Code saw a Claude member's thinking only with its text, all at once, and never its "thinking with <effort> effort". waynesguan measured it on one WorkBuddy account: `workbuddy claude-opus-5.5` alone, first thinking at 3.66s; through the group, all 67 thinking deltas with the text at 17.25s. Ported from waynesguan's 71aacaa (on |
||
|
|
645eb92f3f |
gateway: a refusal after shown thinking goes to the next fallback
yhwangl on X: a request whose content trips a vendor's safety filter after the model streamed its thinking, before any answer, stopped there; the group's next member was never asked, as it is when credit runs out. When a model's reasoning is shown, a try passes on its first thinking event, so a refusal after it was the agent's. Now, for a streamed Anthropic, Chat or Responses request with another member still to ask (handsOver), the try's events go out one by one (passOver) and a refusal or refusal error before any text or tool call hands the request on (handOver): Anthropic's open blocks are closed and the next member's stream is spliced into the same reply (spliceAfter): its message_start or response.created/in_progress/queued are dropped, block indexes or output_index go after those sent, sequence_number goes on. Chat chunks go as they come. Once text or a call has gone, a refusal stays the agent's as before. With no other member nothing changes. A refusal is about the request, so nobody is rested for it. Zhipu's finish_reason "sensitive" and error 1301 (敏感), DashScope's data_inspection_failed and Volcengine Ark's *SensitiveContentDetected are now read as refusals too. Not covered (#4604): Gemini clients; a Responses reasoning item handed over gets no output_item.done and the next completed lists only its own output; A's thinking signature stays in the reply; non-streamed requests. Run (mote, worktree at base |