Skip to content

Forward-merge release/0.9 into main - #1131

Merged
willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:main-merge-release/0.9
Sep 21, 2026
Merged

willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:main-merge-release/0.9

Conversation

@willkill07

@willkill07 willkill07 commented Sep 21, 2026

Copy link
Copy Markdown
Member

Overview

Manually forward-merge release/0.9 into main after the automated forward-merge PR #1129 encountered a conflict in the versioned release-notes page. This branch was created from current main and merged release/0.9 locally, preserving main's 0.10 release-note structure.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Forward-merges fix: bypass response cache for Anthropic compaction #1127 (fix: bypass response cache for Anthropic compaction) from release/0.9 into main with a merge commit.
  • Resolves the release-notes conflict by retaining the main 0.10 page; the 0.9-specific fixed-issue entry remains on the release branch.
  • Carries the response-cache implementation, unit and integration coverage, and response-cache documentation into main.

Where should the reviewer start?

Start with merge commit 4562a7b0c and its parents. The only conflict resolution is docs/about-nemo-relay/release-notes/index.mdx, intentionally retained from main; the #1127 changes are otherwise the release branch's commit.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • New Features

    • Anthropic Messages requests using server-side compaction, prior compaction blocks, or compaction beta headers now bypass response caching.
    • Compaction responses are forwarded unchanged, including native compaction events.
    • Cache bypass telemetry now identifies the reason as anthropic_compaction.
  • Documentation

    • Updated response-cache documentation to describe Anthropic compaction behavior and the new bypass reason.

mnajafian-nv and others added 2 commits September 19, 2026 00:25
#### Overview

Anthropic compaction changes both the response stream and how later requests continue a conversation. Relay's optional response cache cannot yet reproduce those semantics faithfully, so this PR keeps compaction-related requests on the live provider path while leaving ordinary Anthropic Messages requests cacheable.

It covers requests that enable compaction and follow-up requests that carry a previous compaction block.

- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.

#### Details

- Recognize compaction configured through `context_management`, the top-level `compaction` field, or an `anthropic-beta` compaction token.
- Recognize conversations that continue from an existing compaction content block.
- Treat malformed or incomplete `context_management` declarations as unsafe for caching.
- Keep ordinary Anthropic Messages requests and known non-compaction context-management edits cacheable.
- Report `anthropic_compaction` as the response-cache bypass reason.
- Add unit coverage for compaction, continuation, malformed, and non-compaction request shapes.
- Add an integration test showing that repeated compaction requests both reach the provider and forward the native `compaction_delta` stream.
- Document the cache limitation and bypass behavior.

This complements NVIDIA#1035, which preserves compaction deltas when Relay assembles a live Anthropic stream. That collector fix does not make cached replay of the stream safe.

Validation completed:

- `just test-rust`
- `just test-python`
- `just test-node`
- `just test-go`
- `just docs`
- `just docs-linkcheck`
- `uv run pre-commit run --all-files`

#### Where should the reviewer start?

Start with `anthropic_compaction_requested` in `crates/adaptive/src/response_cache/key.rs`. It contains the cache-eligibility decision. The integration test `anthropic_compaction_streams_bypass_lookup_and_storage` then shows the resulting behavior across two identical requests.

#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

- Relates to NVIDIA#1034




## Summary by CodeRabbit

* **Bug Fixes**
  * Anthropic Messages requests using server-side compaction or compaction-related beta features now bypass response caching, preserving the native compaction lifecycle.
  * Compaction events are forwarded unchanged during streaming responses.
  * Cache-bypass telemetry now reports the `anthropic_compaction` reason.

* **Documentation**
  * Updated response-cache documentation to describe compaction-related bypass behavior and observability.
  * Documented the known limitation for requests continuing from compaction blocks.

Authors:
  - Maryam Najafian (https://github.com/mnajafian-nv)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: NVIDIA#1127
@willkill07
willkill07 requested review from a team as code owners September 21, 2026 16:46
@github-actions github-actions Bot added size:M PR is medium Maintenance CI or Build or general repository maintenance lang:rust PR changes/introduces Rust code labels Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 3501919d-b067-4dd5-9347-cea504be95c0

📥 Commits

Reviewing files that changed from the base of the PR and between 0be6ecf and 4562a7b.

📒 Files selected for processing (6)
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • docs/configure-plugins/adaptive/response-cache.mdx

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (44)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Python / Package (windows-amd64)
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Python / Package (linux-musl-amd64)
  • GitHub Check: Node.js / Package (linux-musl-arm64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Python / Package (windows-arm64)
  • GitHub Check: Python / Package (linux-arm64)
  • GitHub Check: Python / Package (linux-musl-arm64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Python / Package (macos-arm64)
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Python / Package (linux-amd64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Go / Test (linux-amd64)
  • GitHub Check: Python / Test (macos-arm64)
  • GitHub Check: Python / Test (windows-amd64)
  • GitHub Check: Node.js / Package (windows-arm64)
  • GitHub Check: Node.js / Package (linux-musl-amd64)
  • GitHub Check: Python / Test (windows-arm64)
  • GitHub Check: Python / Test (linux-amd64)
  • GitHub Check: Python / Test (linux-arm64)
  • GitHub Check: Go / Test (windows-arm64)
  • GitHub Check: Node.js / Package (macos-arm64)
  • GitHub Check: Node.js / Test (linux-arm64)
  • GitHub Check: Go / Test (linux-arm64)
  • GitHub Check: Go / Test (windows-amd64)
  • GitHub Check: Node.js / Test (windows-amd64)
  • GitHub Check: Node.js / Package (linux-arm64)
  • GitHub Check: Node.js / Package (windows-amd64)
  • GitHub Check: Node.js / Package (linux-amd64)
  • GitHub Check: Node.js / Test (macos-arm64)
  • GitHub Check: Go / Test (macos-arm64)
  • GitHub Check: Node.js / Test (linux-amd64)
  • GitHub Check: Node.js / Test (windows-arm64)
  • GitHub Check: Node.js / Package OpenClaw plugin
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (7)
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

⚙️ CodeRabbit configuration file

Files:

  • docs/configure-plugins/adaptive/response-cache.mdx
Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

⚙️ CodeRabbit configuration file

Files:

  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.

⚙️ CodeRabbit configuration file

Files:

  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/configure-plugins/adaptive/response-cache.mdx
Run `just docs` when the docs site changed; `./scripts/build-docs.sh html` remains the compatibility wrapper

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/configure-plugins/adaptive/response-cache.mdx
`crates/adaptive`

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Files:

  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
Verify MDX files use JSX delimiters for top-of-file SPDX comments.

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/configure-plugins/adaptive/response-cache.mdx
🔇 Additional comments (7)
crates/adaptive/src/response_cache/mark.rs (1)

44-45: LGTM!

Also applies to: 77-77

crates/adaptive/src/response_cache/key.rs (1)

124-126: LGTM!

Also applies to: 139-202

crates/adaptive/tests/unit/response_cache/key_tests.rs (1)

447-517: LGTM!

Also applies to: 519-570

crates/adaptive/tests/unit/response_cache/mark_tests.rs (1)

33-36: LGTM!

crates/adaptive/tests/integration/response_cache_tests.rs (1)

1376-1388: LGTM!

Also applies to: 1826-1891

docs/configure-plugins/adaptive/response-cache.mdx (2)

484-486: LGTM!


304-307: 📐 Maintainability & Code Quality

The documentation guideline requires just docs when the docs site changes, but the supplied evidence does not show that the command was skipped or failed. Missing validation output alone does not establish a violation.


Walkthrough

Anthropic compaction requests now bypass response caching. The change adds a dedicated bypass reason, preserves native compaction stream events, adds unit and integration coverage, and updates response-cache documentation.

Changes

Anthropic compaction cache behavior

Layer / File(s) Summary
Compaction detection and bypass reason
crates/adaptive/src/response_cache/key.rs, crates/adaptive/src/response_cache/mark.rs
Detects compaction edits, fields, headers, content blocks, and malformed context-management data. Returns AnthropicCompaction and serializes it as anthropic_compaction.
Compaction execution and coverage
crates/adaptive/tests/unit/response_cache/*, crates/adaptive/tests/integration/response_cache_tests.rs, docs/configure-plugins/adaptive/response-cache.mdx
Verifies cache bypass boundaries, live provider execution, bypass marks, and forwarding of compaction_delta events. Documents the new bypass behavior and telemetry reason.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ResponseCache
  participant AnthropicProvider
  participant ResponseStream
  Client->>ResponseCache: send compaction-enabled request
  ResponseCache->>AnthropicProvider: execute request without cache lookup or storage
  AnthropicProvider->>ResponseStream: emit compaction_delta
  ResponseCache->>Client: forward compaction_delta and anthropic_compaction mark
Loading

Possibly related PRs


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Title check ❌ Error The title describes the forward merge, but it does not follow Conventional Commits format. It lacks an allowed lowercase type and uses a non-compliant summary format. Change the title to an allowed Conventional Commits format, such as chore: forward-merge release/0.9 into main. Keep the title under 72 characters and omit the trailing period.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 81.25% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (1 skipped: 1 …
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.
Description check ✅ Passed The description includes all required sections, confirms the contribution and duplicate-work checks, identifies the merge and conflict resolution, provides a review starting point, and relates the cha…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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

@willkill07 willkill07 changed the title chore: forward-merge release/0.9 into main Forward-merge release/0.9 into main Sep 21, 2026
@github-actions github-actions Bot removed the Maintenance CI or Build or general repository maintenance label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

@willkill07

Copy link
Copy Markdown
Member Author

/merge nosquash

@rapids-bot

rapids-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

Could not determine original ForwardMerger PR from branch name. The branch name should follow the pattern <target_branch>-merge-<source_branch> (e.g., branch-25.06-merge-branch-25.04 or main-merge-release/25.06). Please contact @rapidsdevops on Slack for assistance.

@willkill07
willkill07 merged commit 2f7e229 into NVIDIA:main Sep 21, 2026
162 of 174 checks passed
@willkill07
willkill07 deleted the main-merge-release/0.9 branch September 21, 2026 19:06

This branch was successfully deployed

1 active deployment
fern 4562a7b0 Deployed Sep 21, 2026 by willkill07 via Clean up docs preview #4974
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants