Skip to content

fix: handle cache-memory cold start in issue duplication detector#3215

Merged
lpcox merged 2 commits into
mainfrom
fix/issue-duplication-detector-cache-miss
May 15, 2026
Merged

fix: handle cache-memory cold start in issue duplication detector#3215
lpcox merged 2 commits into
mainfrom
fix/issue-duplication-detector-cache-miss

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 15, 2026

Problem

The Issue Duplication Detector workflow reports missing_data (cache_memory_miss) on its first run (or after cache expiry) because /tmp/gh-aw/cache-memory/issues.json doesn't exist yet. The agent treats the empty cache as an error and gives up instead of falling through to GitHub search.

Root cause from run 25920514188:

cat /tmp/gh-aw/cache-memory/issues.json 2>/dev/null || echo "CACHE_MISS"
→ CACHE_MISS
→ agent immediately reports missing_data and stops

The cache directory was restored (with only cache-hit-history.json), but the issues.json file has never been written because the agent always bails on the first cold start.

Fix

Updated the workflow prompt to:

  • Treat empty/missing cache as a normal cold start — not an error
  • Explicitly instruct the agent NOT to report missing_data on cache miss
  • Always search via GitHub API regardless of cache state (not just as fallback)
  • Use bash for file I/O (cat, cat >) instead of ambiguous MCP server references
  • Document cache merge behavior for populating the cache on subsequent runs

Changes

  • .github/workflows/issue-duplication-detector.md — prompt rewrite for steps 1-5

Fixes #3213

The workflow reported missing_data (cache_memory_miss) on first run
because issues.json doesn't exist yet. The agent gave up instead of
falling through to GitHub search to populate the cache.

Fix the prompt to:
- Treat empty/missing cache as a normal cold start (not an error)
- Explicitly instruct NOT to report missing_data on cache miss
- Always search via GitHub API regardless of cache state
- Use bash for file I/O instead of relying on MCP server abstractions
- Document cache merge behavior for subsequent runs

Fixes #3213

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox requested a review from Mossaka as a code owner May 15, 2026 13:37
Copilot AI review requested due to automatic review settings May 15, 2026 13:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Issue Duplication Detector agent prompt to handle cache-memory cold starts without reporting missing_data, and to rely on GitHub search to populate and validate duplicate candidates.

Changes:

  • Clarifies that missing or empty /tmp/gh-aw/cache-memory/issues.json is a normal cold start.
  • Reworks duplicate detection flow to compare cached data and always search GitHub.
  • Adds explicit bash-based read/write instructions and cache merge guidance.
Show a summary per file
File Description
.github/workflows/issue-duplication-detector.md Updates the agent workflow prompt for cache loading, cold-start handling, GitHub search, and cache writing behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread .github/workflows/issue-duplication-detector.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 Smoke Test: Copilot BYOK (Offline) Mode

Test Result
GitHub MCP connectivity ❌ (401 - unauthenticated in sandbox)
GitHub.com HTTP connectivity ✅ (pre-step passed)
File write/read (smoke-test-copilot-byok-25920970228.txt)
BYOK inference (agent → api-proxy → api.githubcopilot.com)

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com.

Overall: PARTIAL PASS (GitHub MCP unavailable due to sandbox auth limitations; all other tests passed)

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

GitHub API: Bad credentials (HTTP 401)
Playwright: GitHub homepage loaded, title contains "GitHub"
File verify: Smoke test file exists with expected content

Overall: FAIL (2 of 3 tests passed)

The gh CLI authentication issue prevented GitHub API verification.

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity ❌ 401 Bad credentials
GitHub.com HTTP connectivity ❌ Template vars not expanded
File write/read ❌ Template vars not expanded

Overall: FAIL — workflow template variables (${{ steps.smoke-data.outputs.* }}) were not resolved before agent execution, and GitHub MCP auth is unavailable.

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test: FAIL
PRs: refactor: [Export Audit] Remove test-only re-exports from barrel modules | feat: auto-forward OTEL_* env vars with one-shot token protection for headers
✅ GitHub PR review; ❌ safeinputs-gh; ✅ Playwright; ❌ Tavily
✅ file write/cat; ❌ discussion query/comment; ✅ npm ci && npm run build
Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx All passed ✅ PASS
Node.js execa All passed ✅ PASS
Node.js p-limit All passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #3215 · ● 3.5M ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test results: 2 pass, 2 fail. Overall: FAIL.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — FAIL

Check Result
Redis PING host.docker.internal:6379 — connection timeout
PostgreSQL pg_isready host.docker.internal:5432 — connection timeout
PostgreSQL SELECT 1 host.docker.internal:5432 — connection timeout

Overall: FAIL — Service containers unreachable from this environment. host.docker.internal does not resolve/connect (confirmed with localhost fallback also failing). The sandbox may not have network access to the host-side service containers.

🔌 Service connectivity validated by Smoke Services

@lpcox
Copy link
Copy Markdown
Collaborator Author

lpcox commented May 15, 2026

@copilot address review feedback

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

@copilot address review feedback

Addressed in edfb23f. The prompt now keeps cold-start handling but explicitly continues to step 2 to fetch the new issue details, then skips only cache comparison (step 3) before GitHub search (step 4).

Copilot finished work on behalf of lpcox May 15, 2026 14:33
@lpcox lpcox merged commit d544d94 into main May 15, 2026
56 of 57 checks passed
@lpcox lpcox deleted the fix/issue-duplication-detector-cache-miss branch May 15, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Issue Duplication Detector failed

3 participants