🛞 feat: Manage Personal Code Environment Lifecycles (#15369)

* feat: add self-service code worker pairing

* fix: enforce code worker principal boundaries

* fix: separate pairing control planes from execution

* fix: preserve principal worker routing

* fix: pin artifact traffic to code workers

* fix: authenticate code worker selection

* test: mock worker-aware artifact headers

* fix: harden self-service code worker routing

* fix: fail closed for principal code pairing

* feat: manage personal code environments

* fix: harden personal code environment lifecycle

* fix: satisfy backend lifecycle types

* fix: harden principal environment lifecycle and quotas

* fix: fence environment lifecycle races

* fix: reconcile code environment stack

* style: format code execution headers

* fix: reconcile code environment lifecycle

* fix: close self-service pairing gaps

* fix: close code environment reconciliation gaps

* fix: close code environment UI review findings

* fix: satisfy code environment type checks

* fix: route code priming to selected worker

* fix: harden code environment lifecycle fences

* fix: type lease renewal interval

* fix: harden environment lifecycle recovery

* fix: close lifecycle recovery races

* fix: type compensated agent timestamps

* fix: fence lifecycle cleanup by tenant and revision

* fix: scope environment revision fencing
This commit is contained in:
Danny Avila 2026-09-01 21:10:05 -04:00 • committed by GitHub
parent 38183fdc13
commit 164f146bdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 3678 additions and 97 deletions

View file

@ -1,18 +1,25 @@
const express = require('express');
const { createCodeEnvironmentHttpHandlers } = require('@librechat/api');
const mongoose = require('mongoose');
const {
createCodeEnvironmentHttpHandlers,
startCodeEnvironmentLifecycleReconciler,
} = require('@librechat/api');
const { SystemCapabilities } = require('@librechat/data-schemas');
const { requireCapability } = require('~/server/middleware/roles/capabilities');
const { codeEnvironmentPairingLimiter } = require('~/server/middleware/limiters/code');
const { getAppConfig, getCodeEnvironmentRegistry } = require('~/server/services/Config');
const { requireJwtAuth } = require('~/server/middleware');
const db = require('~/models');
const router = express.Router();
startCodeEnvironmentLifecycleReconciler({ mongoose });
let handlers;
function getHandlers() {
if (handlers == null) {
handlers = createCodeEnvironmentHttpHandlers({
getAppConfig,
registry: getCodeEnvironmentRegistry(),
principalIsActive: db.isAgentTriggerPrincipalActive,
});
}
return handlers;
@ -27,5 +34,6 @@ router.post('/pairings', codeEnvironmentPairingLimiter, (req, res, next) =>
router.post('/', requireCodeEnvironmentManage, (req, res, next) =>
getHandlers().register(req, res, next),
);
router.delete('/:environmentId', (req, res, next) => getHandlers().remove(req, res, next));
module.exports = router;