Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ai-moderator.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .github/workflows/ai-moderator.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ safe-outputs:
hide-comment:
max: 5
allowed-reasons: [spam]
noop:
threat-detection: false
checkout: false
features:
Expand Down Expand Up @@ -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:

Copy link
Copy Markdown
Contributor

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 the missing_data tool". Any other workflow using cache-memory with 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_data for absent files:

- **Cache Miss**: If the cached data is **required** for the task to proceed, call the `missing_data` tool with `data_type: "cache_memory"` and `reason: "cache_memory_miss"`. If the file is optional or ephemeral, proceed without it.

Without this, the latent conflict remains for any future workflow that uses cache-memory with ephemeral data — they'd need to replicate this per-workflow override.

@copilot please address this.


```json
[
Expand Down Expand Up @@ -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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 {{#runtime-import shared/noop-reminder.md}} at line 226, which already reminds agents to call noop when no action is needed. This duplication is harmless but could diverge over time if one is updated independently.

💡 Suggestion

Consider removing the inline guideline at line 218 and relying solely on the shared noop-reminder.md import at line 226, keeping the canonical reminder in one place. If the shared reminder's wording is insufficient (too soft), strengthen it there rather than overriding inline — this ensures every workflow benefits from the improvement.

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

Expand Down
Loading