GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(ai): classify OpenAI cyber_policy refusals as content policy by lu-zero · Pull Request #64844 · anomalyco/opencode

Conversation

@lu-zero

@lu-zero lu-zero commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #64843

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenAI's cybersecurity safeguard reports its refusals with the code cyber_policy, both as an HTTP 400 and as an error frame mid-stream. That code was not in CONTENT_POLICY_CODES and the wording does not match CONTENT_POLICY_TEXT, so these refusals fell through to UnknownProvider. Adding the code makes classifyProviderFailure return ContentPolicy for both shapes, since providerCodes already reads the code from the body or from the code: message summary.

How did you verify your code works?

Added a test in packages/ai/test/provider-error.test.ts covering the 400 body and the stream error frame; it fails without the change and passes with it. bun test test/provider-error.test.ts and bun run typecheck in packages/ai pass.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lu-zero
fix(ai): classify OpenAI cyber_policy refusals as content policy
e4c8e0b
@github-actions github-actions Bot added the contributor label Nov 19, 2026
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I reproduced it on the base branch: running OpenAI's cyber_policy stream error frame through the Responses providerFailure path gives UnknownProvider, and with this change it gives ContentPolicy. The new test fails on the base branch and passes here. The full provider-error.test.ts suite passes, and tsc --noEmit on packages/ai is clean. The code lookup runs before the quota, auth, rate-limit and server-error checks, so both the HTTP 400 and the mid-stream shapes go through it. The public API is unchanged. No concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Nov 19, 2026
OpenAI cyber_policy refusals are classified as UnknownProvider instead of ContentPolicy #64843
Closed
fix(ai): classify OpenAI cyber_policy refusals as content policy #64892
Closed
@neriousy
neriousy enabled auto-merge (squash) November 19, 2026 16:57
@neriousy
neriousy merged commit bca1def into anomalyco:dev Nov 19, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@teknium1 teknium1 mentioned this pull request Nov 20, 2026
Provider safety refusals no longer read as a bad API key or a malformed request (port opencode#64844/#64910, salvage #117442) NousResearch/hermes-agent#158061
Open
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@devin-ai-integration devin-ai-integration Bot mentioned this pull request Nov 25, 2026
upstream: provider/security fixes not yet ported AltimateAI/altimate-code#1478
Open
29 of 90 tasks
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
@Anshu666666 Anshu666666 mentioned this pull request Nov 27, 2026
fix(ai): classify airlock 'inlined media exceeds' as payload-too-large #64467
Open
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

OpenAI cyber_policy refusals are classified as UnknownProvider instead of ContentPolicy

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lu-zero @neriousy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.