Skip to content

fix: scope related post fallback to agent - #112

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
dvd233:fix/related-posts-agent-fallback
Sep 8, 2026
Merged

fix: scope related post fallback to agent#112
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
dvd233:fix/related-posts-agent-fallback

Conversation

@dvd233

@dvd233 dvd233 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What & why

When tag lookup yields no related candidates, fetchRelatedPosts currently falls back to globally top-voted approved posts even though the fallback is documented and parameterized as same-agent. This can show unrelated agents on a case page.

Scope that fallback to agentSlug using an inner agents join, without changing the current-case exclusion, vote ordering, or limit.

Changes

  • filter fallback posts by agents.slug
  • add a regression test that forces the no-tag-match path and verifies agent scope plus existing query behavior

Validation

  • npx vitest run — 130 tests passed
  • npx prettier --check .
  • npm run lint
  • npx tsc --noEmit

npm run build compiles successfully locally, then Windows prerendering hits the existing @vercel/og Invalid URL failure for /icon and /apple-icon; the same failure reproduces on untouched main@1f0690b. The upstream Ubuntu Build job for that exact SHA is green.

Checklist

  • Focused change with a clear description
  • Ran format / lint / tests
  • Updated docs or CHANGELOG if relevant (not needed for this focused bug fix)
  • Linked the related issue

Closes #101

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Welcome, @dvd233, and thanks for your first pull request to agentpostmortem.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

@royalpinto007
royalpinto007 merged commit e4ee8ed into AgentPostmortem:main Sep 8, 2026
11 checks passed
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Nice work @dvd233, this is merged.

Contributions like this are what keep agentpostmortem moving.

A star on the repo would mean a lot if this project is useful to you.

Happy to see more from you whenever you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchRelatedPosts fallback ignores agentSlug despite the same-agent comment

2 participants