Skip to content

Require hosted plugin discovery to return a rejected promise - #5655

Merged
freeqaz-openai merged 1 commit into
mainfrom
codex/restore-hosted-plugin-promise-assertion
Nov 12, 2026
Merged

freeqaz-openai merged 1 commit into
mainfrom
codex/restore-hosted-plugin-promise-assertion

Conversation

@freeqaz-openai

Copy link
Copy Markdown
Collaborator

Summary

Require both hosted catalog operations to return a Promise before checking how they reject a malformed warm identity. The test still verifies that neither operation contacts the provider.

Validation

  • The hosted plugin discovery suite passed all 26 cases with zero skips on the tested composition.
  • For each operation, an injected synchronous throw passed the original assertion and failed the corrected assertion. All four controls made zero provider requests.
  • Strict typecheck, workspace boundary, focused lint and formatting checks passed on the tested composition. The candidate preserves the tested change and the test's executable inputs.

@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner November 12, 2026 10:53
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR checks that both hosted catalog operations return a Promise before asserting their rejection of malformed identity metadata.

Example: A JavaScript caller supplies isFedramp: "true", and discoverCatalog synchronously throws credentials_rejected.

  • Before: The async assertion wrapper converts the synchronous throw into a rejection, so the test passes.
  • After: The synchronous throw fails the test; only a returned Promise with the expected rejection passes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A correct, minimal assertion repair supported by source inspection and passing exact-head CI; detailed mutation-control output was not independently available.
Proof confidence 🦐 gold shrimp (3/6) Only a conformance assertion changes; shipped-entry-point proof is unnecessary, and the supplied validation reports both passing behavior and controls that expose the original false positive.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The conformance suite can miss a Driver regression that throws synchronously instead of returning a rejected Promise.
Reason: The maintainer-authored change protects an existing contract with a smaller assertion and no runtime or configuration expansion.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a concrete false-positive assertion with a minimal test-only change. No introduced defects were found, and exact-head required CI passed.

Priority: P3
Reviewed head: e0630e5893e3559aff1026dbb22d782703439b77

Before merge

None.

Findings

None.

Agent review details

How this fits together

OCC calls the selected Plugin Driver for catalog discovery and details; the hosted implementation validates credential metadata before requesting provider data.

flowchart LR
  A[OCC discovery caller] --> B[Codex Plugin Driver]
  B --> C[Credential validation]
  C --> D[Hosted catalog provider]
  E[Conformance assertion] --> B
  B --> F[Promise result or rejection]
Loading

Technical review

Best possible solution:

Land the focused assertion repair while retaining rejection matching and the existing prohibition on provider requests.

Do we have a high-confidence way to reproduce the issue?

Source inspection establishes the false-positive path: a synchronous credentials_rejected throw inside the old async callback becomes an accepted rejection; no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Moving invocation outside the wrapper is the smallest complete fix and checks the existing Promise contract without changing production behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2765f1de9ad6.

Provenance checked

  • Malformed warm-identity assertion keeps the original intent (f0ce331: The strict TypeScript migration separated deliberately malformed JavaScript input from correctly typed cases and wrapped its reflective invocation in an async callback.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The only introduced hunk moves invocation and the Promise assertion outside the async wrapper, preserving rejection matching and the zero-provider-request assertion. (tests/conformance/hosted-plugin-discovery.test.ts:308, e0630e5893e3)
  • Current main retains the assertion gap: Fetched main still invokes the malformed-identity operations inside assert.rejects(async () => ...), which accepts a synchronous PluginDiscoveryError with the expected properties. (tests/conformance/hosted-plugin-discovery.test.ts:308, 2765f1de9ad6)
  • Existing asynchronous contract: Both catalog operations declare Promise return types; the concrete methods are async, and hosted credential validation rejects a nonboolean isFedramp before provider access. (packages/contracts/src/drivers/plugin/index.ts:74, e0630e5893e3)
  • Original intent and feature history: Type plugin discovery integration and conformance tests #5649 migrated these tests to strict TypeScript and introduced the wrapper while preserving malformed JavaScript input coverage; this PR restores the intended asynchronous assertion without changing the Driver contract. (tests/conformance/hosted-plugin-discovery.test.ts:308, f0ce33134997)
  • Validation and discussion: The full PR body reports 26 passing cases and synchronous-throw controls for both methods; comments contain only review-status updates. Exact-head Checks and Conformance 2 and CI Required succeeded. Detailed job logs redirected to a blocked artifact host, so the reported control runs were not independently inspected. (e0630e5893e3)
  • Repository review policy: Read the complete root AGENTS.md; no nested instructions govern the changed test, and no maintainer-notes directory or pr-simplify skill exists. Applied test-audit and enterprise-testing guidance; the explicit single-reviewer instruction overrides the bundled autoreview-helper requirement. No tests or helpers were executed, and the checkout remained clean. (AGENTS.md, e0630e5893e3)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Change scope Production +0/-0; tests +3/-5 Repairs the existing assertion without adding cases, fixtures, or runtime machinery.

Labels

Label changes:

  • add P3: A narrow conformance-test correction with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: A narrow conformance-test correction with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 12, 2026, 6:06 AM ET / 11:06 UTC.

@freeqaz-openai
freeqaz-openai merged commit cd2a1f3 into main Nov 12, 2026
60 checks passed
@freeqaz-openai
freeqaz-openai deleted the codex/restore-hosted-plugin-promise-assertion branch November 12, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant