Skip to content

Codex: prefer environment-matching docset over public docs/ - #3772

Open
reakaleek wants to merge 2 commits into
mainfrom
cursor/13d2bdca
Open

Codex: prefer environment-matching docset over public docs/#3772
reakaleek wants to merge 2 commits into
mainfrom
cursor/13d2bdca

Conversation

@reakaleek

Copy link
Copy Markdown
Member

What

  • Codex discovery now prefers the docset.yml whose registry matches the codex environment, instead of always resolving docs/docset.yml first.
  • The build step reuses the docset that discovery already selected, instead of rediscovering one from the repository root.

Why

Notes

  • Matching is based on registry vs. the codex environment string (not a hardcoded internal check), per the discussion on the issue, so it also works for other codex environments.
  • Falls back to the historical search order (known paths, then a recursive walk) when no docset declares a matching registry, so single-docset repos are unaffected.
  • The recursive fallback now runs more often (whenever a known-path docset exists but doesn't match), so the excluded-directory list was widened beyond .git/node_modules to keep it cheap on large repos.

Made with Cursor

Codex discovery always resolved docs/docset.yml first, so a repository
that publishes both public docs and an internal Codex docset could
not be onboarded: live publish always picked the public docset.

Discovery now prefers the docset whose registry matches the Codex
environment, falling back to the historical search order when none
match. The build step reuses that discovered docset instead of
rediscovering one from the repository root, so it can no longer land
on a different docset than clone did.

Fixes #3767

Co-authored-by: Cursor <cursoragent@cursor.com>

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, should we also hard error or warn if codex picks up a docset with no registry defined?

…gistry

Addresses review feedback on #3772: silently falling back to the
historical search order gave no signal that a repository has not
opted in to a codex environment via registry. Warn (not hard-error,
to avoid breaking currently-onboarded repos) so misconfiguration is
visible without failing existing builds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reakaleek

Copy link
Copy Markdown
Member Author

LGTM, should we also hard error or warn if codex picks up a docset with no registry defined?

4ac9655

@reakaleek

Copy link
Copy Markdown
Member Author

@copilot in this PR it's only warning.. But we should create a follow-up to error in the future. create an issue for it in elastic/docs-builder.

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@reakaleek I've opened a new pull request, #3778, to work on those changes. Once the pull request is ready, I'll request review from you.

@clintandrewhall

Copy link
Copy Markdown
Contributor

Epic! Thanks for moving so fast on this, @reakaleek !!

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.

Codex docset discovery should prefer a registry: internal docset over a repo's public docs/

4 participants