LibreChat/api/server/services/Endpoints/agents/eventChildLease.js
Danny Avila 1de88e7e91
📨 feat: Continue Bound Child Agents from Events (#15112)
* feat: add authenticated agent event ingress

* style: sort agent ingress imports

* fix: harden agent event ingress

* fix: bind event provenance to API keys

* fix: inspect event input with legacy PII filters

* fix: scope event status reads to source keys

* fix: bind event status reads to remote sources

* feat: add bound event-driven child turns

* fix: harden event-bound child continuations

* fix: satisfy event binding type contracts

* fix: close event actor lifecycle races

* fix: harden event actor dispatch continuity

* fix: fence event actor resume lifecycle

* fix: bind event actor state to lifecycle

* fix: preserve cascade write outcomes

* test: type cascade failure injection

* style: sort cascade test imports

* fix: harden event child lifecycle boundaries

* fix: make event cleanup retryable

* fix: annotate event retention clock

* fix: reconcile partial cascade metadata

* fix: recheck event binding expiry on resume

* fix: fence event actors by retention deadline

* fix: close event actor lifecycle races

* fix: harden event child lease acquisition

* fix: lazy-load event child lease adapter
2026-08-23 01:15:57 -04:00

24 lines
672 B
JavaScript

const librechatApi = require('@librechat/api');
const { GenerationJobManager } = librechatApi;
const {
acquireSubagentThreadLease,
renewSubagentThreadLease,
releaseSubagentThreadLease,
} = require('~/models');
let acquireLease;
function acquireEventChildGenerationLease(input) {
acquireLease ??= librechatApi.createEventChildGenerationLeaseAcquirer({
methods: {
acquireSubagentThreadLease,
renewSubagentThreadLease,
releaseSubagentThreadLease,
},
abortGeneration: (streamId, options) => GenerationJobManager.abortJob(streamId, options),
});
return acquireLease(input);
}
module.exports = { acquireEventChildGenerationLease };