diff --git a/examples/sdk-runtime/README.md b/examples/sdk-runtime/README.md index 29bb0af1aa..936ef89271 100644 --- a/examples/sdk-runtime/README.md +++ b/examples/sdk-runtime/README.md @@ -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 diff --git a/examples/sdk-runtime/files.cjs b/examples/sdk-runtime/files.cjs index 6b210ef6f9..3e6f4e90a9 100644 --- a/examples/sdk-runtime/files.cjs +++ b/examples/sdk-runtime/files.cjs @@ -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'),