Repository navigation
Conversation
…m every entry point
|
@deanrie is attempting to deploy a commit to the Anysphere Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Oct 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
moderation.rescanPluginnow refuses while a scan for the plugin is already queued or running, and the MCPrescan_plugintool relies on that instead of its own copy of the check.Why
Two entry points queue an admin re-scan. The MCP tool checks the row first and refuses while
scan_statusispending/scanningwithupdated_atyounger than 15 minutes (its description promises exactly that). The web actionrescanPluginAction, behind the Re-scan buttons on the Stuck tab, the flagged review list and the plugin admin panel, callsrescanPlugindirectly, which setspendingand sends a queue message unconditionally.So a click while the first scan is still queued (waiting for the one-minute drain, or invisible under the 900 s visibility timeout) or running puts a second message for the same plugin into
plugin_scans. Each message becomes a fullrunPluginScan, that is a second billable agent run, and the twoapplyVerdictwrites race. The admin panel shows a spinner forpending/scanningbut keeps the button enabled;disabled={busy}only covers the button's own request.Change
moderation.ts:SCAN_IN_PROGRESS_MS(15 min, the same thresholdgetStuckScansand the recover cron use) andisScanInProgress(state);rescanPluginloads the row and throwsModerationErrorbefore the status write. Rows older than 15 minutes are still re-scannable, since that is the definition of stuck everywhere else.lib/mcp/tools.ts:rescan_plugindrops the private constant and check and callsrescanPluginwith the resolved id.adminToolalready returnsModerationErroras the tool error text, so the tool's reply is unchanged.The web action needs no edit:
safe-action.tsalready surfacesModerationErroras the toast text.Checked
moderation.tsand a stub Supabase that bumpsupdated_aton update like theplugins_set_updated_attrigger. Onmain:pending1 min old,scanning2 min old, and anerrorrow clicked three times all enqueue (3 messages for the three clicks). With this change: freshpending/scanningrefused with the MCP wording, three clicks give 1 message,pending/scanningolder than 15 min still enqueue,safe/flagged/error/unscannedunchanged. Run twice.tsc --noEmitclean, biome clean.git merge-treeclean againstmainand against fix(plugins): fail delete when no row was removed; render logos unoptimized #449, fix(plugins): install repo-ingested MCP servers under their submitted name and show a paste-ready config (lands #427; closes #416) #457, plugins: let owners re-run the security scan from the listing menu #458, fix(admin): judge a stuck scan by updated_at, like the recovery cron and the rescan tool #470, fix(github-plugin): encode repo paths in raw.githubusercontent.com URLs #472. plugins: let owners re-run the security scan from the listing menu #458 (owner re-scan) keeps its stricter own check and is unaffected.The check is read-then-write, so two requests inside the same few milliseconds can still both pass; the button
busystate covers that at human speed. A drain-side skip of messages older than the plugin'slast_scanned_atwould close the remaining window and the equalVT_SECONDS/STALE_AFTER_MScase in the recover cron; left for a separate change.