Repository navigation
Conversation
ToolBinding's handler, definitions and transfer returned a String, so ToolExecutor wrote the internal 'request <id> has no active tool binding' text into the tool result the model reads. They now return BindingError: UnknownTool keeps its model-facing text, NoActiveBinding is a runtime defect that is logged with its request id while the model reads only that the call did not run, and Loop reports a failed transfer as its own fault instead of invalid input. A flow test pins that a binding reload during a request settles the call as a reload without internal text. Refs #2028
This was referenced Nov 23, 2026
Open
Collaborator
Author
|
Closing in favor of the #2028 target contract (#2100): its deletion list removes |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #2028 · Refs #2015
Summary
ToolBinding::handler/definitions/transferused to returnResult<_, String>. ToolExecutor'sadmit()wrapped the text as-is intoHostError::failed, so the internal textrequest <id> has no active tool bindingcould end up in the model context. This PR splits the error by kind:BindingError { NoActiveBinding, UnknownTool }, with the sameDisplaytext as before.UnknownToolkeepsUnknown tool: <name>, which the model can act on.NoActiveBindingis a runtime defect: it is logged with its id viatracing::error!, and the model sees onlyTool was not executed: its request has no tool binding, matching the existing "not executed" texts.transferduring Loop budget recovery is reported asAgentError::fault("Loop", …), the Loop's own inconsistency, instead ofInvalidInput.NestedToolHostsignature is unchanged; dim-codemode is untouched.handler/transferin tool-contributions §7 is updated to match.Correction to #2028: the leak cannot be reproduced through public flows. The new flow test
a_call_whose_binding_reloaded_settles_as_a_reload_without_internal_textrestarts ToolBinding while the model is still streaming. Both before and after this change, the model seesTool was not executed: capability reloading: Loop and ToolExecutor reload together with ToolBinding, so an undispatched call never reachesadmit().Unknown toolis also unreachable from the main flow, because ModelProvider already rejects undeclared tools at the stream boundary (output.rs:669); only Code Mode child calls take that path. So the value of this PR is separating defects from errors the model can correct, not fixing a bug users can observe. The test pins that behavior. It passes before and after the change; it is not a regression test.Not changed (proposed kinds are listed in the #2015 comment): the
Stringerrors ofbind/bind_current/prepare/open.Design rule checklist
beforecallbacks: n/a.toolBindingstaysinternal(hot-path)(see 插件与服务治理:所有者提供操作,逐个扫描所有者 #2015).Documentation
Verification
cargo test -p dim-agent-capabilities -p dim-codemode --locked: 645 passed / 4 ignored, 70, 16, 9 passedcargo clippy -p dim-agent-capabilities -p dim-codemode --all-targets --locked -- -D warnings: passedcargo fmt --all -- --check,cargo run --locked -p xtask-check: passed