-
-
Notifications
You must be signed in to change notification settings - Fork 508
fix: activate skills when VT scan is unavailable or stales out #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -305,7 +305,16 @@ export const scanWithVirusTotal = internalAction({ | |||||||||||||||||||||||||||
| handler: async (ctx, args) => { | ||||||||||||||||||||||||||||
| const apiKey = process.env.VT_API_KEY | ||||||||||||||||||||||||||||
| if (!apiKey) { | ||||||||||||||||||||||||||||
| console.log('VT_API_KEY not configured, skipping scan') | ||||||||||||||||||||||||||||
| console.log('VT_API_KEY not configured, skipping scan — activating skill') | ||||||||||||||||||||||||||||
| // Activate the skill so it appears in search despite no VT scan. | ||||||||||||||||||||||||||||
| const version = await ctx.runQuery(internal.skills.getVersionByIdInternal, { | ||||||||||||||||||||||||||||
| versionId: args.versionId, | ||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||
| if (version) { | ||||||||||||||||||||||||||||
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | ||||||||||||||||||||||||||||
| skillId: version.skillId, | ||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -524,6 +533,11 @@ export const pollPendingScans = internalAction({ | |||||||||||||||||||||||||||
| versionId, | ||||||||||||||||||||||||||||
| vtAnalysis: { status: 'stale', checkedAt: Date.now() }, | ||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||
| // Activate the skill so it appears in search — absence of a VT | ||||||||||||||||||||||||||||
| // verdict should not permanently hide a published skill. | ||||||||||||||||||||||||||||
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | ||||||||||||||||||||||||||||
| skillId, | ||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| // Activate the skill so it appears in search — absence of a VT | |
| // verdict should not permanently hide a published skill. | |
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | |
| skillId, | |
| }) | |
| // Activate the skill so it appears in search — absence of a VT | |
| // verdict should not permanently hide a published skill. | |
| const skill = await ctx.runQuery(internal.skills.getSkillByIdInternal, { skillId }) | |
| if (skill?.moderationReason !== 'quality.low') { | |
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | |
| skillId, | |
| }) | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: convex/vt.ts
Line: 536:540
Comment:
bypasses quality gate quarantine - skills with `moderationReason: 'quality.low'` will be activated even though they should remain hidden
check the skill's `moderationReason` before activating:
```suggestion
// Activate the skill so it appears in search — absence of a VT
// verdict should not permanently hide a published skill.
const skill = await ctx.runQuery(internal.skills.getSkillByIdInternal, { skillId })
if (skill?.moderationReason !== 'quality.low') {
await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, {
skillId,
})
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit a8e62e2. Added getSkillByIdInternal lookup and check if (skill?.moderationReason !== "quality.low") before activating the skill. This ensures that skills in quality gate quarantine remain hidden even when VT scan is unavailable.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same quality gate bypass issue as above
| // Activate the skill so it appears in search — absence of a VT | |
| // verdict should not permanently hide a published skill. | |
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | |
| skillId, | |
| }) | |
| // Activate the skill so it appears in search — absence of a VT | |
| // verdict should not permanently hide a published skill. | |
| const skill = await ctx.runQuery(internal.skills.getSkillByIdInternal, { skillId }) | |
| if (skill?.moderationReason !== 'quality.low') { | |
| await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, { | |
| skillId, | |
| }) | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: convex/vt.ts
Line: 566:570
Comment:
same quality gate bypass issue as above
```suggestion
// Activate the skill so it appears in search — absence of a VT
// verdict should not permanently hide a published skill.
const skill = await ctx.runQuery(internal.skills.getSkillByIdInternal, { skillId })
if (skill?.moderationReason !== 'quality.low') {
await ctx.runMutation(internal.skills.setSkillModerationStatusActiveInternal, {
skillId,
})
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit a8e62e2. Same fix applied here — added skill lookup and moderationReason check before activating. Skills with quality.low moderation reason will not be activated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same quality gate bypass - check
moderationReasonbefore activatingPrompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit a8e62e2. Same fix applied — added skill lookup and moderationReason check before activating. This prevents quality gate quarantine bypass in the non-VT-API path.