Repository navigation
feat: Advertise Repository Instructions by Default - #416
Conversation
Workers now discover AGENTS.md (or CLAUDE.md) at each registered root without an opt-in flag, matching how Codex and Claude Code load repository instructions. Machine owners opt out with --no-repository-instructions or LIBRECHAT_CODE_REPOSITORY_INSTRUCTIONS=false; the former opt-in flag is accepted and has no effect.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review e6ba716 — second pass: focus on mixed-version behavior (older Code API / LibreChat receiving the now-default instruction metadata), the three executor paths (root tools, conversation worktrees, linked-worktree lanes), and the startup contract for LIBRECHAT_CODE_REPOSITORY_INSTRUCTIONS. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Repository instruction discovery (#226) is opt-in: a worker advertises
AGENTS.md/CLAUDE.mdonly when itslibrechat-code runcommand carries--repository-instructions. Workers started without that flag advertise nothing, so LibreChat, which has injected advertised instructions into an attached agent's context sincev0.8.8, has nothing to load. Agents then fall back to shell-readingAGENTS.mdthemselves, and in practice they print only the first 40 or so lines and miss rules further down.Codex and Claude Code load these files without being asked. After this change the worker does too:
--no-repository-instructionsorLIBRECHAT_CODE_REPOSITORY_INSTRUCTIONS=false. Any other value of the variable stops the worker at startup, the same contract asLIBRECHAT_CODE_DETACHED_COMMANDS.--repository-instructionsis still accepted and changes nothing, so existing unit files keep working.Discovery, the 32 KiB cap, AGENTS.md-over-CLAUDE.md precedence, symlink refusal and the
instructionSha256-checked read are unchanged.The one value is passed to root tools, conversation worktrees and linked-worktree lanes; before, each read the flag separately.
Rollout and version skew
instructionsdescriptor sincev0.8.8, and Code API since feat: Discover Bounded Repository Instructions for Attached Workspaces #226. Older LibreChat validates workspace descriptors strictly, so a worker serving one should run with--no-repository-instructions.REPOSITORY-INSTRUCTIONS.mdstates this.instructions: []; LibreChat accepts the empty list.Change type
Testing
npm run buildandnpm testinpackages/code: the newrepositoryInstructionsEnabledcases and the updated CLI registration expectation (instructions: []on a root without the file) pass. Nine tests fail locally only because this WSL host lacks trusted Bash 5.2 andjqand has a world-writable/mnt/c; none touches the changed files.Checklist
packages/code/REPOSITORY-INSTRUCTIONS.md)