docs: clarify file rollout and close example startup cleanup

This commit is contained in:
Danny Avila 2026-11-18 08:47:40 -05:00
parent ccd3d570d5
commit 34994ffceb
2 changed files with 13 additions and 8 deletions

View file

@ -70,9 +70,9 @@ Its test attachment also records send-to-approval and approval-to-visible-output
This example validates the initial transport. It does **not** establish all main-chat features.
Read the [parity matrix and rollout gates](../../docs/sdk/agents.md#main-chat-parity-and-rollout-gates)
before enabling a product workflow. In particular, host model/PII protection blocks remote
execution, and model/tool builder settings, files/artifacts, steering, nested usage/billing, and
host tracing policies are not automatically inherited by the worker.
before enabling a product workflow. Protected execution requires the opt-in host model and policy
adapters. File transport is programmatic; native file/artifact activation, steering, nested
usage/billing, and host tracing policies are not automatically inherited by the worker.
## Recovering a dropped host-worker connection

View file

@ -117,10 +117,6 @@ async function worker() {
async function main() {
const directory = await mkdtemp(join(tmpdir(), 'librechat-sdk-files-'));
const secret = randomUUID() + randomUUID();
const child = fork(__filename, ['--worker'], {
env: { ...process.env, SDK_FILE_EXAMPLE_SECRET: secret },
stdio: ['ignore', 'inherit', 'inherit', 'ipc'],
});
const records = new Map();
const publications = new Map();
const bytes = Buffer.from('bounded host file transport\n'.repeat(4096));
@ -132,7 +128,12 @@ async function main() {
bytes: bytes.length,
};
const sourcePath = join(directory, 'input');
await writeFile(sourcePath, bytes);
try {
await writeFile(sourcePath, bytes);
} catch (error) {
await rm(directory, { recursive: true, force: true });
throw error;
}
records.set(source.reference, { file: source, path: sourcePath });
function resolve(reference, revision) {
const record = records.get(reference);
@ -211,6 +212,10 @@ async function main() {
return receipt;
},
};
const child = fork(__filename, ['--worker'], {
env: { ...process.env, SDK_FILE_EXAMPLE_SECRET: secret },
stdio: ['ignore', 'inherit', 'inherit', 'ipc'],
});
try {
const [{ port }] = await Promise.race([
once(child, 'message'),