fix(proxy): wire no-progress detector into OpenAI chat completions#826
Open
rohith500 wants to merge 2 commits into
Open
fix(proxy): wire no-progress detector into OpenAI chat completions#826rohith500 wants to merge 2 commits into
rohith500 wants to merge 2 commits into
Conversation
Add the failing positive-control for ProxyOpenAIChatCompletion (identical tool-bearing fingerprints must break at threshold 5), a varying-tools negative control, and coverage for handleNoProgressBreak's FormatOpenAI chat.completion shape. Signed-off-by: N Rohith Reddy <rohithreddy2202@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
ProxyOpenAIChatCompletion now runs the same cross-envelope no-progress gate as ProxyMessages after routing, making handleNoProgressBreak's FormatOpenAI branch reachable in production. Fixes workweave#825. Signed-off-by: N Rohith Reddy <rohithreddy2202@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
PR author is not in the allowed authors list. |
Contributor
|
Thanks for this, @rohith500 — really clean contribution. Reviewed against the root
CI is green. LGTM — thanks again! |
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
Fixes #825:
ProxyOpenAIChatCompletionnow runs the same cross-envelope no-progress detector thatProxyMessagesalready has (5 identical dispatch fingerprints within 90s → synthetic stop viahandleNoProgressBreak).computeNoProgressFingerprint/recordAndDetect/handleNoProgressBreak— including the previously production-deadFormatOpenAIsyntheticchat.completionbranch.!agentShadowMode && !AuthoritativePerTurn && toolBearingTurn && noProgress != nil.AssistantToolCallSignatures+LastUserMessage().HasToolResultfor trailingrole=toolmessages), snapshotted before compaction like Messages.ProxyOpenAIResponsesstill delegates toProxyOpenAIChatCompletion(confirmed), so Responses ingress inherits this automatically. Gemini out of scope.Test plan
TestProxyOpenAIChatCompletion_NoProgressBreaksAtThresholdfailed withbrokeAt=0, upstreamHits=6No-progress loop detectedTestHandleNoProgressBreak_OpenAIChatCompletionShape— assertsobject=chat.completion, assistant/stop, prompt_tokensTestNoProgress*suite still green (Messages path unchanged)make checkpassedbreak, 4-below-threshold no break, 5-across-expired-window no break,
same-messageCount-different-content no false collision, 16-concurrent
no panic
Before / after (positive control)
Before (commit 1 only):
After (commit 2):
Follow-up (non-blocking)
With no pin store configured, both Messages and OpenAI fall back to a
shared
install:<id>:<role>fingerprint bucket (pre-existing coarsenessfor Messages alone; now also shared with OpenAI). In production with a
pin store, keys are per-session via DeriveSessionKey, so this only
matters for installations running without one. Not a regression this PR
introduces — the install-bucket fallback already existed — just newly
shared across two surfaces. Worth a follow-up look if pin-store-less
installations turn out to be common enough to matter; not blocking this
fix.