fix(plugins): ignore throwing provider policy hooks#88950
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 8:24 PM ET / 00:24 UTC. Summary PR surface: Source +101, Tests +152. Total +253 across 4 files. Reproducibility: yes. source-reproducible. Current main returns raw bundled provider-policy surfaces and provider-runtime invokes those hooks directly before runtime fallback, so a throwing hook propagates. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the centralized wrapper only after provider/plugin owners accept fail-open behavior for all four hook surfaces and build or changed-gate validation passes; split stricter auth/default behavior if that policy is not accepted. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main returns raw bundled provider-policy surfaces and provider-runtime invokes those hooks directly before runtime fallback, so a throwing hook propagates. Is this the best way to solve the issue? Yes, conditionally. Central wrapping at the public-artifact seam is the narrowest inspected repair if fail-open is the intended policy; if auth/default hooks must remain fail-closed, the PR should split those before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e87b0df67575. Label changesLabel justifications:
Evidence reviewedPR surface: Source +101, Tests +152. Total +253 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Closing this fuzz-only hardening PR. The only failing state is a synthetic fixture using hostile in-process objects, throwing getters or callbacks, or similarly malformed metadata; there is no linked production report or supported external contract requiring that state. This adds broad fail-soft behavior and substantial regression surface across consumers. If a real plugin or provider demonstrates the failure, please open a focused issue with the observed payload and stack so validation can live at the single owning registration/parsing boundary. Thanks for exploring it. |
Summary
Verification
node scripts/run-vitest.mjs src/plugins/provider-public-artifacts.test.ts src/plugins/provider-runtime.test.ts --reporter=dotnode_modules/.bin/oxfmt --check --threads=1 src/plugins/provider-public-artifacts.ts src/plugins/provider-public-artifacts.test.ts src/plugins/provider-runtime.ts src/plugins/provider-runtime.test.tsnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src/plugins/provider-public-artifacts.ts src/plugins/provider-public-artifacts.test.ts src/plugins/provider-runtime.ts src/plugins/provider-runtime.test.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode local --prompt 'Review the corrected provider-policy public-artifact hardening patch after addressing prior findings. Bundled provider policy hooks are wrapped to log and fail open; failure state is per current invocation and cleared before each hook call; provider-runtime callers continue to runtime provider hooks only when the current bundled hook failed, preserving no-op short-circuit semantics otherwise. Focus on fallback correctness, stale failure state, logging, cache behavior, and regression coverage.'Real behavior proofcompleted successfullyBehavior addressed: A broken bundled provider-policy hook no longer crashes config/provider/thinking resolution, and runtime provider hooks are still available when the public-artifact hook is the broken part.
Real environment tested: Local Codex gwt worktree on macOS using the repo Vitest node wrapper and repo lint/format wrappers.
Exact steps or command run after this patch: See Verification above.
Evidence after fix: Focused Vitest passed 1 shard / 64 tests; oxfmt, oxlint,
git diff --check, private-name scrub, autoreview, and PR proof workflow all passed.Observed result after fix: Throwing synthetic
fuzzpluginprovider-policy hooks are logged and ignored; stale hook-failure state is cleared before later successful calls; runtime provider hooks still run after current bundled-hook failures.What was not tested: Remote
check:changedandpnpm buildare blocked right now: Blacksmith Testbox auth is missing, AWS Crabbox is at the active lease limit, and direct localpnpm buildin this Codex worktree attempted dependency reconciliation and aborted before build execution.