Skip to content

Improve llms relation loading#28332

Merged
ErisDS merged 1 commit into
mainfrom
optimize-llms-index-related-loading
Jun 3, 2026
Merged

Improve llms relation loading#28332
ErisDS merged 1 commit into
mainfrom
optimize-llms-index-related-loading

Conversation

@ErisDS
Copy link
Copy Markdown
Member

@ErisDS ErisDS commented Jun 2, 2026

Summary

  • Makes a short-term relation-loading change for /llms.txt and /llms-full.txt so we can verify whether it improves llms latency in the wild.
  • Removes tags/authors relation loading from the llms entry fetches.
  • Leaves the generated output unchanged.

Follow-up

  • If this proves to improve latency in the wild, we can follow up with broader refactors to consolidate the llms entry-fetching path.

Testing

  • pnpm install --frozen-lockfile
  • pnpm test:single test/unit/frontend/services/llms/service.test.js — 12 passing
  • pnpm test:single test/unit/server/services/url/lazy-url-service.test.js
  • pnpm test:single test/unit/server/services/url/lazy-find-resource.test.js
  • pnpm lint — completed with 2 existing warnings and no errors
  • git diff --check

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ee7edf2a-69c2-4d65-990a-90b021925d15

📥 Commits

Reviewing files that changed from the base of the PR and between 9de02b7 and fe50b60.

📒 Files selected for processing (2)
  • ghost/core/core/frontend/services/llms/service.js
  • ghost/core/test/unit/frontend/services/llms/service.test.js

Walkthrough

Removed explicit withRelated: ['tags', 'authors'] from models.Post.findPage calls in fetchIndexEntries and fetchFullEntries of the LLM frontend service while keeping the same columns selection. Added unit tests that call getLlmsTxt() and getLlmsFullTxt() and assert Post.findPage is invoked twice per function with withRelated left undefined.

Possibly related PRs

  • TryGhost/Ghost#27938: Related work around when tags/authors are loaded for Post queries used in URL generation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve llms relation loading' directly summarizes the main change—removing tags and authors relation loading from LLMS entry fetches to improve latency.
Description check ✅ Passed The description clearly relates to the changeset, explaining the purpose (verify latency improvements), the specific changes (removing tags/authors relation loading), and testing performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize-llms-index-related-loading

Comment @coderabbitai help to get the list of available commands and usage tips.

@ErisDS ErisDS force-pushed the optimize-llms-index-related-loading branch from 9e02753 to 636e9e6 Compare June 2, 2026 23:42
@ErisDS ErisDS changed the title Improve llms.txt index relation loading Improve llms relation loading Jun 2, 2026
@ErisDS ErisDS force-pushed the optimize-llms-index-related-loading branch from 636e9e6 to 9de02b7 Compare June 3, 2026 04:48
This short-term change removes tags and authors relation loading from llms entry queries so we can verify whether it improves latency in the wild. If that signal holds, follow-up refactors can consolidate the entry-fetching path more broadly.
@ErisDS ErisDS force-pushed the optimize-llms-index-related-loading branch from 9de02b7 to fe50b60 Compare June 3, 2026 05:17
@ErisDS ErisDS merged commit d4542a1 into main Jun 3, 2026
82 of 84 checks passed
@ErisDS ErisDS deleted the optimize-llms-index-related-loading branch June 3, 2026 06:43
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.

1 participant