Skip to content

[codex] Order get_context recent docs by date#203

Merged
yibeichan merged 2 commits into
mainfrom
codex/issue-194-get-context-date-order
Jun 11, 2026
Merged

[codex] Order get_context recent docs by date#203
yibeichan merged 2 commits into
mainfrom
codex/issue-194-get-context-date-order

Conversation

@yibeichan

Copy link
Copy Markdown
Owner

Summary

  • order get_context recent docs by frontmatter date instead of ingest-time updated_at
  • add id ASC as a deterministic tie-breaker
  • add regression coverage where all docs share the same updated_at but have different dates

Root cause

The MCP get_context path sorted recent docs by docs.updated_at, but ingest does not populate updated_at from markdown. A rebuild inserts all rows in one transaction, so updated_at ties and the recent list becomes arbitrary.

Validation

  • npm test -- --testPathPatterns=get-context-tool.test.ts
  • npm test

Closes #194

@yibeichan yibeichan marked this pull request as ready for review June 11, 2026 19:37
@yibeichan yibeichan merged commit 32b2163 into main Jun 11, 2026
5 checks passed
@yibeichan yibeichan deleted the codex/issue-194-get-context-date-order branch June 11, 2026 23:24
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.

bug: getContext "recent docs" sorts by updated_at but ingest never sets it — order is arbitrary

1 participant