Repository navigation
Conversation
…an tool getStuckScans() treated a pending or scanning plugin as stuck once its created_at was older than 15 minutes. The recover-stuck-scans cron, added to use "the same 15-min staleness threshold getStuckScans uses", and the MCP rescan_plugin guard both measure from updated_at, which the plugins_set_updated_at trigger bumps on every status write. So a re-scan of any plugin older than 15 minutes showed up in the admin Stuck tab and in list_moderation_queue scan_issues the moment it was queued, while the cron left it alone, and the rescan tool refused to re-queue it as in progress. The query now uses updated_at, so the three agree.
|
@deanrie is attempting to deploy a commit to the Anysphere Team on Vercel. A member of the Team first needs to authorize it. |
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
Three places apply what is meant to be one 15-minute staleness rule for plugin scans:
/api/cron/recover-stuck-scans:scan_status in (pending, scanning)andupdated_atolder than 15 minutes, then re-enqueue. Its commit says it uses "the same 15-min staleness threshold getStuckScans uses".rescan_plugininlib/mcp/tools.ts: refuses whilepending/scanningandupdated_atis younger than 15 minutes, with the comment "Matches the stuck-scan threshold in getStuckScans()".getStuckScans()indata/queries.ts, which feeds the admin Stuck tab andlist_moderation_queue scan_issues:pending/scanningandcreated_atolder than 15 minutes.created_atis when the plugin row was created, not when the scan started. So a re-scan of any plugin older than 15 minutes (adminrescan_plugin, the recovery cron's own re-enqueue, or an owner re-scan once #458 lands) shows up in the Stuck tab the moment it is set topending, while the cron considers it healthy andrescan_pluginanswers that a scan is already pending. Theplugins_set_updated_attrigger bumpsupdated_aton every status write, which is why the other two rely on it.Fix
getStuckScans()filters onupdated_atinstead ofcreated_at, with a comment naming the two siblings. Theerrorbranch of the filter and the tab'screated_at descordering are unchanged.The repo has no test runner. The filter is the same PostgREST shape the cron already uses with
.lt("updated_at", cutoff).tsc --noEmit -p apps/cursor/tsconfig.jsonreports the same single pre-existing error asmain(platforminAgentOptionsinscan.ts) and nothing new;biome checkon the file is clean.