-
Notifications
You must be signed in to change notification settings - Fork 122
馃獪 feat: Project Accepted Model Tool Calls #560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fd208ff
馃獪 feat: Stabilize API Tool Calls Across Run Steps
lia-librechat c26f6dc
fix: Preserve Tool Projection Across Snapshots and Attempts
lia-librechat 79288ad
refactor: Project Accepted Model Results Instead of Fragments
lia-librechat 557068f
fix: Preserve Projected Finish State and JSON Argument Semantics
lia-librechat 6e0000b
fix: Validate Accepted Calls Before Copy and Reserve Provider IDs
lia-librechat 9441e86
fix: Preserve Accepted Response Order and Bound Failure State
lia-librechat cf03119
docs: Condense Accepted Projection Usage and Decision
lia-librechat 4f35081
fix: Keep Executed Tools Off Client Wire and Validate Before Dispatch
lia-librechat 6994bf3
fix: Preserve Malformed Tool Diagnostics for Graph Repair
lia-librechat 1aee7ea
fix: Retire Graph-Owned Tools and Isolate Stream Validation
lia-librechat cb66b3f
fix: Delegate Only Trusted Client Tools After Graph Acceptance
lia-librechat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # ADR 0010: Project Accepted Model Results, Not Provider Fragments | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed in SDK PR #560. Not released or adopted by LibreChat. | ||
|
|
||
| ## Context | ||
|
|
||
| Run-step events mix partial data, snapshots and failed attempts. They cannot | ||
| reliably identify the accepted result across streaming, invoke-only and fallback | ||
| paths. More formatter heuristics cannot recover missing execution information. | ||
|
|
||
| ## Decision | ||
|
|
||
| The graph emits an awaited, registry-only `ON_MODEL_RESPONSE` after acceptance, | ||
| fallback/overflow recovery and usage accounting. Model outputs validate and | ||
| detach parsed calls and raw fragments before stream accounting or dispatch, | ||
| without imposing projection budgets on ordinary runs. Composed observers receive | ||
| isolated snapshots. Provider/tool custom callbacks cannot impersonate acceptance. Handler errors | ||
| propagate outside provider retry logic. | ||
|
|
||
| The opt-in OpenAI projector buffers only calls explicitly marked client-owned | ||
| by the trusted graph, and formats after host-confirmed natural completion. | ||
| Provider/SDK calls never reach the client, even if ToolNode is bypassed; ToolNode | ||
| claims are a secondary guard. Single-agent `clientDelegatedToolNames` routes | ||
| pure client batches to END, while mixed client/graph batches fail closed. | ||
| Partial string arguments are not executable, even with an eager seal. Stream | ||
| and invoke use SDK-owned snapshots so frozen provider messages remain intact. | ||
| Bounded pending call count, encoded bytes and depth prevent unbounded retention. See the | ||
| [README](../../README.md#accepted-tool-call-projection-opt-in) for registration, | ||
| limits and failure handling. | ||
|
|
||
| ## Trade-offs and verification | ||
|
|
||
| This removes fragment/attempt reconstruction but delays tool-call output. It does | ||
| not replace provider normalization, sandbox callbacks, roll back eager tools or | ||
| provide durable delivery. Existing default handlers remain unchanged; LibreChat | ||
| integration and release are separate gates. | ||
|
|
||
| Verify through real `Run.processStream` and the public finalizer: streaming/invoke, | ||
| fallback/overflow, final-answer ordering, observer isolation, cancellation, | ||
| malformed arguments, output limits, subagents, usage and tracing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.