Skip to content

fix(openai): stop repeated deterministic tool failures - #7423

Open
xuhaihan wants to merge 1 commit into
Wei-Shaw:mainfrom
xuhaihan:fix/openai-repeated-tool-failure-loop
Open

xuhaihan wants to merge 1 commit into
Wei-Shaw:mainfrom
xuhaihan:fix/openai-repeated-tool-failure-loop

Conversation

@xuhaihan

Copy link
Copy Markdown
Contributor

Summary

  • detect consecutive deterministic failures for the same Responses tool in the current user turn
  • temporarily remove only the failing tool after two failures and add a model instruction to continue without it
  • support top-level, flattened, and Responses Lite namespaced tools across HTTP, WebSocket, and the WS-to-HTTP bridge
  • reconstruct state from request history so the guard works across reconnects, failover, and gateway replicas

This is intentionally separate from the declaration/translation fixes in #6062: it protects the runtime when a compatible provider still keeps selecting a tool with an invalid handle or another deterministic failure.

Validation

  • go test ./internal/service -run TestOpenAIResponsesToolLoopGuard -count=1
  • go test ./internal/service -count=1
  • go test ./...
  • git diff --check
  • sensitive-content scan

@xuhaihan

xuhaihan commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@Wei-Shaw 您好,已将此 PR 更新到最新 main(当前 head:f6473765f1),GitHub 显示可合并,当前测试、前端、lint、安全及 CLA 检查均已通过。方便时烦请 review 并合并,谢谢。

@xuhaihan
xuhaihan force-pushed the fix/openai-repeated-tool-failure-loop branch from f647376 to f249e3d Compare October 8, 2026 07:20
@xuhaihan

Copy link
Copy Markdown
Contributor Author

@Wei-Shaw 您好,再次提醒您检查这个 PR。当前 head 为 f249e3dc76,测试、前端、lint、安全及 CLA 检查均已通过(cla-lock 按流程跳过),GitHub 当前显示可合并。方便时烦请 review,如无其他问题请帮忙合并;如还需要调整,我会继续跟进。谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant