Skip to content

🚥 feat: Gate Synchronous Tool Results Before Release - #597

Closed
lia-by-librechat[bot] wants to merge 77 commits into
mainfrom
lia/pii-tool-results
Closed

lia-by-librechat[bot] wants to merge 77 commits into
mainfrom
lia/pii-tool-results

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds default-off RunConfig.toolResultProtection for trusted synchronous text tools. Required awaited inspection precedes native callbacks, completion publication, references, artifacts and ToolMessage/model reuse. Optional hooks cannot bypass it.

  • Covers direct/host/eager, nested local/Code API and foreground-child results/errors.
  • Admits checkpoint/replay/Send/Command channels and detaches observer-held aliases.
  • Binds policy selection, message identities, enclosing authority and native routing.
  • Preserves IDs/status, approvals, principal/resource values, accounting and execute-once.

Arguments and opaque payload text are not rewritten. Unsupported selected file/media/artifact/background outputs, uncertified shells, executable carriers and protected delta reconstruction remain gated. Binary work is limited to 32,768 unique indexed elements per synchronous pass; oversized indexed artifacts fail closed as overflow. Large index-free ArrayBuffer/DataView artifacts remain supported within a 16 MiB aggregate native copy-capacity limit per synchronous pass.

Current head

0f352f16088d0b5809c26614dcb70159cd35dab0
Base/merge-base: 247f66f46e16cff6caebf267b2fe0cb5082142e6 (main, 4.2.12).

IR66/IR67/IR68 (P1) fixed: quarantine native runtime writers, admit structured host rejections and isolate terminal-hook/public message views. The terminal sweep includes StopFailure and foreground SubagentStop. Detached messages no longer share private release envelopes. The 49 new SDK tests cover blocking policies, structured errors, terminal mutations/continuations, late aliases and default-off controls. Earlier findings remain fixed.

Exact-head verification

Check Result
Core results/checkpoints 1,255 passed
Boundary/reference/eager/nested results 1,625 passed
Lifecycle/tracing/provider/approvals 894 passed
Child authority/hooks/handoffs/budgets 690 passed; 1 existing benchmark skipped
Compaction/history/replay 307 passed
Accounting/runtime/host/attachments/provider-role compatibility 419 passed
Separate root tsc --noEmit Passed
Strict scoped ESLint/imports Passed, 44 files
CJS/ESM/declarations; current/prior compiled controls Passed
Runtime cycles; light entries; runtime declarations Passed; 18 passed; 1 passed
CI 13 passed; 0 pending; 0 failed; 1 skipped workflow

Focused total: 5,190 passed; one existing benchmark skipped. All 49 new regressions pass; preceding implementation had 36 failures / 13 controls. The unchanged runtime spec remains excluded by repository root types/lint; inherited diagnostics remain. Full packed-runtime fresh consumer installation was not rerun.

Independent review of this exact head failed: “The child run could not be completed.” No verdict returned. Review is incomplete, not clean. No review task is running. The preceding review completed with three P1 findings and was not clean. No findings rejected.

Full local suite, packed-runtime fresh consumer install, live integrations/external saver certification, C2 app/SSE/replay/remote adapters and D1 exporters remain uncertified.

Release gate

No merge, activation or publication. C2 requires an approved C1 SDK release, exact pin, version-1 capability/policy checks and trusted adapter plus app/SSE/replay certification. Merge alone does not authorize release or activation.

AI-2213

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 68df78e

C1 mandatory synchronous tool-result gate. Direct/native callbacks, host success/error, eager completion, post-hook replacement, references, nested local/programmatic execution and child inheritance use canonical releases. Required failures are terminal; unsupported artifacts/files/media/background paths stay gated.

Focused baseline: 355 tests plus 3 added child/approval cases passed. Workspace types, CJS/ESM/declarations, touched lint/import order and dependency cycles passed. Tracing/approval/resume regressions and independent review are running against this head. No docs, activation or package publication. C2 requires an approved SDK release/pin and adapter/sink certification.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: c0e10d2

Fixed independent R1-R5 in 3f3c3a8: raw-free eager rejections/cardinality, nested pre-call errors and local denial text, terminal remote protection failures. Also covered remote bash dispatch, SDK safety interruptions, native callback/error-handler ownership and opaque/accessor message aliases. Integrated current main at 265d97f without rewriting history.

Current-head checks: 375 focused tests, 353 approval/tracing tests and 232 child/host-argument tests passed. Workspace types, CJS/ESM/declarations, touched lint/imports, dependency cycles and built C1 exports passed. Fresh independent review follows for this exact head. No docs, activation or package publication; C2 still requires an approved SDK release containing C1 plus exact pin/capability and adapter/sink certification.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-11-05T11:46:15.747638Z eddd2e1 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: c0e10d264c

ℹ️ 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 src/protection/toolResult.ts Resolved
Comment thread src/tools/ToolNode.ts Resolved
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 3d39e2f

Fixed R6-R8 in 3d39e2f after a producer/reuse/projection invariant sweep. Checkpoint-owner-validated replay re-inspects canonical content without repeating settled side effects. Full approved references remain separate from model previews. Text-only tuple-format exceptions retain native error status and callbacks.

378 focused SDK tests and 353 approval/tracing tests passed. Separate types, CJS/ESM/declarations, declared exports, touched lint/import checks and dependency cycles passed. No docs, activation or publication. Fresh independent review is running for this exact head; C2 still needs an approved SDK release/pin, capability checks and adapter/app sink certification.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 0333d5f

Fixed Codex CX1/CX2 and independent R9/R10 in 0333d5f. Host envelopes are validated before accessor reads, timestamping and host-result tracing. Cloudflare native outputs remain unsupported and gate before sandbox work. Direct approval responses are inspected in full before truncation. Local runners drain accepted bridge requests before checking required failures. Error-handler replacements are re-inspected before reuse.

432 focused/backend tests and 353 approval/tracing tests passed. Separate types, CJS/ESM/declarations, declared exports, touched lint/import checks and dependency cycles passed. Fresh independent review follows for this exact head. No docs, activation or package publication. C2 requires an approved SDK release containing C1, exact pin, capability/policy checks and adapter/app sink certification.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 61dad14

Fixed independent R11-R13. Uncertified executable/request aliases reject before execution; standalone native boundaries validate supplied policy versions; accepted local bridge handlers drain even after client disconnect.

75 C1 dispatch regressions and separate types passed. Broader focused/backend, approval/tracing, child/authority and static/build checks are running against this head alongside CI and fresh independent review. No docs, activation or publication. C2 still requires an approved SDK release containing C1, an exact pin, version-1 capability/policy checks and trusted adapter/app sink certification.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: d1ec9ff

Fixed independent R14/R15. Checkpoint references now retain SDK source/version/protection provenance. Selected earlier-turn values are re-inspected before restoration or substitution; legacy or newly selected uncertified reference snapshots fail closed. Unselected host outcome/outcome_patch controls survive routing validation; selected aliases stay gated.

145 result/reference regressions passed, including direct/host source replay, allowed controls, reblocking, legacy/mixed-version gating and real eager outcome controls. Types, builds, touched lint/imports, cycles and built CJS/ESM dispatch passed. Broader exact-head checks, CI and fresh independent review follow. No docs, activation or publication. C2 still requires an approved SDK release containing C1, exact pin, capability/policy version checks and trusted adapters plus app sinks.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 99da8a3

Fixed independent R16/R17. Required host releases use frozen dispatched identities and reject changes before inspection, during inspection and after host cleanup. Required failures take precedence over approval interrupts. SDK-owned required host handler absence/throws fail raw-free before native callback logging. Native producer identity/format mutation is gated before callbacks.

100 C1 dispatch regressions and separate types passed. Focused/reference/backend, approval/tracing, child/authority and static/build checks follow for this exact head alongside CI and fresh independent review. No docs, activation or publication. C2 still requires an approved SDK release containing C1, exact pin, capability/policy checks and trusted adapter/app sink certification.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: ae4213e

Fixed independent R18/R19. Required child-host exceptions are rejected raw-free before native callback logging. Restored registry values are inspected under the current policy before reference resolution; serialized protection flags cannot recreate live policy bindings. Unchanged live values keep their policy-bound admission, avoiding redundant inspection. Batch turns remain reserved before awaits.

163 result/reference regressions, separate types and touched lint/import checks passed. Exact-head broader checks, builds, CI and fresh independent review follow. No docs, activation or publication. C2 requires an approved SDK release containing C1, exact pin, capability/policy checks and trusted adapters plus app sinks.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 386dd9b

Fixed independent R20. Validated producer messages are snapshotted before awaited inspection. Changes to identity, status, content, artifacts or metadata reject before native callbacks. Canonical provenance includes the immutable envelope, and metadata is copied rather than shared with the producer.

179 result/reference regressions, types and touched lint/import checks passed. Broader exact-head checks, module builds, CI and fresh independent review follow. No docs, activation or publication. C2 requires an approved SDK release containing C1, exact pin, capability/policy checks and trusted adapters plus app sinks.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 0781d19

Fixed independent R21. Configured local bridge cancellation becomes a raw-free terminal error before text or JSON responses. The failure latch survives ignored HTTP failures and bridge drain; SDK safety reasons retain identity.

189 result/reference regressions, types and touched lint/import checks passed. Real localhost HTTP tests cover ordinary/string canaries, typed policy errors and SDK safety controls in both response modes. Broader exact-head checks, builds, CI and fresh independent review follow. No docs, activation or publication. C2 requires an approved SDK release containing C1, exact pin, capability/policy checks and trusted adapters plus app sinks.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final 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: 0781d1938c

ℹ️ 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 src/protection/toolResult.ts Resolved
Comment thread src/protection/toolResult.ts Resolved
@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 8112d9a

Fixed Codex CX3/CX4 in 8112d9a. Reference collections are copied from validated indexed data before selection or inspection; proxy/subclass/iterable collections, overridden methods, accessors and symbol aliases reject before use. Detached reference fields stay stable across awaits. Envelope validation examines every own key, including non-enumerable symbols, before native callbacks or metadata copying.

208 result/reference regressions, types and touched lint/import checks passed. Broader exact-head checks and fresh independent review are running alongside CI. No docs, activation or publication. C2 still requires an approved SDK release containing C1, exact pin, capability/policy checks and trusted adapter/app sink certification.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 91b3c46b3566205a9be37878c51628257ff24449
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

Fixed in 91b3c46b3:

  • IR51 (P1): summarization requests reject unknown own fields, getters and symbols before fresh/checkpoint/pending/resume/Send/window release.
  • IR52 (P1): result-bearing native interrupt and parent-command payloads pass structural admission before native error observers, then detach and revalidate after native/chain callbacks. Extra/inherited fields and uncertified native control kinds remain gated.

Installed-SDK tests cover valid SDK approvals/replay, ordinary unselected Error identity/cause, payload-free interrupt extension, callback mutations, aliases and real Run persistence. Pre-push focused tests/types/scoped lint and compiled CJS/ESM controls passed.

Exact-head verification: 4,172 tests passed, one existing benchmark skipped. Separate TypeScript, 21-file touched lint/imports, CJS/ESM/declarations, dependency cycles, 18 light-entrypoint checks and all new/prior compiled canaries passed. CI: 13 passed, 0 pending. Fresh independent review is running on this head. The completed review of a98555954 found IR51/IR52 and does not cover this head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: c47d3bbb62b1031265566ffaf91b42214f3bf729
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR53 (P1) is fixed in c47d3bbb6: unselected host envelopes receive bounded descendant admission before tracing, completion, references or serialization. Optional post-tool replacements and mutations pass the same structural gate. The required text policy still does not rewrite arbitrary unselected data.

Installed-SDK tests cover serialized/native/control descendants, normal/eager Run sinks, mixed batches, post-hooks, getters/proxies/overflow, retained host aliases, execute-once, valid data and default-off behavior. Pre-push tests, separate TypeScript, scoped lint and compiled CJS/ESM controls passed.

Exact-head verification: 4,203 tests passed, one existing benchmark skipped. Separate TypeScript, 22-file touched lint/imports, CJS/ESM/declarations, cycles, 18 light-entrypoint checks and all new/prior compiled canaries passed. CI: 13 passed, 0 pending. Fresh independent review is running on this head. The completed review of 91b3c46b3 found IR53 and does not cover this head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: efae4316ac56f6e913b27d5cf9de182212248dd1
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR54 (P1) is fixed in efae4316a: native formatting metadata is detached and validated, and the native tool-end handoff admits the complete generated envelope before observers. The returned value is detached and revalidated before compaction, completion and reference storage.

Installed-SDK regressions cover text/tuple/record/block output, native/serialized formatter metadata, callback-added content/metadata/serialization fields, retained aliases, getter/proxy shapes, native scalars, valid artifacts and real Run model isolation. Pre-fix: 34 failures, 21 controls passed. All 65 new tests, separate TypeScript, touched lint and compiled CJS/ESM envelope controls pass before publication.

Exact-head verification: 4,268 tests passed, one existing benchmark skipped. Separate TypeScript, 23-file touched lint/imports, CJS/ESM/declarations, cycles, 18 light-entrypoint checks and all new/prior compiled canaries passed. CI: 13 passed. Fresh independent review is running on this head. The completed review of c47d3bbb6 found IR54 and does not cover this head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 66332e021a937cfa0393efa9e8a63a88c3058caf
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR55 (P1) is fixed in 66332e021: property names no longer enable a serialization exemption. Ordinary kwargs/lc_kwargs records receive the same carrier checks as any other record. Actual native serialization roots validate their role/name/call identity before normalization and restore the role field after admission.

The 52 new installed-SDK cases cover host/native/control/history paths, field-name permutations, valid native roots, identity substitutions, nested fields, aliased records, real host/eager sinks, default-off and unchanged assistant arguments. Pre-fix: 27 failed, 21 controls passed. Pre-push tests, separate TypeScript, scoped lint and compiled CJS/ESM controls passed.

Exact-head verification: 4,320 tests passed, one existing benchmark skipped. Separate TypeScript, 24-file touched lint/imports, CJS/ESM/declarations, cycles, 18 light-entrypoint checks and all new/prior compiled canaries passed. CI: 13 passed. Fresh independent review is running on this head. The completed review of efae4316a found IR55 and does not cover this head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: aca30f116b6c6137fee082f239cb11c2cf2c83e1
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

Fixed in aca30f116:

  • IR56 (P1): custom state fields pass bounded carrier admission, not only data cloning, at fresh/resume/Send/checkpoint/snapshot/pending boundaries.
  • IR57 (P1): plain artifact objects and arrays always detach before release. Shared topology and ordinary values are preserved without retained producer/native-observer container aliases; native binary leaves keep their supported semantics.

Installed-SDK reproductions: 30 failures and 3 controls before repair. All 42 new tests cover custom carriers, ordinary authority data, late native/serialized insertions, real fresh/resume/saver observers, native/host/Command/history artifacts, shared references, malformed data and default-off controls. Pre-push focused tests (1,321), separate TypeScript, touched lint and compiled CJS/ESM controls passed.

Exact-head checks and CI are running. Fresh independent review is running on this head. The completed review of 66332e021 found IR56/IR57 and does not cover this head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: b2482340426d310a4598afe9b9b9c436114bcf42
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR56/IR57 (P1) are fixed in aca30f116:

  • Custom state uses bounded carrier admission at fresh/resume/Send/checkpoint/snapshot/pending entry points before cloning.
  • Plain object/array artifacts always detach, preserving shared topology and values without producer or observer container aliases. Supported binary leaves retain their semantics.

b24823404 corrects the legacy shared-DAG callback test to mutate observer-visible output, rather than a producer alias that is now detached. The first exact-head run exposed that obsolete assertion; the source implementation did not need another change. The superseded review of aca30f116 was cancelled and is incomplete, not clean.

All 42 new installed-SDK regressions and focused observer-alias controls pass. Exact-head verification: 4,362 tests passed, one existing benchmark skipped. Separate TypeScript, 25-file touched lint/imports, CJS/ESM/declarations, cycles, 18 light-entrypoint checks and all new/prior compiled canaries passed. CI: 13 passed. Fresh independent review is running on this exact head. No findings rejected.

No merge, activation or publication. C2 app/SSE/replay and D1 exporter certification remain separate.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 6f82d989cf4e5abaa0baaae1de248f42b47f14a2
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR58/IR59 (P1) fixed in this head. Reserved run-step/handoff state receives bounded carrier admission before native observers, including nested extras and checkpoint writes. All supported native artifact leaves detach from producer/native observer aliases with isolated backing storage. Bytes, native types, view offsets and shared backing topology are preserved. Copy capacity is bounded to 16 MiB per synchronous pass. Default-off behavior is unchanged.

Verified: 121 new SDK regressions; 2,509 affected tests; separate tsc --noEmit; touched strict ESLint/imports; CJS/ESM/declaration builds; cycles; 18 light-entry checks; current/prior compiled CJS/ESM canaries. A disposable inspector observed a detached native ArrayBuffer with preserved bytes. Lifecycle 882, authority 674, compaction 306 and accounting 112 also pass. Total: 4,483 passed; one existing benchmark skipped. CI: 12 passed, 1 pending, 0 failed.

Independent review is running on this exact head. The preceding head review found IR58/IR59 and was not clean. No findings rejected.

No merge, activation or publication. Full local suite, live provider/external saver certification, C2 app/SSE/replay adapters and D1 exporters remain outside this evidence.

@lia-by-librechat

lia-by-librechat Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 4496a7d5fda6196146a1f0ca8d1161faebb67fbd
Base/merge-base: 708c9118f478a84f28e8e253148a373b49fec191 (main).

IR60/IR61 (P1) fixed. Native checkpoint controls and task interrupts receive bounded carrier admission before native loading/public exposure. Ordinary native errors admit own fields and nested causes before callbacks, then readmit/detach native and chain-observer aliases. Diagnostic strings, native error types, explicit approval/run-step argument slots and default-off behavior are retained. Surrounding result-bearing fields remain gated.

Verified before push: 81 new SDK regressions; 1,306 affected compatibility tests; separate tsc --noEmit; touched strict lint. A disposable inspector confirmed detached error/detail/cause values with unchanged diagnostics. Exact head: 4,564 focused tests passed; one existing benchmark skipped. Builds, 27-file strict lint/imports, cycles, 18 light-entry checks and current compiled CJS/ESM boundaries pass. All 13 CI checks pass. Separate exact-head types and all prior compiled CJS/ESM safety controls also pass. The combined tests/type command timed out after tests completed; separate types passed.

Independent review of this exact head failed: “The child run could not be completed.” No verdict was returned. Review is incomplete, not clean, and no review task is running. The preceding head review found IR60/IR61 and was not clean. No findings rejected.

No merge, activation or publication. Full local SDK suite, live provider/external saver certification, C2 app/SSE/replay adapters and D1 exporters remain outside this evidence.

@lia-by-librechat

lia-by-librechat Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Head 9a6c84b79432a908fb738507a1827b39bdb76b6e is superseded by 46c9ed964c21c64ffe3eccea82a8202d1a641e94. Independent review was cancelled before a verdict after the remote policy-admission gap was confirmed. Review is incomplete, not clean. See the current head handoff.

@lia-by-librechat

lia-by-librechat Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 46c9ed964c21c64ffe3eccea82a8202d1a641e94
Base/merge-base: 247f66f46e16cff6caebf267b2fe0cb5082142e6 (main, 4.2.12).

Updated the existing branch from current main, retaining attachments, tracing and frozen reference/replay behavior alongside C1.

  • UP1 (P1), fixed in 9a6c84b79: selected unresolved-reference refusals fail closed before event completion.
  • UP2 (P1), fixed in 46c9ed964: remote execution rejects configured C1 policy before local Run construction or transport setup. A certified remote adapter is still required.

Eight new SDK regressions. Exact-head focused total: 4,910 passed; one existing benchmark skipped. Separate root types, strict41-file lint/imports, builds, current/prior compiled CJS/ESM boundaries, cycles,18 light entries and runtime declarations pass. Production dependency audit: zero vulnerabilities. CI: 13 passed,0 pending,0 failed; one redundant workflow skipped.

The repository excludes runtime specs from root types/lint. Supplemental comparison against main found zero new diagnostics; one type error and22 lint diagnostics inherited from main remain. Full packed-runtime consumer install was not rerun.

Independent review is running on this exact head. The 9a6c84b79 review was cancelled as superseded, incomplete and not clean. The earlier 4496a7d5f review failed without a verdict. No findings rejected.

No activation, publication or PR merge. Full local suite, live integrations/external saver certification, C2 app/SSE/replay/remote adapters and D1 exporters remain uncertified.

@lia-by-librechat

lia-by-librechat Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: fd5b230ba2d729390fbacf2887c5451a3f1550fb
Base/merge-base: 247f66f46e16cff6caebf267b2fe0cb5082142e6 (main, 4.2.12).

IR62/IR63 (P1) fixed. Unselected direct ToolMessages receive bounded full-carrier admission after post hooks and before completion/replay persistence. Native unselected bodies run with callback-free explicit and ambient configuration/managers; outer lifecycle callbacks remain intact. Authority, signal semantics, child APIs and default-off controls are retained.

Installed SDK regressions:19 failures on the old head, all40 tests pass after repair. Includes mutation/replacement/hostile hooks, late aliases, manager/config/ambient child callbacks, nested tools/streams/errors and real Run model reuse. A disposable inspector observed zero body/config/inheritable handlers with authority preserved and the SDK safety signal present. Separate pre-push types and strict touched lint passed. Exact head:4,950 focused tests passed; one existing benchmark skipped. Separate types, strict42-file lint/imports, builds, cycles,18 light entries, runtime declarations and all current/prior CJS/ESM controls pass. CI:12 passed,1 pending,0 failed; one redundant workflow skipped.

Independent review is running on this exact head. The preceding review completed with IR62/IR63 and was not clean. No findings rejected.

No activation, publication or PR merge. Full local suite, live integrations/external saver certification, C2 app/SSE/replay/remote adapters and D1 exporters remain uncertified.

@lia-by-librechat

lia-by-librechat Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 85e785e0cff76a59297b219563821eab3d181797
Base/merge-base: 247f66f46e16cff6caebf267b2fe0cb5082142e6 (main, 4.2.12).

IR64/IR65 (P1) fixed. Both native body paths detach nested runtime configuration and remove callbacks throughout the bounded config chain. Authority, signals and valid config topology remain intact. Legacy FunctionMessage/chunks and generic tool/function roles now fail closed when selected or uncertified, including supplied/checkpoint/resume/nested results. Other roles and named unselected/default-off controls retain their behavior.

Installed SDK: 79 failures / 24 controls on the old implementation; all 103 new regressions pass after repair. Separate pre-push types and strict touched lint pass. A disposable inspector observed zero top-level/nested callbacks with authority and nested signal preserved. Exact head: 5,141 focused tests passed; one existing benchmark skipped. Separate types, strict 43-file lint/imports, CJS/ESM/declarations, cycles, 18 light entries, runtime declarations and all current/prior compiled controls pass. CI: 13 passed,0 pending,0 failed; one redundant workflow skipped.

Independent review verdict is pending for this exact head. The preceding review completed with IR64/IR65 and was not clean. No findings rejected.

No activation, publication or PR merge. Full local suite, live integrations/external saver certification, C2 app/SSE/replay/remote adapters and D1 exporters remain uncertified.

@lia-by-librechat

lia-by-librechat Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 0f352f16088d0b5809c26614dcb70159cd35dab0
Base/merge-base: 247f66f46e16cff6caebf267b2fe0cb5082142e6 (main, 4.2.12).

IR66/IR67/IR68 (P1) fixed. Policy-bound native bodies quarantine runtime/nested/fallback writers. Bound host rejections admit structured descendants before observers and detach aliases. Stop/StopFinalize/StopFailure, foreground SubagentStop and public Run message views receive detached admitted messages; hook views are readmitted before later exposure. Detached views cannot mutate private release envelopes. Authority, signal semantics, ordinary unselected diagnostics, execute-once and default-off controls remain intact.

Installed SDK: 36 failures / 13 controls on the preceding implementation; all 49 new regressions pass. Pre-push core and boundary groups pass; separate types and strict touched lint pass. A disposable inspector observed detached hook and graph message/metadata identities. Exact head: 5,190 focused tests pass; one existing benchmark skipped. Separate types, strict 44-file lint/imports, builds, cycles, 18 light entries, runtime declarations and current/prior compiled CJS/ESM controls pass. CI: 13 passed, 0 pending, 0 failed; one redundant workflow skipped.

Independent review of this exact head failed: “The child run could not be completed.” No verdict returned. Review is incomplete, not clean. No review task is running. The preceding review completed with three P1 findings and was not clean. No findings rejected.

No activation, publication or PR merge. Full local suite, packed-runtime fresh consumer install, live integrations/external saver certification, C2 app/SSE/replay/remote adapters and D1 exporters remain uncertified.

@danny-avila

Copy link
Copy Markdown
Collaborator

Superseded by #719, which implements the same RunConfig.toolResultProtection option in about 430 source lines.

This branch treated code in the host process as hostile, a standard that cannot be met inside one JS process, so each review round found another reachable object and the diff grew to 12k lines. Checked at 0f352f16 with the policy on: a follow-up turn whose history the host rebuilt from storage failed as incompatible, unselected tools were rejected for artifacts holding class instances, Map/Set or large arrays, and history was revalidated on every model call.

The replacement starts from a written trust boundary: the tool's text is untrusted, host-process code is trusted. The branch is left in place for reference.

danny-avila added a commit that referenced this pull request Nov 23, 2026
* 🧹 style: Format Files Touched by Tool Result Protection

Commit-hook output only (sort-imports, prettier, eslint --fix) for three
existing files the next commit edits, kept separate so that commit shows
only the change.

* 🚥 feat: Inspect Selected Tool Results Before Use

Adds default-off RunConfig.toolResultProtection. For the tools a host policy
names, the text a tool returns is replaced by the host inspector's text before
hooks, the error handler, completion events, the output reference registry,
checkpoints or the model read it. A failed inspection ends the run with a coded
ToolResultProtectionError.

Covers in-process tools, host-executed tools, error text and subagents.
Selected tools are kept out of eager start, per-call early completion and
programmatic tool calling; client delegation and remote SDK runs reject the
policy. Unselected tools are untouched.

Host process code is trusted: text authored by hooks or handlers and history
the host supplies are not inspected.

Supersedes #597.

* 🧯 fix: Inspect Fail-Fast Tool Errors and Keep Protected Subagents Off Prestart

A ToolNode built with handleToolErrors false rethrew a protected tool's
failure before it was inspected. The failure is now inspected first, for both
the rethrow and the error-message path; interrupts and run safety aborts
still pass through untouched.

A protected subagent tool could still be started ahead of its batch by
prestartSubagent. It now stays on the committed path like every other
protected tool.
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.

2 participants