Skip to content

🌳 feat: Provision Conversation-Scoped Code Worktrees - #239

Merged
danny-avila merged 16 commits into
mainfrom
danny-avila/conversation-worktree-provisioning
Sep 20, 2026
Merged

danny-avila merged 16 commits into
mainfrom
danny-avila/conversation-worktree-provisioning

Conversation

@danny-avila

@danny-avila danny-avila commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and behavior

Multiple conversations using one attached repository currently share one scheduling boundary and checkout. This adds opt-in conversation checkouts: operations within a conversation remain serialized, while independent conversations use the worker's bounded execution slots without sharing writable Git metadata or files.

The worker and Code API negotiate git_worktree support. LibreChat supplies an opaque conversation identity; Code API binds it to the authenticated tenant and user before admission. That identity survives programmatic replay and continuation, signed bridge payloads, executor selection, quarantine, and reset. Requests without it retain their existing behavior.

Provisioning and recovery

  • Sources are operator-admitted Git repositories with pinned filesystem identities. Each conversation gets a deterministic branch in an independent clone, with its own Git objects and no source alternates or hardlinks.
  • Git/common/object-store identities are pinned separately from the working directory and bound into durable records. Descriptor-relative, no-follow reads create a private Git-data snapshot before any Git process runs. Source hooks/config includes/alternate pointers cannot redirect privileged Git reads. Snapshot copying shares the clone deadline; private staging is removed before setup.
  • Owner-controlled storage has a configurable checkout-count quota. A kernel lock serializes provisioning across processes and releases on process exit. Clone time has a separate bounded budget.
  • Cancellation reaches lock waits, Git children, and environment setup. The operation waits for child cleanup before releasing ownership; it cannot leave detached setup running after the caller returns.
  • A durable reservation is written before launching Git or setup, so a worker crash cannot cause recovery to delete a checkout still owned by a child process. Repository-bound GitHub credentials are installed before setup. Setup completes before the record transitions to ready. Failed provisioning retires its executor before deleting the directory; uncertain cleanup reserves the checkout across restart.
  • Recovery removes only recognizable unfinished managed checkouts. Completed checkouts with changed source provenance or invalid completion records are preserved, including uncommitted work. Unrelated directories are never swept.
  • Cached file/native executors revalidate root identity. Legacy quarantine keys remain compatible, while instance identities use a disjoint namespace.
  • Sidecar-only reservations consume capacity even when the checkout directory never appeared. Cached checkouts revalidate metadata containment, and native executors have no extra Git-object read grant. Embedded workers must provide an instance guard resolver before advertising instances.

The worker option and recovery procedure are documented in packages/code/README.md. This is the Code API/worker foundation for Agents #548 and LibreChat #16107. Operators must enable conversation checkout storage and bounded lease slots to use the capability.

Cold clone/setup work is also bounded by the triggering operation's execution deadline. The clone timeout is an upper bound, not an extension of that deadline. Environments with long setup commands should initialize via a command with a sufficient configured timeout before ordinary file operations.

Verification

  • Worker TypeScript build passes.
  • Latest security pass: 52 focused local tests across provisioning/routing (33), native pool (8), instance guards (2), sandbox policy (1), native bootstrap (1), and concurrent-worker service integration (7). Regression cases include source replacement after validation, sidecar-only restart, cached object redirection, metadata changes across restart/setup, staging cancellation, linked source worktrees, and SHA-256 Git repositories.
  • A local canary with real native executor processes passed: two conversation checkouts concurrently wrote different contents to the same relative filename, the source checkout remained unchanged, and aborting a running shell prevented its delayed write (checked beyond the command's sleep duration).
  • Focused Code API admission, replay-state, principal identity, and HTTP ingress tests pass. Same-instance serialization and independent-instance progress are covered.
  • Full suites and Node 20/22/24 compatibility run in CI.

The follow-up security review correctly found gaps missed by the prior self-review. Those worker findings are addressed in f255141135e7636c106d506f47cf67b0e4e0dc1f, with focused regressions and a repeated native canary. No additional automated review was requested. LibreChat #16107 is draft: Agents #548 must be merged/released and the actual release pinned before the integration can ship. This PR alone does not establish cross-stack PTC rollout readiness.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T00:12:52.367763Z e1804e5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f6031ba36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/workspace-instances.ts Outdated
Comment thread packages/code/src/native-sandbox.ts Outdated
Comment thread packages/code/src/worktrees.ts
Comment thread packages/code/src/workspace-instances.ts Outdated
Comment thread packages/code/src/worktrees.ts
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa5cdfdd91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/cli.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/workspace-instances.ts Outdated
Comment thread packages/code/src/workspace-instances.ts Outdated
Comment thread service/src/bridge/store.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 614a29a. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 80bb7b9. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80bb7b980f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0f2423e14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/workspace-instances.ts
Comment thread packages/code/src/worktrees.ts
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head a0f2423. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head a7bd224. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7bd224904

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/worktrees.ts
Comment thread service/src/service/programmatic-router.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/protocol.ts Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 4ccdc02. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ccdc020fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/cli.ts
Comment thread packages/code/src/worktrees.ts Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head fbdb794. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbdb79443d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
@danny-avila

danny-avila commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Update: the later security review correctly found gaps in this audit. Four worker findings are fixed in f255141135e7636c106d506f47cf67b0e4e0dc1f: race-safe Git-data staging with pinned metadata identity, removal of redundant object read grants and cached metadata validation, sidecar-only quota accounting, and required per-instance guards. Added transition regressions and reran the real native concurrency/cancellation canary successfully. LibreChat #16107 has been restored to draft pending the Agents release and lockfile pin. No new bot review requested. The prior audit below describes the earlier head, not proof of readiness for the full stack.

Previous ownership/recovery audit: e1804e543f10e1df49cd4b831047d4e204dbd234.

The recurring review findings pointed to one ownership invariant: identity, cancellation, durable state, and executor cleanup must agree on when a checkout becomes usable and when it can be discarded. I traced both ingress paths, replay state and signed payloads, admission/fencing, worker execution, provisioning, setup credentials, and restart recovery.

Additional fixes from this audit:

  • Completed checkouts with changed source provenance or invalid records are preserved; recovery no longer silently deletes their uncommitted work.
  • Lock waits, Git children, and setup retain the caller's cancellation signal. Cancellation waits for actual cleanup rather than leaving detached provisioning behind after settlement.
  • Failed setup retires its executor before directory removal. Unconfirmed cleanup reserves the checkout across restart and consumes quota until operator recovery.
  • A durable reservation is written before launching any Git or setup writer. Killing the worker during provisioning cannot make recovery sweep a directory that may still have a live child process.
  • Cleanup only sweeps recognizable managed paths. Cached instances revalidate their admitted source. Principal identities use an unambiguous tuple encoding.

Local verification: 32 focused lifecycle tests, 2 CLI/process checks, focused service identity/admission/replay tests, and a passing TypeScript build. A real native-worker canary on macOS also passed concurrent same-filename writes in two isolated checkouts, unchanged source files, and cancellation with no delayed mutation, rerun on the final build. Real child-process tests prove lock release after a crash and preservation of a checkout reserved by a killed provisioning process.

The graph matches the pre-audit PR SHA but has no compiler-level call edges for this repo/ref. Available references were reconciled with source searches; the authoritative selector returned HTTP 401, so local test selection was source-based. Full suites run in CI.

All existing Codex threads are addressed. No new bot review requested for this final self-review pass.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review the latest head

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1804e543f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worktrees.ts Outdated
Comment thread packages/code/src/worker.ts
@danny-avila
danny-avila merged commit 95ebbd3 into main Sep 20, 2026
10 checks passed
TomasPalsson pushed a commit to aproorg/code-interpreter that referenced this pull request Sep 25, 2026
* fix: fail denied input downloads once per batch (LibreChat-AI#177)

* fix: preserve retries for transient egress ledger conflicts (LibreChat-AI#179)

* fix: distinguish retryable ledger contention from scope denials

* fix: preserve error classification through marker discovery and relay

* test: exercise classified denials through gateway configuration

* fix: honor bounded gateway retry hints during object downloads

* perf: reuse authorized input versions and make egress accounting atomic (LibreChat-AI#180)

* perf: reuse authorized input versions and make egress accounting atomic

* perf: resolve authorized input manifests once per execution

* test: preserve fetch signature in revocation fixture

* fix: isolate shared-grant failures and prevent ledger replay

* 🧹 fix: Evict Stale File-Object Index Entries (LibreChat-AI#182)

* fix: evict stale file-object index entries

Forget cached locators after successful deletion and missing-object downloads so replacement keys resolve immediately. Reuse exact resolver matching in the delete route to avoid prefix collisions.

Fixes LibreChat-AI#181

* fix: keep file-object deletion storage-authoritative

* fix: retire superseded upload objects

* fix: canonicalize replacement object keys

* fix: collapse legacy object-key siblings

* fix: recover reads from stale locators

* fix: namespace canonical object identities

* perf: enable authorized input reuse by default (LibreChat-AI#183)

* fix: honor requested input destinations (LibreChat-AI#184)

* fix: disambiguate legacy dotted object identities (LibreChat-AI#186)

* fix: helm egress deployment getting stuck on install (LibreChat-AI#176)

* fix: helm egress deployment getting stuck on install

* only wait for redis if the ledger is required

* Update helm/codeapi/templates/egress-gateway-deployment.yaml

Co-authored-by: Danny Avila <danacordially@gmail.com>

---------

Co-authored-by: Danny Avila <danacordially@gmail.com>

* feat: Add Trusted VM Command Policy (LibreChat-AI#187)

* 🛰️ feat: Add trusted VM command policy

* docs: clarify trusted VM socket boundary

* fix: Retry Clean Cancelled BYOM Settlements Through Stop Grace (LibreChat-AI#188)

A clean atomic workspace mutation rejection was settled with retries cut off at the original execution deadline. When Stop arrived near that deadline, process-tree termination finished after it, so the first settlement attempt was aborted immediately while Code API was still draining the cancellation. The client received ASSIGNMENT_EXPIRED and the durable mutation guard stayed armed.

Route clean workspace mutation rejections through the known-clean rejection recovery path: a transient-retrying heartbeat and settlement retries through the rejection acknowledgement grace, floored at the bridge cancellation settlement grace. Worker shutdown still fails closed. Share the grace constant from the protocol module so the bridge and worker stay aligned.

Closes LibreChat-AI#173

* fix: Release Unassigned Workspace Slots When Dispatch Cleanup Fails (LibreChat-AI#189)

Closes LibreChat-AI#170

* fix: Exit Cleanly When Native Executor Shuts Down Concurrently (LibreChat-AI#191)

* fix: Exit Cleanly When Native Executor Shuts Down Concurrently

A native BYOM worker under systemd KillMode=control-group receives SIGTERM
at the same time as its forked SRT executor. The child ignores IPC once it
is shutting down, so the parent's close handshake is left pending until the
child exits, which rejects it with 'Native executor is unavailable'. That
rejection escaped the CLI finally block and turned an idle administrative
stop into exit status 1.

Treat the close handshake as best-effort: the executor is terminated in
finally regardless, and the active command has already drained, so a lost
or stalled reply carries no mutation risk. Also make the child report exit
status 0 when its own SRT teardown succeeded.

Closes LibreChat-AI#190

* fix: Surface Explicit Executor Cleanup Failures During Close

Only a lost, refused, or stalled close handshake is benign at shutdown.
A negative close reply from the executor is a real cleanup failure and
still rejects so pool shutdown can aggregate it.

* fix: authenticate GitHub App Git operations (LibreChat-AI#192)

* fix: isolate file deletion rate limits (LibreChat-AI#193)

* feat: broker GitHub CLI authentication (LibreChat-AI#194)

* feat: Run PTC in Selected BYOM Workspaces (LibreChat-AI#195)

* feat: run PTC in selected BYOM workspaces

* fix: harden native workspace PTC replay

* fix: preserve replay isolation and bridge limits

* test: tolerate hosts without filesystem cloning

* test: surface copy-on-write clone faults

* fix: harden native workspace PTC admission

* fix: close native replay effect and finalization boundaries

* feat: Report Truncated Output Artifacts (LibreChat-AI#199)

* feat: report truncated output artifacts

* fix: classify omitted artifacts precisely

* fix: preserve artifact scan invariants

* fix: bound depth truncation probes

* fix: bound capped directory enumeration

* fix: constrain truncation probes across the job

* fix: stop exhausted artifact probes

* fix: cancel selected-workspace PTC across processes (LibreChat-AI#196)

* fix: cancel replay jobs across API and worker processes

* fix: drain worker cancellation watches promptly

* fix: close programmatic cancellation races

* fix: preserve cancellation response ordering

* fix: close distributed cancellation races

* fix: harden cancellation under concurrent load

* fix: make cancellation ownership durable through completion

* fix: recover durable replay outcomes across lost replies

* fix: return atomic cancellation outcomes with aligned retention

* fix: commit native results inside the workspace mutation fence

* fix: claim programmatic execution before stalled-job redelivery

* fix: classify capped artifact probe candidates (LibreChat-AI#206)

* feat: Report Deleted Code Session Files (LibreChat-AI#200)

* fix: report deleted persisted files

* fix: reconcile deletions across code runtimes

* fix: preserve protected session inputs

* fix: classify reserved runtime paths

* fix: preserve trusted jq path for PTC (LibreChat-AI#207)

* fix: isolate native PTC readiness and watchdog phases (LibreChat-AI#208)

* feat: Declare Named Worker Project Environments (LibreChat-AI#209)

* feat: declare named worker project environments

* fix: preserve environment trust and negotiated action boundaries

* Harden environment loading and executor identity

* Protect environment root traversal and exact config bytes

* Reject self-controlled environment root aliases

* Check filesystem identities at environment trust boundaries

* Validate environment containment across Linux mount aliases

* Handle stacked mounts conservatively without blocking unrelated paths

* fix: Allow Trusted Own-Root Environment Symlinks (LibreChat-AI#212)

* fix: Allow Trusted Own-Root Environment Symlinks

* fix: Check Alias Parent Ownership by Filesystem Identity

* fix: Enforce Parent Ownership Across Every Environment Path

* fix: Retain Quarantine After Failed Environment Setup (LibreChat-AI#213)

* fix: Retain Quarantine After Failed Environment Setup

* test: Run Native Environment Setup Lifecycle in CI

* fix: Document and Verify Local Setup Quarantine Recovery

* fix: Allow Lambda MicroVM metadata in hardened mode (LibreChat-AI#215)

* docs: add self-hosted worker setup runbook (LibreChat-AI#219)

* fix: bound memory buffering for streamed file uploads (LibreChat-AI#218)

* ci: Automate Auditable Main Releases (LibreChat-AI#216)

* fix: decouple repository release versions

* ci: automate releases after successful main builds

* fix: forward input-file limit into sandbox guests (LibreChat-AI#217)

* feat: Inspect Local Coding Projects (LibreChat-AI#221)

* feat: add bounded local project inventory

* fix: report incomplete Git metadata reads

* fix: preserve incomplete discovery and remote identities

* fix: finalize discovery budgets and nested remote identities

* fix(code): stop project traversal at filesystem budget boundaries

* fix: make automatic release tip check read-only (LibreChat-AI#225)

* feat: Discover Bounded Repository Instructions for Attached Workspaces (LibreChat-AI#226)

* Discover bounded repository instructions for opted-in workspaces

* Verify snapshot digests and cross-platform confinement

* feat: Register Selected Coding Projects (LibreChat-AI#222)

* feat(code): register explicitly selected project roots

* fix(code): reject shared Git metadata for selected projects

* fix(code): pin selected project identity through executor admission

* fix(code): preserve full filesystem identity precision

* Check selected project identity before replay staging

* Anchor replay copies to the verified working directory

* fix: Bind Selected Project Operations to Held Directory Descriptors

* test: Cover Selected Project PTC and Load Native Fixtures Before Platform Simulation

* fix: Keep Native Root Bindings Worker-Local and Verify Directory Ancestry

* fix: Anchor Project Admission and Preserve Search Permissions

* fix: Report workspace admission capacity without ambiguous timeout errors (LibreChat-AI#227)

* fix: Distinguish workspace admission capacity from execution expiry

* test: Preserve execution uncertainty while classifying blocked follow-ups

* fix: Classify admission expiry at the enqueue boundary

* ci: Fix Release Version Resolution for Untagged and Resumed Runs (LibreChat-AI#233)

* ci: Fix Release Version Resolution for Untagged and Resumed Runs

The release workflow resolved its version in one inline shell block under
`set -euo pipefail`, where two paths could not succeed.

Filtering tags through `grep` made a no-match fatal. On the ordinary untagged
tip of `main`, `git tag --points-at HEAD | grep -E '^v[0-9]+...'` exits 1, and
the step died before reaching its skip handling or `next-release-version.sh`, so
a deployable commit could not obtain a release version (LibreChat-AI#228). Selecting stable
tags now reads exit 1 as an empty answer while exit 2 and above still fail the
release, which also lets the missing-previous-tag case report its own error.

The rerun-resume path then rejected the tag it had itself chosen. With a stable
tag already pointing at `HEAD` and no release published, the version comes from
that tag, and the following existence check failed merely because the ref
existed (LibreChat-AI#229). It now compares the tag's commit against the release commit, so
only a tag on some other commit is a collision; `Create tag` already tolerates
a tag that exists.

The block moved into `.github/scripts/resolve-release-version.sh`, beside the
`next-release-version.sh` it calls, so `tests/release-version-resolution.sh` can
cover every path: automatic, resumed, skipped, dispatched, pushed-tag, and the
runs that must be refused, each against a throwaway repository with a stubbed
`gh`.

* fix: harden release resolver execution

---------

Co-authored-by: Lia <lia@librechat.ai>
Co-authored-by: Danny Avila <danny@librechat.ai>

* feat: Route GitHub App credentials per repository (LibreChat-AI#236)

* feat: Route GitHub App credentials per repository

* test: Make repository routing assertion deterministic

* fix: Harden repository credential routing

* fix: Bound shared GitHub credential refreshes

* fix: Bind GitHub credentials to admitted workspaces

* fix: Authenticate GitHub App bot identity lookup (LibreChat-AI#237)

* feat: Advertise Workspace Command Timeout Ceiling (LibreChat-AI#238)

* 🌳 feat: Provision Conversation-Scoped Code Worktrees (LibreChat-AI#239)

* feat: provision conversation-scoped code worktrees

* fix: isolate conversation checkout metadata

* docs: clarify isolated conversation checkouts

* fix: revalidate conversation checkout sources

* fix: preserve synchronous legacy execution startup

* fix: harden conversation worktree lifecycle

* test: use canonical workspace isolation keys

* fix: secure conversation worktree provisioning

* fix: preserve isolated workspace lifecycle

* fix: harden conversation worktree provisioning

* fix: fence worktree setup and credential routing

* fix: use kernel-backed provisioning locks

* fix: load worktree locking only when provisioned

* fix: retain conversation provisioning ownership through recovery

* fix: reserve provisioning before launching checkout writers

* fix: pin Git provisioning inputs and close instance admission gaps

* fix: Close native scratch directory streams (LibreChat-AI#240)

* feat(code): route trusted VM GitHub App tokens by checkout (LibreChat-AI#248)

* feat(code): route trusted VM GitHub App tokens by checkout

* fix(code): resolve checkout credentials within canonical root

* fix(code): reject cross-root credential aliases

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
Co-authored-by: Ignaz "Ian" Kraft <ignaz.k@live.de>
Co-authored-by: Danny Avila <danacordially@gmail.com>
Co-authored-by: Jackson Riding <99007683+jacksonriding@users.noreply.github.com>
Co-authored-by: lia-by-librechat[bot] <328778573+lia-by-librechat[bot]@users.noreply.github.com>
Co-authored-by: Lia <lia@librechat.ai>
Co-authored-by: busla <3162968+busla@users.noreply.github.com>
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