Repository navigation
🌿 feat: Accept Lane Git State and Pull Request Contract - #16792
Merged
Merged
Conversation
Code workers can report the branch and head commit of the lane a command ran in. LibreChat now accepts an optional laneGit key on execute_command results, bounded to a 256 character branch without control characters and a 40 or 64 character lowercase hex head, and rejects anything else. The data-provider gains the pull request types, endpoint, query key and service method, and an endpoints.agents.pullRequests config block that is off by default and takes the token only as an environment variable reference.
6 of 8 tasks
Codex Review SummaryThis 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. |
berry-13
added this pull request to stack #16796
October 5, 2026 21:57
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Code workers can report the git branch and head commit of the lane a command ran in, but LibreChat rejected any
execute_commandresult carrying an extra key, so the first worker to send it would have failed every command. This accepts an optionallaneGitof{ branch, head }on those results: a branch is null or 1 to 256 characters with no control characters, a head is null or 40 or 64 lowercase hex, and anything else invalidates the result as an unknown key already did. An absent key still means unknown, and null fields mean a detached lane or one with no commit yet.It also adds the shared pieces the pull request chip needs: the
TConversationPullRequesttypes, theGET /api/convos/:id/pull-requestendpoint helper with its query key and service method, and anendpoints.agents.pullRequestsconfig block. The block is off by default, the token is accepted only as an environment variable reference such as${GITHUB_PULL_REQUEST_TOKEN}, and enabling it without one fails validation.Nothing reads
laneGityet and nothing calls the endpoint, so behavior is unchanged. This is the first of three stacked pull requests; the next ones record the branch and serve the pull request, then show it in the chat header. It is safe to merge before the worker side: old workers never send the key. Related to LibreChat-AI/code-interpreter#311.Type of change
Testing
Tested environments/configuration:
Automated tests:
packages/api/src/code/workspace.spec.ts. The three accept cases failed before the validator change withWorkspace tool request invalidand pass now. The reject cases are guards on the bounds.packages/data-provider/src/pullRequest.spec.ts(endpoint encoding, query key, enum values) and a config spec for the new block (defaults, token reference only, required when enabled, cache bounds).lc teston the touched files:packages/data-providerpasses (971 tests); theworkspace.spec.tssuite passes.npx tsc --noEmitinpackages/data-providerandpackages/apiexits 0.npm run static-checks:full -- --against origin/devpasses ESLint, Prettier, import sorting, design-rule suppressions, circular dependencies, TypeScript and unused i18n keys. Its config migration tests fail withInstance closed unexpectedlyfrom the Mongo memory server in this sandbox; the same specs fail onorigin/dev.Screenshots / recordings
No user-facing change.
Risk / compatibility
None for existing deployments: the new key is optional, the config block is off by default, and the endpoint has no caller yet. The bounds are copied across three repositories (this one, the worker and the Code API), so a change to one needs the others.
Checklist