feat(codec): add missing optional AnnotatedLlmRequest/Response fields#76
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR extends the codec request/response schema with 13 new optional OpenAI/Anthropic-specific fields, adds multimodal image-URL content support, refactors text extraction to safely ignore non-text parts, and updates three API codec implementations to decode/encode these fields. Tests and language bindings are comprehensively updated. ChangesMultimodal + Modeled Fields Roundtrip
🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
1844af6 to
eeeaa13
Compare
eeeaa13 to
c9ea854
Compare
|
/ok to test c9ea854 |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/ffi/tests/unit/callable_tests.rs (1)
326-347:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winStrengthen this test to assert round-trip on new optional fields
AnnotatedLlmRequestnow includes many new optional fields, but this test still only verifiesmodelandextra. Set a few new fields to non-Noneand assert they survive the intercept path to catch FFI regression on the expanded public surface.Suggested test hardening
let annotated = nemo_flow::codec::request::AnnotatedLlmRequest { messages: vec![], model: Some("test-model".into()), params: None, tools: None, tool_choice: None, - store: None, - previous_response_id: None, + store: Some(true), + previous_response_id: Some("resp_prev_1".into()), truncation: None, reasoning: None, include: None, - user: None, + user: Some("user-123".into()), metadata: None, service_tier: None, parallel_tool_calls: None, max_output_tokens: None, max_tool_calls: None, top_logprobs: None, - stream: None, + stream: Some(true), extra: serde_json::Map::from_iter([("annotated".into(), json!(true))]), }; @@ assert_eq!(annotated_out.model.as_deref(), Some("test-model")); + assert_eq!(annotated_out.store, Some(true)); + assert_eq!(annotated_out.previous_response_id.as_deref(), Some("resp_prev_1")); + assert_eq!(annotated_out.user.as_deref(), Some("user-123")); + assert_eq!(annotated_out.stream, Some(true)); assert_eq!(annotated_out.extra.get("annotated"), Some(&json!(true)));As per coding guidelines, “Treat binding changes as public API changes. Check for parity with the other language bindings...” and “Tests should cover the behavior promised by the changed API surface...”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/ffi/tests/unit/callable_tests.rs` around lines 326 - 347, The test currently only asserts AnnotatedLlmRequest.model and extra survive request_intercept; update the test that builds the annotated variable (the AnnotatedLlmRequest instance used with request_intercept and make_request) to set several optional fields to non-None values (e.g., store, previous_response_id, user, metadata, service_tier, max_output_tokens or parallel_tool_calls) and then add assertions on annotated_out (the deserialized AnnotatedLlmRequest returned by request_intercept) to verify those fields round-trip unchanged; locate the annotated variable and the request_intercept("llm", make_request(), Some(annotated)) call and add matching assert_eq! checks for each newly populated optional field.crates/core/src/codec/openai_chat.rs (1)
260-289:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPrevent lossy decode when modeled keys have unexpected JSON types.
extracurrently drops all modeled keys unconditionally, even when typed extraction fails (as_bool/as_strreturnsNone). That loses original payload data on decode→encode round-trips (e.g., hybrid gateways emitting non-canonical types).💡 Proposed fix sketch
- let extra: serde_json::Map<String, Json> = obj - .iter() - .filter(|(k, _)| !MODELED_REQUEST_KEYS.contains(&k.as_str())) + let store = obj.get("store").and_then(|v| v.as_bool()); + let user = obj.get("user").and_then(|v| v.as_str()).map(String::from); + let service_tier = obj.get("service_tier").and_then(|v| v.as_str()).map(String::from); + let parallel_tool_calls = obj.get("parallel_tool_calls").and_then(|v| v.as_bool()); + let top_logprobs = obj.get("top_logprobs").and_then(|v| v.as_u64()); + let stream = obj.get("stream").and_then(|v| v.as_bool()); + + let extra: serde_json::Map<String, Json> = obj + .iter() + .filter(|(k, v)| match k.as_str() { + "store" => store.is_none() && !v.is_null(), + "user" => user.is_none() && !v.is_null(), + "service_tier" => service_tier.is_none() && !v.is_null(), + "parallel_tool_calls" => parallel_tool_calls.is_none() && !v.is_null(), + "top_logprobs" => top_logprobs.is_none() && !v.is_null(), + "stream" => stream.is_none() && !v.is_null(), + _ => !MODELED_REQUEST_KEYS.contains(&k.as_str()), + }) .map(|(k, v)| (k.clone(), v.clone())) .collect();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/core/src/codec/openai_chat.rs` around lines 260 - 289, The current extra map unconditionally omits all MODELED_REQUEST_KEYS causing loss when typed extractions fail; modify decoding to only treat a modeled key as consumed when its typed extraction succeeds: compute each field (e.g., store via obj.get("store").and_then(|v| v.as_bool()), user via obj.get("user").and_then(|v| v.as_str()), service_tier, parallel_tool_calls, top_logprobs, stream, etc.) and add that key to a consumed_keys set only if the extraction returns Some(...); then build extra by filtering out keys present in consumed_keys instead of MODELED_REQUEST_KEYS. Update the code paths around MODELED_REQUEST_KEYS, extra, and the AnnotatedLlmRequest field initializations to use consumed_keys when collecting extra so original unparsed values are preserved for round-trip encode/decode.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/adaptive/src/acg_profile.rs`:
- Around line 190-193: The current filter_map closure drops
ContentPart::ImageUrl, losing multimodal signal; change the closure in the
fingerprint extraction pipeline (the code handling ContentPart::Text /
ContentPart::ImageUrl) to return a stable non-PII marker for images instead of
None — e.g., map ImageUrl { url } to a deterministic hashed marker like
format!("image:{hex_sha256(url)}") (or similar digest) so image-only or
text+image combinations produce distinct fingerprints; ensure the mapped value
type matches the rest of the pipeline (use owned String if needed) and implement
hashing using a deterministic digest function referenced from the same module.
In `@crates/core/src/codec/openai_responses.rs`:
- Around line 304-315: The fallback match that decodes object-form tool choices
currently handles "auto", "any", and "tool" but ignores the Anthropic-style
"none", causing those payloads to decode to None instead of ToolChoice::None;
update the matcher in openai_responses.rs (the match that returns
Some(ToolChoice::Auto/Required/Specific(...))) to add a branch for Some("none")
=> Some(ToolChoice::None), ensuring ToolChoice::None is returned for explicit
no-tools intents (involving the ToolChoice, ToolChoiceFunction, and
ToolChoiceFunctionName types).
In `@crates/python/src/py_types/codecs.rs`:
- Around line 110-122: The Python wrapper PyAnnotatedLLMRequest currently embeds
an inner AnnotatedLlmRequest with new fields (store, previous_response_id,
truncation, reasoning, include, user, metadata, service_tier,
parallel_tool_calls, max_output_tokens, max_tool_calls, top_logprobs, stream)
but does not expose constructor args or property accessors for them; update
PyAnnotatedLLMRequest to accept these fields in its constructor and add
Python-visible getters and setters that read/write inner.<field> for each listed
symbol (or, if intentional, implement maintaining parity by exposing them via
the existing extra mapping), and add unit tests that construct
PyAnnotatedLLMRequest with these fields and assert round-trip read/write through
the properties. Ensure naming and semantics match other bindings and
async/stream conventions.
---
Outside diff comments:
In `@crates/core/src/codec/openai_chat.rs`:
- Around line 260-289: The current extra map unconditionally omits all
MODELED_REQUEST_KEYS causing loss when typed extractions fail; modify decoding
to only treat a modeled key as consumed when its typed extraction succeeds:
compute each field (e.g., store via obj.get("store").and_then(|v| v.as_bool()),
user via obj.get("user").and_then(|v| v.as_str()), service_tier,
parallel_tool_calls, top_logprobs, stream, etc.) and add that key to a
consumed_keys set only if the extraction returns Some(...); then build extra by
filtering out keys present in consumed_keys instead of MODELED_REQUEST_KEYS.
Update the code paths around MODELED_REQUEST_KEYS, extra, and the
AnnotatedLlmRequest field initializations to use consumed_keys when collecting
extra so original unparsed values are preserved for round-trip encode/decode.
In `@crates/ffi/tests/unit/callable_tests.rs`:
- Around line 326-347: The test currently only asserts AnnotatedLlmRequest.model
and extra survive request_intercept; update the test that builds the annotated
variable (the AnnotatedLlmRequest instance used with request_intercept and
make_request) to set several optional fields to non-None values (e.g., store,
previous_response_id, user, metadata, service_tier, max_output_tokens or
parallel_tool_calls) and then add assertions on annotated_out (the deserialized
AnnotatedLlmRequest returned by request_intercept) to verify those fields
round-trip unchanged; locate the annotated variable and the
request_intercept("llm", make_request(), Some(annotated)) call and add matching
assert_eq! checks for each newly populated optional field.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 682b053a-4e78-4202-b141-f2d24ebae396
📒 Files selected for processing (40)
crates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/openai_responses.rscrates/core/src/codec/request.rscrates/core/src/codec/response.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/core/tests/integration/codec_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/unit/shared_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/wasm/tests/coverage/callable_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (22)
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
crates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
**/*.rs: Runcargo fmt --allfor FFI work as it is Rust work
Runjust test-rustfor FFI validation
Runcargo clippy --workspace --all-targets -- -D warningsto enforce warnings-as-errors lintingWhen Rust files changed as part of Python work, run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting
Runcargo clippy --workspace --all-targets -- -D warningsto enforce Rust linting with no warnings
Runjust test-rustas the shared-runtime build/test wrapper for Rust changesUse Rust snake_case naming convention for Rust code
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting when Node changes touch Rust files
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting when Rust files changed as part of Node work
**/*.rs: Always runjust test-rustwhen any Rust code changes
Always runcargo fmt --allwhen any Rust code changes
Always runcargo clippy --workspace --all-targets -- -D warningswhen any Rust code changes
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
**/*.{rs,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
SONAR_IGNORE_START/SONAR_IGNORE_ENDmarkers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure typed helper constructors map cleanly to the same config document without divergence
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changed files must be formatted with the language-native formatter
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
{crates/core,crates/adaptive}/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
If the change touched shared runtime semantics in
crates/coreorcrates/adaptive, also usevalidate-change
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
crates/adaptive/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/adaptivechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rs
**/*.{py,js,ts,tsx,go,rs,md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Format changed files with the language-native formatter before the final lint/test pass
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
**/*.{rs,py,js,ts,tsx,go}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
During iteration, prefer
uv run pre-commit run --files <changed files...>for targeted validation
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
crates/{core,adaptive}/**/*.rs
⚙️ CodeRabbit configuration file
crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
**/{integrations,integration,*-integration}/**
📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)
**/{integrations,integration,*-integration}/**: Keep NeMo Flow optional in framework integrations
Preserve the framework's original behavior when NeMo Flow is absent
Wrap tool and LLM paths at the correct framework boundary
Integration pattern must followdocs/integrate-frameworks/adding-scopes.md
Files:
crates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/tests/integration/codec_tests.rs
crates/ffi/**
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
Rebuild the FFI crate in release mode so the shared library and header stay in sync
Files:
crates/ffi/tests/unit/types_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rs
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/wasm/tests/coverage/callable_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rs
crates/python/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
When the native Rust bridge changed, add the Rust crate tests for
nemo-flow-python
Files:
crates/python/src/py_types/codecs.rscrates/python/tests/coverage/py_types_coverage_tests.rs
crates/wasm/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
crates/wasm/**/*.rs: Runcargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
Addcargo test -p nemo-flow-wasmwhen Rust-only WebAssembly helpers changed
Files:
crates/wasm/tests/coverage/callable_tests.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/corechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/tests/unit/shared_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_responses.rs
🔇 Additional comments (18)
crates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.json (1)
1-15: Fixture shape looks correct for cache_control block extraction.Covers both
systemandmessages[*].content[*]text blocks withcache_controlvariants (ephemeral,ephemeral+global) and should be useful for provider/hybrid parsing parity tests.crates/core/tests/unit/shared_tests.rs (1)
40-52: LGTM: Mechanical fixture update matches expanded request structure.The addition of these 13 optional fields (all set to
None) correctly maintains the test fixture construction in line with the expandedAnnotatedLlmRequestschema.As per coding guidelines, changes to
crates/coremust run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly.crates/ffi/tests/unit/types_tests.rs (1)
524-536: LGTM: FFI test fixture updated consistently.The FFI test fixture correctly mirrors the core test updates with the same 13 optional fields in the same order.
As per coding guidelines, FFI changes should rebuild the FFI crate in release mode to keep the shared library and header in sync.
crates/adaptive/tests/unit/acg_component_tests.rs (1)
100-112: LGTM: Adaptive test helper updated consistently.The test helper correctly includes all 13 new optional fields in the same order as core and FFI test updates, maintaining consistency across the codebase.
As per coding guidelines, changes to
crates/adaptivemust run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly.crates/adaptive/tests/integration/redis_tests.rs (1)
123-135: Request fixture update is correct and consistentExplicitly setting the newly added optional request fields to
Nonekeeps this integration fixture aligned with the expanded IR shape.crates/python/tests/coverage/py_types_coverage_tests.rs (1)
589-601: Coverage fixtures are correctly synchronized with the expanded request modelBoth updated
AnnotatedLLMRequestliterals now include the added optional fields, which keeps these Python coverage paths compile-safe and aligned with the codec IR expansion.Also applies to: 1358-1370
crates/adaptive/tests/integration/runtime_integration_tests.rs (1)
82-94: Helper request shape update looks goodThe additional
Noneassignments correctly track the expandedAnnotatedLlmRequestfields and keep this integration helper current.crates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.json (1)
1-11: Fixture is well-targeted for mixed-content system blocksThis payload cleanly exercises the case where system content includes non-text plus text, which is exactly what the updated extraction logic needs.
crates/adaptive/tests/integration/acg_module_surface_tests.rs (1)
146-158: Both test request literals are correctly updatedThe added
Nonefields keep these ACG module-surface tests aligned with the currentAnnotatedLlmRequestshape.Also applies to: 204-216
crates/adaptive/tests/unit/acg/ir_builder_tests.rs (1)
74-86: IR builder unit fixtures remain consistent after schema expansionAll three
AnnotatedLlmRequestliterals now include the new optional fields, which keeps these tests robust against the updated request model.Also applies to: 126-138, 168-180
crates/adaptive/tests/unit/acg_profile_tests.rs (1)
20-32: Helper update is correctAdding the new optional fields in the shared
request(...)helper keeps all downstream profile tests aligned with the expandedAnnotatedLlmRequestmodel.crates/wasm/tests/coverage/callable_tests.rs (1)
150-162: Fixture update correctly tracks the expanded request schema.The new optional fields are consistently initialized and keep this callable fallback test aligned with the current
AnnotatedLlmRequestshape.crates/ffi/tests/integration/callable_extra_tests.rs (1)
267-279: Good parity update for FFI test fixture shape.This keeps the integration test input synchronized with the expanded annotated request surface without changing test intent.
crates/core/tests/integration/codec_tests.rs (1)
34-47: Consistent schema migration across codec integration fixtures.The repeated
AnnotatedLlmRequestupdates are coherent and preserve existing test semantics while matching the new request model.Also applies to: 118-130, 154-167, 410-423
crates/adaptive/tests/unit/runtime_tests.rs (1)
54-67: Helper fixtures are correctly updated for the expanded request IR.These updates keep adaptive runtime tests aligned with the current
AnnotatedLlmRequestcontract.Also applies to: 98-110, 519-531
crates/core/tests/unit/codec/request_tests.rs (1)
261-267: Good assertion update for modeledstreambehavior.Switching from
extra["stream"]toreq.streamcorrectly validates the new typed-field contract.crates/core/tests/unit/codec/response_tests.rs (1)
195-201: API-specific response fixtures are correctly expanded.These additions keep round-trip coverage in sync with the new OpenAI Responses and Anthropic modeled fields.
Also applies to: 212-218
crates/core/tests/unit/codec/openai_chat_tests.rs (1)
549-571: Strong coverage additions for typed controls and multimodal image parts.The new tests validate decode/encode behavior, override precedence, and
image_urlpart round-tripping in the right places.Also applies to: 583-620, 660-745
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/core/src/codec/openai_responses.rs (1)
448-455:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPrevent silent divergence between
params.max_tokensandmax_output_tokens.Line 448/Line 505 populate two sources for the same control, and Line 580 can silently encode a stale value if only one field is mutated downstream. Add a divergence guard and compute one effective value before encoding.
Proposed fix
@@ - // Overlay generation params. + // Overlay generation params (temperature/top_p/stop). if let Some(ref params) = annotated.params { overlay_generation_params(obj, params); } + + let params_max_output_tokens = annotated.params.as_ref().and_then(|p| p.max_tokens); + if let (Some(a), Some(b)) = (annotated.max_output_tokens, params_max_output_tokens) { + if a != b { + return Err(FlowError::Internal( + "OpenAI Responses encode: max_output_tokens and params.max_tokens diverged" + .into(), + )); + } + } @@ - if let Some(max_output_tokens) = annotated.max_output_tokens { + if let Some(max_output_tokens) = + annotated.max_output_tokens.or(params_max_output_tokens) + { obj.insert("max_output_tokens".into(), Json::from(max_output_tokens)); }Also applies to: 505-506, 533-535, 580-582
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/core/src/codec/openai_responses.rs` around lines 448 - 455, The code currently sets max_tokens from two places (obj.get("max_output_tokens") -> max_output_tokens and GenerationParams.max_tokens) which can diverge and later encode a stale value; fix by computing one canonical effective_max_tokens before building GenerationParams and before encoding (e.g., prefer explicit GenerationParams.max_tokens if present, otherwise fall back to max_output_tokens, or enforce equality and error), then populate GenerationParams.max_tokens from that single effective value and use the same effective_max_tokens when serializing/encoding so params.max_tokens and max_output_tokens cannot diverge (update the logic around GenerationParams construction and the encode path that reads params.max_tokens / max_output_tokens).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/core/src/codec/openai_responses.rs`:
- Around line 448-455: The code currently sets max_tokens from two places
(obj.get("max_output_tokens") -> max_output_tokens and
GenerationParams.max_tokens) which can diverge and later encode a stale value;
fix by computing one canonical effective_max_tokens before building
GenerationParams and before encoding (e.g., prefer explicit
GenerationParams.max_tokens if present, otherwise fall back to
max_output_tokens, or enforce equality and error), then populate
GenerationParams.max_tokens from that single effective value and use the same
effective_max_tokens when serializing/encoding so params.max_tokens and
max_output_tokens cannot diverge (update the logic around GenerationParams
construction and the encode path that reads params.max_tokens /
max_output_tokens).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: e6340b81-8250-408a-8dac-214f941dbf00
📒 Files selected for processing (8)
crates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/python/src/py_types/codecs.rscrates/python/tests/coverage/py_types_coverage_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (20)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
**/*.rs: Runcargo fmt --allfor FFI work as it is Rust work
Runjust test-rustfor FFI validation
Runcargo clippy --workspace --all-targets -- -D warningsto enforce warnings-as-errors lintingWhen Rust files changed as part of Python work, run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting
Runcargo clippy --workspace --all-targets -- -D warningsto enforce Rust linting with no warnings
Runjust test-rustas the shared-runtime build/test wrapper for Rust changesUse Rust snake_case naming convention for Rust code
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting when Node changes touch Rust files
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting when Rust files changed as part of Node work
**/*.rs: Always runjust test-rustwhen any Rust code changes
Always runcargo fmt --allwhen any Rust code changes
Always runcargo clippy --workspace --all-targets -- -D warningswhen any Rust code changes
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
SONAR_IGNORE_START/SONAR_IGNORE_ENDmarkers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure typed helper constructors map cleanly to the same config document without divergence
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changed files must be formatted with the language-native formatter
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
{crates/core,crates/adaptive}/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
If the change touched shared runtime semantics in
crates/coreorcrates/adaptive, also usevalidate-change
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/adaptive/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/adaptivechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
**/*.{py,js,ts,tsx,go,rs,md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Format changed files with the language-native formatter before the final lint/test pass
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,py,js,ts,tsx,go}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
During iteration, prefer
uv run pre-commit run --files <changed files...>for targeted validation
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/{core,adaptive}/**/*.rs
⚙️ CodeRabbit configuration file
crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
crates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/{integrations,integration,*-integration}/**
📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)
**/{integrations,integration,*-integration}/**: Keep NeMo Flow optional in framework integrations
Preserve the framework's original behavior when NeMo Flow is absent
Wrap tool and LLM paths at the correct framework boundary
Integration pattern must followdocs/integrate-frameworks/adding-scopes.md
Files:
crates/adaptive/tests/integration/runtime_integration_tests.rs
crates/python/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
When the native Rust bridge changed, add the Rust crate tests for
nemo-flow-python
Files:
crates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rs
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/corechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/openai_responses_tests.rs
🔇 Additional comments (5)
crates/adaptive/tests/unit/runtime_tests.rs (1)
54-66: Looks good: test fixtures are correctly synchronized with the expandedAnnotatedLlmRequestshape.Initializing all newly added optional fields to
Nonepreserves existing test semantics while keeping request literals forward-compatible with the codec changes.Also applies to: 98-110, 455-467, 532-544
crates/adaptive/src/acg_profile.rs (1)
191-196: Multimodal fingerprint signal is now preserved correctly.
ContentPart::ImageUrlis encoded as a stable non-PII marker (detail+ SHA-256 of URL), which prevents image-only or image-different prompts from collapsing into identical fingerprints.crates/adaptive/tests/unit/acg_profile_tests.rs (2)
7-33: Test fixture updates are aligned with the expanded request IR.Adding
OpenAiImageUrland explicitly setting new optionalAnnotatedLlmRequestfields keeps this helper synchronized with the current codec surface.
128-159: Good regression coverage for image-aware seed fingerprinting.This test correctly asserts that changing only
ContentPart::ImageUrl.urlchangeslearning_seed_fingerprint, protecting the new multimodal signal path.crates/python/src/py_types/codecs.rs (1)
51-74: Good binding-surface parity improvement.The optional JSON helpers plus the new getters/setters provide consistent Python access to the expanded request fields and keep None-handling explicit.
Also applies to: 268-396
|
Addressed the CodeRabbit nits in follow-up commit 2e927e1.
Also fixed a few stale adaptive test AnnotatedLlmRequest literals that surfaced during the focused follow-up test runs. Focused validation run:
|
|
/ok to test 2e927e1 |
675f7ba to
a449142
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/core/src/codec/request.rs (1)
136-151:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale
ContentPartcapability docs.The enum now supports
ImageUrl, but the doc text still says v1 supports text only. Please align the comment with the actual variants to avoid misleading API docs.Suggested doc fix
-/// v1 supports text only. Future versions may add `ImageUrl`, `Audio`, etc. +/// v1 supports text and image URL parts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/core/src/codec/request.rs` around lines 136 - 151, The doc comment above the ContentPart enum is stale—update the comment to reflect current variants (Text and ImageUrl) instead of saying "v1 supports text only"; specifically revise the paragraph for enum ContentPart to mention that v1 supports text and image URL parts (Text { text: String } and ImageUrl { image_url: OpenAiImageUrl }) and note that future versions may add other kinds like Audio, etc., so the generated API docs match the actual enum variants.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/core/src/codec/anthropic.rs`:
- Around line 211-214: The messages array is currently populated even when a
Message::System contains only non-text content because extract_system_text
returning None still allows the original Message::System into the Anthropic
messages list; update the mapping/filtering logic that builds messages (where
you call extract_system_text and iterate over Message variants) to explicitly
skip any Message::System variant entirely (not just when extractable text
exists), ensuring only Message::User and Message::Assistant are pushed into the
Anthropic messages array and system prompts remain top-level; locate the code
that matches on Message (e.g., the closure using super::request::ContentPart and
extract_system_text) and add an explicit branch to ignore Message::System, or
move system extraction into top-level handling and only emit user/assistant
roles into messages.
In
`@crates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.json`:
- Line 2: The test fixture's "model" value uses the deprecated
"claude-sonnet-4-20250514"; update the JSON fixture by replacing the "model"
value with a current Claude Sonnet release (for example "claude-sonnet-4.6" or
the latest available non-deprecated identifier) so tests reference a supported
model version.
- Line 11: The fixture contains a non-standard "scope" field inside the
cache_control object ("cache_control": { "type": "ephemeral", "scope": "global"
}) which is not part of Anthropic's Messages API; either remove the "scope"
property so the block becomes {"type":"ephemeral"} (or add ttl if needed), or if
this is intentionally a LiteLLM extension, add a brief inline comment in the
fixture documenting that "scope" is a LiteLLM-only extension and not part of
Anthropic's official cache_control schema; update the JSON accordingly and keep
the "cache_control" key and "type":"ephemeral" intact.
---
Outside diff comments:
In `@crates/core/src/codec/request.rs`:
- Around line 136-151: The doc comment above the ContentPart enum is
stale—update the comment to reflect current variants (Text and ImageUrl) instead
of saying "v1 supports text only"; specifically revise the paragraph for enum
ContentPart to mention that v1 supports text and image URL parts (Text { text:
String } and ImageUrl { image_url: OpenAiImageUrl }) and note that future
versions may add other kinds like Audio, etc., so the generated API docs match
the actual enum variants.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 292b5a8a-a848-4f6d-9699-0bfe9afd027b
📒 Files selected for processing (40)
crates/adaptive/src/acg/ir_builder.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/core/src/codec/anthropic.rscrates/core/src/codec/openai_chat.rscrates/core/src/codec/openai_responses.rscrates/core/src/codec/request.rscrates/core/src/codec/response.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/core/tests/integration/codec_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/unit/shared_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/src/py_types/codecs.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/wasm/tests/coverage/callable_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (22)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
**/*.rs: Runcargo fmt --allfor FFI work as it is Rust work
Runjust test-rustfor FFI validation
Runcargo clippy --workspace --all-targets -- -D warningsto enforce warnings-as-errors lintingWhen Rust files changed as part of Python work, run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting
Runcargo clippy --workspace --all-targets -- -D warningsto enforce Rust linting with no warnings
Runjust test-rustas the shared-runtime build/test wrapper for Rust changesUse Rust snake_case naming convention for Rust code
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting when Node changes touch Rust files
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting when Rust files changed as part of Node work
**/*.rs: Always runjust test-rustwhen any Rust code changes
Always runcargo fmt --allwhen any Rust code changes
Always runcargo clippy --workspace --all-targets -- -D warningswhen any Rust code changes
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
**/*.{rs,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
SONAR_IGNORE_START/SONAR_IGNORE_ENDmarkers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure typed helper constructors map cleanly to the same config document without divergence
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep plugin context surfaces aligned across all language implementations
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changed files must be formatted with the language-native formatter
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
{crates/core,crates/adaptive}/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
If the change touched shared runtime semantics in
crates/coreorcrates/adaptive, also usevalidate-change
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
crates/adaptive/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/adaptivechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rs
**/*.{py,js,ts,tsx,go,rs,md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Format changed files with the language-native formatter before the final lint/test pass
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
**/*.{rs,py,js,ts,tsx,go}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
During iteration, prefer
uv run pre-commit run --files <changed files...>for targeted validation
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
crates/{core,adaptive}/**/*.rs
⚙️ CodeRabbit configuration file
crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/src/acg/ir_builder.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/adaptive/src/acg_profile.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
crates/adaptive/tests/unit/cache_diagnostics_tests.rscrates/core/tests/fixtures/codec/openai_responses/strict_messages_array.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.jsoncrates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.jsoncrates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.jsoncrates/adaptive/tests/unit/acg/ir_builder_tests.rscrates/adaptive/tests/unit/acg_learner_tests.rscrates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.jsoncrates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.jsoncrates/core/tests/integration/pipeline_tests.rscrates/adaptive/tests/unit/adaptive_hints_intercept_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.jsoncrates/wasm/tests/coverage/callable_tests.rscrates/adaptive/tests/unit/runtime_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/core/tests/unit/shared_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/unit/acg_profile_tests.rscrates/core/tests/unit/codec/response_tests.rscrates/adaptive/tests/unit/acg_component_tests.rscrates/ffi/tests/unit/types_tests.rscrates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.jsoncrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/tests/unit/codec/anthropic_tests.rs
crates/ffi/**
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
Rebuild the FFI crate in release mode so the shared library and header stay in sync
Files:
crates/ffi/tests/integration/callable_extra_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/ffi/tests/unit/types_tests.rs
**/{integrations,integration,*-integration}/**
📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)
**/{integrations,integration,*-integration}/**: Keep NeMo Flow optional in framework integrations
Preserve the framework's original behavior when NeMo Flow is absent
Wrap tool and LLM paths at the correct framework boundary
Integration pattern must followdocs/integrate-frameworks/adding-scopes.md
Files:
crates/ffi/tests/integration/callable_extra_tests.rscrates/core/tests/integration/pipeline_tests.rscrates/adaptive/tests/integration/redis_tests.rscrates/adaptive/tests/integration/acg_module_surface_tests.rscrates/adaptive/tests/integration/runtime_integration_tests.rscrates/core/tests/integration/codec_tests.rs
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/ffi/tests/integration/callable_extra_tests.rscrates/ffi/tests/unit/callable_tests.rscrates/wasm/tests/coverage/callable_tests.rscrates/ffi/tests/unit/types_tests.rscrates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/corechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/tests/integration/pipeline_tests.rscrates/core/tests/unit/shared_tests.rscrates/core/src/codec/openai_chat.rscrates/core/tests/unit/codec/response_tests.rscrates/core/tests/integration/codec_tests.rscrates/core/src/codec/response.rscrates/core/src/codec/request.rscrates/core/tests/unit/codec/openai_chat_tests.rscrates/core/src/codec/anthropic.rscrates/core/tests/unit/codec/openai_responses_tests.rscrates/core/tests/unit/codec/request_tests.rscrates/core/src/codec/openai_responses.rscrates/core/tests/unit/codec/anthropic_tests.rs
crates/wasm/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
crates/wasm/**/*.rs: Runcargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
Addcargo test -p nemo-flow-wasmwhen Rust-only WebAssembly helpers changed
Files:
crates/wasm/tests/coverage/callable_tests.rs
crates/python/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
When the native Rust bridge changed, add the Rust crate tests for
nemo-flow-python
Files:
crates/python/tests/coverage/py_types_coverage_tests.rscrates/python/src/py_types/codecs.rs
🔇 Additional comments (38)
crates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.json (1)
1-11: LGTM!crates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.json (1)
1-5: LGTM!crates/core/tests/fixtures/codec/openai_responses/strict_messages_array.json (1)
1-9: LGTM!crates/adaptive/tests/unit/cache_diagnostics_tests.rs (1)
107-119: LGTM!crates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.json (1)
1-7: LGTM!crates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.json (1)
1-18: LGTM!crates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.json (1)
1-11: LGTM!crates/core/src/codec/request.rs (1)
40-78: LGTM!Also applies to: 154-161, 271-274, 289-292
crates/core/tests/integration/pipeline_tests.rs (1)
101-113: LGTM!crates/adaptive/tests/integration/acg_module_surface_tests.rs (1)
146-158: LGTM!Also applies to: 204-216
crates/adaptive/tests/unit/acg_component_tests.rs (1)
100-112: LGTM!crates/core/tests/unit/codec/request_tests.rs (1)
29-41: LGTM!Also applies to: 261-261, 304-316, 372-384, 401-413, 432-444, 476-488, 505-517, 543-555, 584-596, 613-625, 643-655
crates/adaptive/tests/unit/acg_learner_tests.rs (1)
37-49: LGTM!crates/core/tests/unit/shared_tests.rs (1)
40-52: LGTM!crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs (1)
182-194: LGTM!crates/adaptive/tests/integration/redis_tests.rs (1)
123-135: LGTM!crates/core/tests/integration/codec_tests.rs (1)
34-46: LGTM!Also applies to: 118-130, 154-166, 410-422, 451-463, 476-488, 522-534, 551-563, 582-594, 622-634, 658-670, 695-707, 724-736, 754-766
crates/ffi/tests/integration/callable_extra_tests.rs (1)
267-279: LGTM!crates/ffi/tests/unit/types_tests.rs (1)
524-536: LGTM!crates/ffi/tests/unit/callable_tests.rs (1)
326-338: LGTM!crates/core/src/codec/openai_chat.rs (1)
115-121: LGTM!Also applies to: 273-288, 317-340
crates/wasm/tests/coverage/callable_tests.rs (1)
150-162: LGTM!crates/adaptive/tests/integration/runtime_integration_tests.rs (1)
82-94: LGTM!Also applies to: 116-128, 157-169, 209-221
crates/core/tests/unit/codec/openai_chat_tests.rs (1)
9-9: LGTM!Also applies to: 541-541, 549-571, 583-620, 660-690, 692-711, 713-745, 824-836, 880-892, 925-937, 968-980
crates/core/src/codec/response.rs (1)
184-204: LGTM!Also applies to: 210-227, 258-261
crates/adaptive/src/acg/ir_builder.rs (1)
150-152: LGTM!crates/adaptive/tests/unit/acg/ir_builder_tests.rs (1)
74-86: LGTM!Also applies to: 126-138, 168-180
crates/core/tests/unit/codec/response_tests.rs (1)
195-201: LGTM!Also applies to: 212-217
crates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.json (1)
1-10: LGTM!crates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.json (1)
1-11: LGTM!crates/core/tests/unit/codec/anthropic_tests.rs (1)
23-25: LGTM!Also applies to: 527-602, 639-673, 841-853, 870-870
crates/core/src/codec/openai_responses.rs (1)
52-56: LGTM!Also applies to: 67-82, 117-133, 145-159, 298-330, 350-385, 412-509, 521-597
crates/core/tests/unit/codec/openai_responses_tests.rs (1)
23-25: LGTM!Also applies to: 114-138, 141-172, 393-405, 410-410, 458-460, 462-500, 501-520, 521-531, 532-543, 544-565, 566-593, 658-701, 703-720, 779-791
crates/python/src/py_types/codecs.rs (1)
51-71: LGTM!Also applies to: 132-144, 265-393
crates/python/tests/coverage/py_types_coverage_tests.rs (1)
589-601: LGTM!Also applies to: 1071-1083, 1102-1120, 1125-1149, 1158-1168, 1423-1435
crates/adaptive/src/acg_profile.rs (1)
191-196: LGTM!crates/adaptive/tests/unit/runtime_tests.rs (1)
54-66: LGTM!Also applies to: 98-110, 455-467, 532-544
crates/adaptive/tests/unit/acg_profile_tests.rs (1)
7-8: LGTM!Also applies to: 21-33, 128-159
|
/ok to test a449142 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/core/tests/unit/codec/anthropic_tests.rs`:
- Around line 699-703: The test currently only asserts
obj.get("tool_choice").and_then(|v| v.get("disable_parallel_tool_use")) and can
miss regressions that drop or change the tool_choice.type field; add a companion
assertion that checks obj.get("tool_choice").and_then(|v| v.get("type")) is
present and equals the expected string (e.g., Some(&json!("tool"))) so the test
validates both the presence and value of "type" alongside
"disable_parallel_tool_use".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: b80668ac-c61f-4c63-a1d8-8088b8790bba
📒 Files selected for processing (2)
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (11)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
**/*.rs: Runcargo fmt --allfor FFI work as it is Rust work
Runjust test-rustfor FFI validation
Runcargo clippy --workspace --all-targets -- -D warningsto enforce warnings-as-errors linting
**/*.rs: Runcargo fmt --allfor Rust code formatting
Runcargo clippy --workspace --all-targets -- -D warningsto enforce Rust linting with no warnings
Runjust test-rustas the shared-runtime build/test wrapper for Rust changesUse Rust snake_case naming convention for Rust code
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting when Node changes touch Rust files
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting when Rust files changed as part of Node work
**/*.rs: Always runjust test-rustwhen any Rust code changes
Always runcargo fmt --allwhen any Rust code changes
Always runcargo clippy --workspace --all-targets -- -D warningswhen any Rust code changes
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
SONAR_IGNORE_START/SONAR_IGNORE_ENDmarkers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changed files must be formatted with the language-native formatter
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
{crates/core,crates/adaptive}/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
If the change touched shared runtime semantics in
crates/coreorcrates/adaptive, also usevalidate-change
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/corechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{py,js,ts,tsx,go,rs,md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Format changed files with the language-native formatter before the final lint/test pass
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,py,js,ts,tsx,go}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
During iteration, prefer
uv run pre-commit run --files <changed files...>for targeted validation
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
crates/{core,adaptive}/**/*.rs
⚙️ CodeRabbit configuration file
crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
crates/core/tests/unit/codec/anthropic_tests.rscrates/core/tests/unit/codec/openai_responses_tests.rs
🔇 Additional comments (5)
crates/core/tests/unit/codec/openai_responses_tests.rs (4)
110-135: LGTM!Also applies to: 137-168
389-413: LGTM!Also applies to: 460-501, 503-628
693-755: LGTM!
814-826: LGTM!crates/core/tests/unit/codec/anthropic_tests.rs (1)
227-233: LGTM!Also applies to: 247-252, 274-278, 300-316, 523-540, 543-564, 567-587, 589-617, 620-646, 671-698, 704-704, 873-885, 902-902
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
…llelism Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
…le hybrid fixtures Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Signed-off-by: Alex Fournier <afournier@nvidia.com>
33f4ca0 to
af027f1
Compare
|
/ok to test af027f1 |
|
/merge |
Summary
This PR expands normalized codec extraction around
AnnotatedLlmRequestandAnnotatedLlmResponsefor:/v1/chat/completions)/v1/responses)/v1/messages)vLLM,LiteLLM,SGLangpatterns)The goal is to extract more meaningful normalized state while preserving unmodeled provider-specific fields losslessly via
extra.Additive Request IR State (
AnnotatedLlmRequest)Added normalized optional fields:
store: Option<bool>previous_response_id: Option<String>truncation: Option<Json>reasoning: Option<Json>include: Option<Json>user: Option<String>metadata: Option<Json>service_tier: Option<String>parallel_tool_calls: Option<bool>max_output_tokens: Option<u64>max_tool_calls: Option<u64>top_logprobs: Option<u64>stream: Option<bool>Multimodal request content expansion:
ContentPart::ImageUrl { image_url: OpenAiImageUrl }OpenAiImageUrl { url, detail }Additive Response IR State (
ApiSpecificResponse)OpenAI Responses variant expanded with:
previous_response_idstoreservice_tiertruncationreasoninginput_tokens_detailsoutput_tokens_detailsAnthropic Messages variant expanded with:
service_tiercontainercontent_blocksOpenAI Responses request-side hardening
inputarraysextra(_openai_responses_unparsed_input_items) for round-trip safetyAnthropic request-side updates
tool_choice.type == "none"parity in decode/encodeextraHybrid payload coverage added
Added fixture/test coverage for mixed/provider patterns:
Consumer blast-radius updates
Because request IR added new fields and a new
ContentPartvariant, downstream consumers were updated:crates/adaptivecrates/ffitestscrates/wasmtestscrates/pythonScope note
This PR intentionally avoids a larger architectural shift. It keeps the current
AnnotatedLlmRequest/AnnotatedLlmResponseIR approach and expands extraction additively.Validation performed
uv run pre-commit run --all-filescargo test -p nemo-flow-adaptivecargo test -p nemo-flow-fficargo test -p nemo-flow-wasmcargo test -p nemo-flow-pythoncargo test -p nemo-flow codec::inputround-trip test against the real APILive validation notes
Live provider validation covered:
input_tokens_details.cached_tokensandoutput_tokens_details.reasoning_tokensinputarray round-trip behavior using a real tool-calling follow-up requesttypeandstop_reasonRemaining limitations
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests