Skip to content

feat(codec): add missing optional AnnotatedLlmRequest/Response fields#76

Open
afourniernv wants to merge 16 commits into
NVIDIA:mainfrom
afourniernv:feat/codec-ir-extraction
Open

feat(codec): add missing optional AnnotatedLlmRequest/Response fields#76
afourniernv wants to merge 16 commits into
NVIDIA:mainfrom
afourniernv:feat/codec-ir-extraction

Conversation

@afourniernv
Copy link
Copy Markdown
Contributor

@afourniernv afourniernv commented May 11, 2026

Summary

This PR expands normalized codec extraction around AnnotatedLlmRequest and AnnotatedLlmResponse for:

  • OpenAI Chat Completions (/v1/chat/completions)
  • OpenAI Responses (/v1/responses)
  • Anthropic Messages (/v1/messages)
  • Hybrid payload variants observed in inference gateways/provider bridges (vLLM, LiteLLM, SGLang patterns)

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_id
  • store
  • service_tier
  • truncation
  • reasoning
  • input_tokens_details
  • output_tokens_details

Anthropic Messages variant expanded with:

  • service_tier
  • container
  • content_blocks

OpenAI Responses request-side hardening

  • Added strict-first decode behavior for heterogeneous input arrays
  • Removed silent lossy fallback behavior
  • Preserves unparsed mixed input items in extra (_openai_responses_unparsed_input_items) for round-trip safety
  • Handles Anthropic-style tool hint combinations when present in mixed gateway payloads

Anthropic request-side updates

  • Expanded extraction for metadata, service-tier, and tool parallelism semantics
  • Added explicit tool_choice.type == "none" parity in decode/encode
  • Preserves bridge/runtime extension fields in extra

Hybrid payload coverage added

Added fixture/test coverage for mixed/provider patterns:

  • vLLM-style Anthropic and OpenAI Responses hybrids
  • LiteLLM hybrid patterns for Anthropic and Responses
  • SGLang Responses extension payloads

Consumer blast-radius updates

Because request IR added new fields and a new ContentPart variant, downstream consumers were updated:

  • crates/adaptive
  • crates/ffi tests
  • crates/wasm tests
  • crates/python

Scope note

This PR intentionally avoids a larger architectural shift. It keeps the current AnnotatedLlmRequest / AnnotatedLlmResponse IR approach and expands extraction additively.

Validation performed

  • uv run pre-commit run --all-files
  • cargo test -p nemo-flow-adaptive
  • cargo test -p nemo-flow-ffi
  • cargo test -p nemo-flow-wasm
  • cargo test -p nemo-flow-python
  • cargo test -p nemo-flow codec::
  • Live OpenAI Responses smoke test against the real API
  • Live OpenAI Responses mixed tool-follow-up input round-trip test against the real API
  • Live Anthropic Messages smoke test against the real API

Live validation notes

Live provider validation covered:

  • OpenAI Responses request/response decode and encode behavior
  • OpenAI Responses usage detail preservation for input_tokens_details.cached_tokens and output_tokens_details.reasoning_tokens
  • OpenAI mixed input array round-trip behavior using a real tool-calling follow-up request
  • Anthropic Messages response preservation for type and stop_reason

Remaining limitations

  • This is still not exhaustive gateway conformance testing for every provider bridge variant
  • Hybrid gateway behavior is still primarily fixture-backed rather than live-provider-backed

Summary by CodeRabbit

  • New Features

    • Multimodal message support with proper handling of image parts and text extraction
    • New request/response metadata: store, previous-response tracking, service tier, reasoning, user/metadata, and control limits
    • Enhanced tool-choice controls including parallel-tool hints
    • More detailed token usage reporting (input/output breakdowns)
  • Bug Fixes

    • System and response text extraction now ignore non-text parts (e.g., images)
  • Tests

    • Updated fixtures and tests across codecs and integrations to match the new request/response shape

Review Change Stack

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 11, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Walkthrough

This PR extends the codec system to support multimodal content and provider-specific fields across Anthropic and OpenAI APIs. New optional request fields (store, previous_response_id, truncation, reasoning, include, user, metadata, service_tier, parallel_tool_calls, max_output_tokens, max_tool_calls, top_logprobs, stream) are added to AnnotatedLlmRequest, multimodal image URL content is supported via ContentPart::ImageUrl, and all codec implementations are updated to round-trip these fields while filtering text extraction to skip non-text parts.

Codec and Data Model Updates

Layer / File(s) Summary
Request and response schema expansion
crates/core/src/codec/request.rs, crates/core/src/codec/response.rs
AnnotatedLlmRequest adds 13 optional fields and ContentPart::ImageUrl variant with OpenAiImageUrl struct. ApiSpecificResponse expands both OpenAI and Anthropic variants with new metadata fields.
Text-only content extraction
crates/adaptive/src/acg/ir_builder.rs, crates/adaptive/src/acg_profile.rs, crates/core/src/codec/request.rs, crates/core/src/codec/response.rs
extract_text and helper methods updated to use filter_map/find_map patterns that return only ContentPart::Text and skip ImageUrl parts.
Anthropic codec implementation
crates/core/src/codec/anthropic.rs
Tool choice parsing recognizes {"type":"none"}; disable_parallel_tool_use decoded to/encoded from parallel_tool_calls; response captures object_type, service_tier, container; system text extraction filtered for text-only parts; metadata and service_tier carried through request round-trip.
OpenAI chat codec field handling
crates/core/src/codec/openai_chat.rs
Extends MODELED_REQUEST_KEYS to include store, user, metadata, service_tier, parallel_tool_calls, top_logprobs, stream; decode extracts from input JSON; encode conditionally inserts back to outgoing request.
OpenAI Responses codec input/output handling
crates/core/src/codec/openai_responses.rs
Strict-first input array parsing with fallback to preserve raw JSON; tool_choice and parallel_tool_calls normalization helpers; response decoding captures token usage details and metadata; lossless input round-tripping during encode; overlays new top-level request fields.
Test fixture JSON files
crates/core/tests/fixtures/codec/anthropic/*, crates/core/tests/fixtures/codec/openai_responses/*
9 new fixtures covering cache control, thinking config, system blocks with non-text, tool choice variants, reasoning items, function call outputs, and extension fields.
Adaptive module test updates
crates/adaptive/tests/unit/*, crates/adaptive/tests/integration/*
15 test locations updated to populate new AnnotatedLlmRequest fields with None.
Anthropic codec test coverage
crates/core/tests/unit/codec/anthropic_tests.rs
Fixture JSON helper added; API-specific field validation updated; extra field assertions adjusted; new fixture-driven decode tests for service tier, parallel tools, tool choice variants, system arrays; new encode test for metadata/service_tier/parallel hint; request helper initialized with new fields.
OpenAI chat codec test coverage
crates/core/tests/unit/codec/openai_chat_tests.rs
Multimodal imports added; new typed controls and image_url decode tests; new encode tests for controls and override behavior; 4 existing test fixtures updated with new fields.
OpenAI Responses codec test coverage
crates/core/tests/unit/codec/openai_responses_tests.rs
Fixture JSON helper added; response assertions expanded for token details; new API-specific field decode test; 5 new request decode tests covering typed controls, input preservation, tool choice variants, reasoning items, extensions; new encode tests; request helper updated.
Core integration test updates
crates/core/tests/integration/codec_tests.rs, crates/core/tests/integration/pipeline_tests.rs
MockCodec and TrackingCodec decode updated; 15 test locations updated to populate new request fields; system_prompt, last_user_message, has_tool_calls tests updated.
Core request/response unit tests
crates/core/tests/unit/codec/request_tests.rs, crates/core/tests/unit/codec/response_tests.rs, crates/core/tests/unit/shared_tests.rs
15 test locations updated to populate new optional fields; stream field assertion changed from extra map to dedicated property; API-specific response struct literals expanded with metadata.
FFI/Python/Wasm test updates
crates/ffi/tests/*, crates/python/tests/*, crates/wasm/tests/*
7 test locations across FFI (callable/types), Python (types codec/coverage), and Wasm (callable) updated to populate new request fields.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive PR description provides comprehensive details on changes, validation, and scope, but lacks required template structure with Overview, Details, Where to start, and Related Issues sections. Restructure description using the repository template: add Overview section with confirmation checkboxes, isolate Details, identify key review files, and link related issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed Title follows Conventional Commits format with 'feat' type, 'codec' scope, concise imperative summary under 72 characters, and clearly describes the main change.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:XL PR is extra large lang:rust PR changes/introduces Rust code labels May 11, 2026
@afourniernv afourniernv force-pushed the feat/codec-ir-extraction branch from 1844af6 to eeeaa13 Compare May 13, 2026 01:03
@afourniernv afourniernv marked this pull request as ready for review May 13, 2026 01:10
@afourniernv afourniernv requested a review from a team as a code owner May 13, 2026 01:10
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>
@afourniernv afourniernv force-pushed the feat/codec-ir-extraction branch from eeeaa13 to c9ea854 Compare May 13, 2026 01:11
@willkill07
Copy link
Copy Markdown
Member

/ok to test c9ea854

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Strengthen this test to assert round-trip on new optional fields

AnnotatedLlmRequest now includes many new optional fields, but this test still only verifies model and extra. Set a few new fields to non-None and 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 win

Prevent lossy decode when modeled keys have unexpected JSON types.

extra currently drops all modeled keys unconditionally, even when typed extraction fails (as_bool/as_str returns None). 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

📥 Commits

Reviewing files that changed from the base of the PR and between 43db71b and c9ea854.

📒 Files selected for processing (40)
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/core/src/codec/request.rs
  • crates/core/src/codec/response.rs
  • crates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.json
  • crates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.json
  • crates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.json
  • crates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.json
  • crates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.json
  • crates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.json
  • crates/core/tests/fixtures/codec/openai_responses/strict_messages_array.json
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/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/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/tests/fixtures/codec/openai_responses/anthropic_tool_choice_hint.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.json
  • crates/core/tests/fixtures/codec/openai_responses/strict_messages_array.json
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.json
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.json
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.json
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.json
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.json
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_tool_choice_none_with_extensions.json
  • crates/core/tests/fixtures/codec/anthropic/vllm_system_block_with_non_text.json
  • crates/core/tests/fixtures/codec/openai_responses/strict_messages_array.json
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/core/tests/fixtures/codec/anthropic/litellm_cache_control_blocks.json
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/core/tests/fixtures/codec/anthropic/litellm_thinking_output_config_reasoning_effort.json
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/core/tests/fixtures/codec/openai_responses/sglang_responses_request_with_extensions.json
  • crates/ffi/tests/unit/types_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/core/tests/fixtures/codec/openai_responses/litellm_reasoning_input_item.json
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/tests/fixtures/codec/openai_responses/mixed_input_with_function_call_output.json
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)

**/*.rs: Run cargo fmt --all for FFI work as it is Rust work
Run just test-rust for FFI validation
Run cargo clippy --workspace --all-targets -- -D warnings to enforce warnings-as-errors linting

When Rust files changed as part of Python work, run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting
Run cargo clippy --workspace --all-targets -- -D warnings to enforce Rust linting with no warnings
Run just test-rust as the shared-runtime build/test wrapper for Rust changes

Use Rust snake_case naming convention for Rust code

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting when Node changes touch Rust files
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting when Rust files changed as part of Node work

**/*.rs: Always run just test-rust when any Rust code changes
Always run cargo fmt --all when any Rust code changes
Always run cargo clippy --workspace --all-targets -- -D warnings when any Rust code changes

Files:

  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/core/src/codec/openai_responses.rs
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers 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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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/core or crates/adaptive, also use validate-change

Files:

  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/core/src/codec/openai_responses.rs
crates/adaptive/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

When crates/adaptive changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

Files:

  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/ffi/tests/unit/types_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/adaptive_hints_intercept_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/acg_learner_tests.rs
  • crates/adaptive/tests/unit/acg_component_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/adaptive/tests/unit/acg/ir_builder_tests.rs
  • crates/adaptive/src/acg/ir_builder.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/shared_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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 follow docs/integrate-frameworks/adding-scopes.md

Files:

  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/integration/acg_module_surface_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/adaptive/tests/integration/redis_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/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.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/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.rs
  • crates/python/src/py_types/codecs.rs
  • crates/wasm/tests/coverage/callable_tests.rs
  • crates/ffi/tests/unit/callable_tests.rs
  • crates/ffi/tests/integration/callable_extra_tests.rs
  • crates/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.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
crates/wasm/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)

crates/wasm/**/*.rs: Run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings when Rust files changed as part of WebAssembly work
Add cargo test -p nemo-flow-wasm when 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/core changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

crates/core/**/*.rs: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.

Files:

  • crates/core/tests/unit/shared_tests.rs
  • crates/core/tests/integration/pipeline_tests.rs
  • crates/core/src/codec/openai_chat.rs
  • crates/core/src/codec/response.rs
  • crates/core/src/codec/request.rs
  • crates/core/tests/unit/codec/response_tests.rs
  • crates/core/tests/integration/codec_tests.rs
  • crates/core/tests/unit/codec/request_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/src/codec/anthropic.rs
  • crates/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 system and messages[*].content[*] text blocks with cache_control variants (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 expanded AnnotatedLlmRequest schema.

As per coding guidelines, changes to crates/core must 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/adaptive must 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 consistent

Explicitly setting the newly added optional request fields to None keeps 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 model

Both updated AnnotatedLLMRequest literals 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 good

The additional None assignments correctly track the expanded AnnotatedLlmRequest fields 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 blocks

This 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 updated

The added None fields keep these ACG module-surface tests aligned with the current AnnotatedLlmRequest shape.

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 expansion

All three AnnotatedLlmRequest literals 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 correct

Adding the new optional fields in the shared request(...) helper keeps all downstream profile tests aligned with the expanded AnnotatedLlmRequest model.

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 AnnotatedLlmRequest shape.

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 AnnotatedLlmRequest updates 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 AnnotatedLlmRequest contract.

Also applies to: 98-110, 519-531

crates/core/tests/unit/codec/request_tests.rs (1)

261-267: Good assertion update for modeled stream behavior.

Switching from extra["stream"] to req.stream correctly 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_url part round-tripping in the right places.

Also applies to: 583-620, 660-745

Comment thread crates/adaptive/src/acg_profile.rs Outdated
Comment thread crates/core/src/codec/openai_responses.rs
Comment thread crates/python/src/py_types/codecs.rs
Signed-off-by: Alex Fournier <afournier@nvidia.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Prevent silent divergence between params.max_tokens and max_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

📥 Commits

Reviewing files that changed from the base of the PR and between c9ea854 and 2e927e1.

📒 Files selected for processing (8)
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/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: Run cargo fmt --all for FFI work as it is Rust work
Run just test-rust for FFI validation
Run cargo clippy --workspace --all-targets -- -D warnings to enforce warnings-as-errors linting

When Rust files changed as part of Python work, run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting
Run cargo clippy --workspace --all-targets -- -D warnings to enforce Rust linting with no warnings
Run just test-rust as the shared-runtime build/test wrapper for Rust changes

Use Rust snake_case naming convention for Rust code

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for Rust code formatting when Node changes touch Rust files
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting when Rust files changed as part of Node work

**/*.rs: Always run just test-rust when any Rust code changes
Always run cargo fmt --all when any Rust code changes
Always run cargo clippy --workspace --all-targets -- -D warnings when any Rust code changes

Files:

  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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_END markers 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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
crates/{core,adaptive}/**

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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/core or crates/adaptive, also use validate-change

Files:

  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
crates/adaptive/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

When crates/adaptive changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

Files:

  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/python/src/py_types/codecs.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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.rs
  • crates/adaptive/src/acg_profile.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/core/src/codec/openai_responses.rs
  • crates/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.rs
  • crates/adaptive/tests/unit/acg_profile_tests.rs
  • crates/adaptive/tests/integration/runtime_integration_tests.rs
  • crates/python/tests/coverage/py_types_coverage_tests.rs
  • crates/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 follow docs/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.rs
  • crates/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.rs
  • crates/python/src/py_types/codecs.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

When crates/core changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

crates/core/**/*.rs: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.

Files:

  • crates/core/src/codec/openai_responses.rs
  • crates/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 expanded AnnotatedLlmRequest shape.

Initializing all newly added optional fields to None preserves 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::ImageUrl is 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 OpenAiImageUrl and explicitly setting new optional AnnotatedLlmRequest fields 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.url changes learning_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

@afourniernv
Copy link
Copy Markdown
Contributor Author

Addressed the CodeRabbit nits in follow-up commit 2e927e1.

  • handle object-form tool_choice {"type": "none"} in the OpenAI Responses fallback decoder
  • preserve stable multimodal signal in ACG request fingerprinting instead of dropping image-only parts
  • expose the newly modeled AnnotatedLLMRequest fields through the Python binding properties, with focused coverage

Also fixed a few stale adaptive test AnnotatedLlmRequest literals that surfaced during the focused follow-up test runs.

Focused validation run:

  • cargo test -p nemo-flow test_decode_request_accepts_anthropic_none_tool_choice_object -- --test-threads=1
  • cargo test -p nemo-flow-adaptive acg_profile_image_parts_contribute_stable_fingerprint_signal -- --test-threads=1
  • cargo test -p nemo-flow-python test_annotated_llm_types_and_builtin_codecs_cover_mutators_and_codecs -- --test-threads=1

@afourniernv afourniernv changed the title codec: expand AnnotatedLlmRequest/Response extraction for OpenAI + Anthropic + hybrid payloads feat(codec): add missing optional AnnotatedLlmRequest/Response fields May 13, 2026
@github-actions github-actions Bot added the Feature a new feature label May 13, 2026
@willkill07
Copy link
Copy Markdown
Member

/ok to test 2e927e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:rust PR changes/introduces Rust code size:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants