-
Notifications
You must be signed in to change notification settings - Fork 458
fix(ai-moderator): noop safe output + cache miss hardening #43525
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ safe-outputs: | |
| hide-comment: | ||
| max: 5 | ||
| allowed-reasons: [spam] | ||
| noop: | ||
| threat-detection: false | ||
| checkout: false | ||
| features: | ||
|
|
@@ -171,7 +172,7 @@ Use the cache memory at `/tmp/gh-aw/cache-memory/` to track spam activity across | |
|
|
||
| ### Reading the Spam Log | ||
|
|
||
| At the start of your analysis, try to read the spam log file at `/tmp/gh-aw/cache-memory/spam-log.json`. This file may not exist (it is absent on the first run or whenever the 24-hour cache has expired) — if it is missing, proceed with an empty array and **do not** call `missing_data`. The file contains an array of spam events: | ||
| At the start of your analysis, try to read the spam log file at `/tmp/gh-aw/cache-memory/spam-log.json`. **This file is optional.** A missing file is completely normal — it will be absent on the first run, after the 24-hour cache expires, or after a cache miss. A missing file is **not** a missing-data error. If the file does not exist, start immediately with an empty array and continue your analysis. **Never call `missing_data` for a missing spam log** — doing so will cause the workflow to fail unnecessarily. The file contains an array of spam events: | ||
|
|
||
| ```json | ||
| [ | ||
|
|
@@ -214,6 +215,7 @@ If no spam was detected, you may still update the log to remove stale entries, b | |
| - New contributors may have less polished writing - this doesn't necessarily indicate AI generation | ||
| - Provide clear reasoning for each detection in your analysis | ||
| - Only take action if you have high confidence in the detection | ||
| - **You MUST always emit at least one safe output.** After completing your analysis, if no spam was detected and no labels were applied, call the `noop` safe output to confirm that the content was reviewed and no action was required. Never exit without calling a safe output. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/diagnosing-bugs] The new mandatory guideline at line 218 overlaps with the existing 💡 SuggestionConsider removing the inline guideline at line 218 and relying solely on the shared If the inline version is intentionally stronger than the shared one (e.g., because this workflow's failure rate justified escalation), document that difference with a brief comment. @copilot please address this. |
||
|
|
||
| ## Report Formatting | ||
|
|
||
|
|
||
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.
[/diagnosing-bugs] The per-workflow override is correct, but the upstream system template
pkg/workflow/prompts/cache_memory_prompt.md(line 12) still unconditionally instructs agents: "If you look for data in the cache and do not find any, call themissing_datatool". Any other workflow usingcache-memorywith optional/ephemeral files will face the same 86% failure rate.💡 Suggested fix
Consider softening the system template so the general case does not prescribe
missing_datafor absent files:Without this, the latent conflict remains for any future workflow that uses
cache-memorywith ephemeral data — they'd need to replicate this per-workflow override.@copilot please address this.