Repository navigation
feat(dynamo-llm): classify incoming agent requests and emit input_trigger in request trace - #12787
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
ishandhanani
marked this pull request as ready for review
August 8, 2026 00:28
Contributor
WalkthroughChangesThe change adds optional Input trigger contract and classification
Protocol handler integration
Trace propagation and fixture validation
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
ishandhanani
force-pushed
the
idhanani/dyn-input-trigger-classification
branch
from
August 10, 2026 16:56
777be08 to
68ef6f4
Compare
ishandhanani
force-pushed
the
idhanani/dyn-input-trigger-classification
branch
from
August 10, 2026 19:06
cc8094c to
c351142
Compare
…gger in request trace Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
- Remove deny_unknown_fields from AgentContext to preserve N-2 frontend/worker compatibility when new input_trigger field is present. - Map Responses API output messages, function calls, and reasoning items to InputTrigger::Continuation to match chat completions behavior. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-input-trigger-classification
branch
from
August 10, 2026 19:06
c351142 to
2ce4635
Compare
PeaBrane
approved these changes
Aug 10, 2026
ishandhanani
force-pushed
the
idhanani/dyn-input-trigger-classification
branch
from
August 10, 2026 19:15
2ce4635 to
eee7def
Compare
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Contributor
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
commented
Aug 11, 2026
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
jthomson04
approved these changes
Aug 11, 2026
dagil-nvidia
approved these changes
Aug 11, 2026
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.
Classifies incoming agent requests as
user_message,tool_result, orotherand records the trigger in request-end traces. This makes multi-turn agent traces reconstructable while keeping the field optional during rollout and avoiding classification work for requests without agent identity.How This Was Implemented
AgentContext.input_triggerwith provider-aware classifiers for OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and OpenAI Completions.AgentContext, then inserts the completed context once.AgentContextfields and omittinginput_triggerwhen absent.Walkthrough
Mental model
The frontend derives session identity from agent headers and the causal trigger from the provider-specific request shape. The preprocessor carries that metadata into the request trace; Python SGLang, vLLM, and TensorRT-LLM workers receive the request as a generic dictionary and ignore the added nested key.
flowchart LR A["Agent request"] --> B["HTTP frontend"] B --> C["Classify final causal input"] C --> D["AgentContext.input_trigger"] D --> E["PreprocessedRequest"] E --> F["Backend worker"] E --> G["request_end trace"]Request lifecycle
Requests without agent identity skip trigger classification. Requests with agent identity classify the final causal message or item, set the optional field before the first registry insertion, and emit it with the same session ID in the request-end trace.
Boundaries and limitations
The schema is intentionally limited to
user_message,tool_result, andother. OpenAI Responses non-function tool-output variants currently map toother; the classifier contains a follow-up TODO rather than expanding this PR.Validation
cargo test -p dynamo-llm --lib input_trigger --no-default-features— 5 passed.cargo test -p dynamo-llm --lib request_trace --no-default-features -- --skip tool_relay— 58 passed.cargo clippy -p dynamo-llm --lib --no-default-features -- -D warnings— passed.Benchmark Results
Context::getused before the hot-path fixContext::get_optionalreferenceThe final implementation skips the registry lookup and classifier entirely when agent identity is absent.
Summary by CodeRabbit
New Features
Bug Fixes
Tests