Skip to content

[codex] Port live AiGateway service architecture - #10

Merged
Pigbibi merged 1 commit into
mainfrom
codex/port-live-aigateway-architecture
Jul 3, 2026
Merged

[codex] Port live AiGateway service architecture#10
Pigbibi merged 1 commit into
mainfrom
codex/port-live-aigateway-architecture

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Port the latest live AiGateway service/dashboard architecture into the canonical AIAuditBridge repo while keeping CodexAuditBridge only as temporary legacy compatibility.
  • Fix the dashboard empty/loading/error states so panels center text both horizontally and vertically; improve mobile topbar spacing.
  • Register monthly remediation PRs into the AiGateway change feed and persist quota state across service restarts.

Why

AIAuditBridge is now the canonical QuantStrategyLab AI audit bridge, but the old CodexAuditBridge repo had newer live service/dashboard fixes. This PR brings those fixes forward so the dashboard can become a real operational surface instead of a static shell.

Validation

  • bash -n scripts/deploy_codex_audit_service.sh
  • node --test cloudflare/ai-gateway-dash/tests/index.test.mjs
  • python3 -m ruff check .
  • python3 -m unittest discover -s tests -v (206 tests)
  • git diff --check
  • Browser QA against local dashboard smoke server at desktop 1280px and mobile 390x844; console warnings/errors: 0.

Notes

  • CodexAuditBridge remains in service allowlists only for migration compatibility.
  • Effectiveness and shadow-audit widgets still require their real producer workflows to submit /v1/ai/feedback/evaluate and /v1/ai/feedback/shadow data.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🤖 Codex PR Review

⚠️ Review skipped: The Codex review could not be completed.

Codex service request failed: 401 {"status": "error", "error": "OIDC workflow_ref is not allowed"}

Please ensure a human reviewer checks this PR before merging.

@Pigbibi
Pigbibi marked this pull request as ready for review July 3, 2026 22:40
@cursor

cursor Bot commented Jul 3, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Pigbibi
Pigbibi merged commit f95d1dd into main Jul 3, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e35afcf94

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1015 to +1016
except BridgeError as exc:
return str(exc)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Catch transport errors during change-feed registration

When CODEX_AUDIT_SERVICE_URL is set, this best-effort helper only converts BridgeErrors into warnings. request_codex_service_json() can also raise transport/timeout errors or JSONDecodeError for non-JSON responses, and publish_remediation() calls this after pushing/creating the PR but before posting the source issue comment. In those service-outage cases the run can fail after the remediation PR exists, leaving operators without the completion comment even though the change-feed write was intended to be non-blocking.

Useful? React with 👍 / 👎.

Comment on lines +11 to +12
ALLOWED_WORKFLOW_REFS="${CODEX_AUDIT_SERVICE_ALLOWED_WORKFLOW_REFS:-QuantStrategyLab/AIAuditBridge/.github/workflows/codex_audit.yml@refs/heads/main,QuantStrategyLab/AIAuditBridge/.github/workflows/codex_pr_review.yml@refs/heads/main,QuantStrategyLab/AIAuditBridge/.github/workflows/codex_pr_review.yml@refs/pull/*/merge,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_audit.yml@refs/heads/main,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_pr_review.yml@refs/heads/main,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_pr_review.yml@refs/pull/*/merge}"
ALLOWED_REFS="${CODEX_AUDIT_SERVICE_ALLOWED_REFS:-refs/heads/main,refs/pull/*/merge}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not allow PR refs to authenticate to the service

Allowing codex_pr_review.yml@refs/pull/*/merge and refs/pull/*/merge means PR runs can mint OIDC tokens that pass the service allowlist. I checked .github/workflows/codex_pr_review.yml: it runs on pull_request, grants id-token: write, checks out the PR merge commit, then runs python scripts/run_codex_pr_review.py, so in PR contexts where GitHub exposes the requested OIDC token (for example same-repository PR branches), PR-authored code can submit arbitrary jobs to the shared Codex service instead of being limited to trusted main-branch workflow code.

Useful? React with 👍 / 👎.

Comment on lines +85 to +87
function shouldIgnoreLegacyEndpointBase(basePath, pathname) {
return basePath === "/v1/codex-audit" && pathname.startsWith("/v1/ai/");
}

This comment was marked as off-topic.

@Pigbibi
Pigbibi deleted the codex/port-live-aigateway-architecture branch July 5, 2026 00:56
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