Skip to content

fix(responses): restrict native steering to subscription routes - #572

Closed
luvs01 wants to merge 9 commits into
devfrom
codex/propose-fix-for-api-steering-vulnerability
Closed

luvs01 wants to merge 9 commits into
devfrom
codex/propose-fix-for-api-steering-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Motivation

  • Prevent successor generations sent over an API-key OpenAI Responses WebSocket from bypassing per-request send admission and durable spend reservations by disallowing single-agent steering on that route.

Description

  • Restrict native control eligibility so only the canonical ChatGPT forward/subscription route can perform steering while allowing API-key Responses sockets to retain multi-agent injection (change in src/server/responses/native-response-control.ts).
  • Harden the upstream WebSocket attachment so non-canonical/API-key sockets cannot attach a steering control channel even when a caller supplies it (src/server/responses/ws-upstream.ts).
  • Update steering tests to assert public-API steering is rejected and keep subscription continuation behavior intact (tests/responses/ws-steering-completion.test.ts).
  • Update operator and architecture documentation to reflect the corrected steering boundary and retained public-API injection support (structure/transports/streaming-health.md and docs-site/src/content/docs/guides/codex-integration.md).

Testing

  • Ran focused steering/injection tests with bun test tests/responses/ws-steering-completion.test.ts tests/responses/ws-native-injection.test.ts and the modified suite passed (67 tests passed across those files).
  • Ran type checking and repository gates with bun run typecheck, bun run structure:check, and bun run privacy:scan, all of which passed.
  • Built docs with cd docs-site && ../node_modules/.bin/bun install --frozen-lockfile && ../node_modules/.bin/bun run build, which completed successfully.
  • Started a full test run via bun run test; unrelated failures were observed in other subsystems (external-process teardown and Lab automation tests) and do not indicate regressions in the changed steering code.

Codex Task


Devin Review

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d32206d1-c2f3-46df-800f-c352554dcde8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T12:57:06.645332Z 5856bfd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@github-actions github-actions Bot added the bug Something isn't working label Sep 20, 2026
…forwarded role (lidge-jun#5334 follow-up)

lidge-jun#5334 made the developer wire role tri-state: an undeclared destination folds
it to system. Two suites asserting role:"developer" on the Chat wire were
missed because they are about tool-result repair ordering and document parts,
not role selection — declare the destination, per the convention the change
established.

Verified: both files fail on dev@600075d2 with system-for-developer wire roles
and pass with the declaration.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
d6d8744 made foldDeveloperRoleToSystem tri-state with the unset state
folding to system, and updated the ordering suites to declare their
destinations. The dangling tool_calls suite asserts where the deferred
developer barrier lands, so it is about placement rather than the role
default — declare foldDeveloperRoleToSystem: false to keep the barrier
reading developer, matching the pattern in openai-chat-system-order.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The widget job builds an unsigned desktop app and never sets
TAURI_SIGNING_PRIVATE_KEY. Since the updater plugin ships a pubkey in
tauri.conf.json, tauri build emits OpenCodex.app.tar.gz as an updater
artifact and then fails demanding the private key. Merge a
createUpdaterArtifacts=false config override into just this step so the
unsigned build skips updater artifacts; release.yml signing is
unchanged.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…api-steering-vulnerability

Resolve tests/adapters/openai/openai-chat-dangling-toolcalls.test.ts by
taking dev's wording: both sides add the same
foldDeveloperRoleToSystem: false declaration (cfbc042 vs f700c56)
and differ only in the comment.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Tauri v2 names the in-bundle binary after the Cargo package
(opencodex-desktop), not productName, so the widget job's
Contents/MacOS/OpenCodex assertion could never pass — it never ran
green since the desktop stack landed. mainBinaryName is the documented
knob for renaming the bundled executable, and it matches the macOS
convention the verify step asserts (OpenCodex.app/Contents/MacOS/OpenCodex).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
If a path assertion fails again the log shows the actual layout
instead of a bare exit 1.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Devin Review

Comment thread .github/workflows/ci.yml
- name: Verify WidgetKit appex and desktop app
run: |
app=desktop/src-tauri/target/release/bundle/macos/OpenCodex.app
find "$app/Contents" -type f | sort

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Workflow change requires explicit security review

Repository policy treats every GitHub Actions modification as a security-boundary change requiring explicit security review before merge.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown

Fixed in 118362e. Removed the stale public-API WebSocket steering eligibility from the enablement instructions in this guide (it now names only the canonical ChatGPT forward route and adds public API-key routes to the unsupported-route list), and dropped the matching "explicitly opted-in canonical OpenAI API route" claim in structure/transports/streaming-health.md.

@devin-ai-integration

Copy link
Copy Markdown

Fixed in 118362e. The in-page link to the removed #steering-continuation-settings-and-public-api anchor was deleted along with the stale public-API steering clause it described, and reference/configuration/server.md now links to #steering-continuation-settings.

@luvs01

luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Closing: superseded by combined PR #613, which carries this PR's subscription-route restriction for native steering together with the steering memory/body limits on current dev. Combined tests: 157 pass.

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

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant