Skip to content

fix: noop provider check handles ResilientProvider wrapper (#1020)#1040

Open
ziishanahmad wants to merge 1 commit into
rohitg00:mainfrom
ziishanahmad:fix/1020-noop-provider-naming
Open

fix: noop provider check handles ResilientProvider wrapper (#1020)#1040
ziishanahmad wants to merge 1 commit into
rohitg00:mainfrom
ziishanahmad:fix/1020-noop-provider-naming

Conversation

@ziishanahmad

@ziishanahmad ziishanahmad commented Jul 9, 2026

Copy link
Copy Markdown

Problem

In zero-LLM mode (no API key configured), mem::summarize is supposed to short-circuit via provider.name === "noop". But every provider is wrapped in ResilientProvider before reaching the summarize function, and ResilientProvider renames it to "resilient(noop)" in its constructor. The literal string "noop" never matches, so the clean no-op skip is unreachable dead code.

Zero-LLM installs get misleading empty_provider_response / too_many_chunks_skipped errors instead of the intended no_provider skip, and failure counters climb into the hundreds.

Fix

Check both the unwrapped and wrapped names:

if (provider.name === "noop" || provider.name === "resilient(noop)") {

One-line fix in src/functions/summarize.ts. No new dependencies, no API changes.

Closes #1020

Summary by CodeRabbit

  • Bug Fixes
    • Improved summarization behavior when no AI provider is configured, including an additional fallback case.
    • Prevents the app from attempting summarization in more no-provider scenarios, making the experience more reliable.

…1020)

ResilientProvider renames 'noop' to 'resilient(noop)' in its
constructor, so provider.name === 'noop' in mem::summarize never
matched. Zero-LLM installs got misleading parse failures instead
of a clean no-op skip.

Now checks both 'noop' and 'resilient(noop)'.
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@ziishanahmad is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The no-provider early-return check in the mem::summarize handler is broadened to also match the ResilientProvider-wrapped provider name "resilient(noop)", in addition to the existing "noop" check, so the clean skip path fires correctly.

Changes

Summarize No-Op Detection Fix

Layer / File(s) Summary
Broaden no-provider check
src/functions/summarize.ts
Early-return condition for missing LLM provider now matches both "noop" and "resilient(noop)" provider names.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the noop-provider fix and its ResilientProvider wrapper.
Linked Issues check ✅ Passed The change matches #1020 by treating both noop and resilient(noop) as the no-provider case.
Out of Scope Changes check ✅ Passed The PR appears scoped to the single summarize short-circuit fix with no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/functions/summarize.ts (1)

263-263: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a more robust noop-detection pattern.

The hardcoded "resilient(noop)" string is tightly coupled to ResilientProvider's naming convention (resilient(${inner.name})). If the wrapper format changes or additional wrapping layers are introduced, this check breaks silently and the bug recurs.

A slightly more resilient alternative:

♻️ Optional refactor
-      if (provider.name === "noop" || provider.name === "resilient(noop)") {
+      if (provider.name === "noop" || provider.name.endsWith("(noop)")) {

This keeps the fix minimal while being robust against future wrapper naming changes. As per coding guidelines, clear naming should be preferred — consider a dedicated isNoopProvider(provider) helper if this check appears elsewhere.

🤖 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 `@src/functions/summarize.ts` at line 263, The noop check in summarize handling
is still coupled to the exact ResilientProvider wrapper name, so it can fail if
the wrapper format changes. Update the provider detection around the summarize
logic to use a more robust helper or predicate, ideally an
isNoopProvider(provider) function that inspects the underlying provider rather
than matching "resilient(noop)". Keep the existing noop case for provider.name
=== "noop", but remove the hardcoded wrapper string from the check and reuse the
helper wherever this condition appears.
🤖 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.

Nitpick comments:
In `@src/functions/summarize.ts`:
- Line 263: The noop check in summarize handling is still coupled to the exact
ResilientProvider wrapper name, so it can fail if the wrapper format changes.
Update the provider detection around the summarize logic to use a more robust
helper or predicate, ideally an isNoopProvider(provider) function that inspects
the underlying provider rather than matching "resilient(noop)". Keep the
existing noop case for provider.name === "noop", but remove the hardcoded
wrapper string from the check and reuse the helper wherever this condition
appears.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43082355-56f0-43cb-910e-bd5019c7728e

📥 Commits

Reviewing files that changed from the base of the PR and between 93ae9bc and 798b93a.

📒 Files selected for processing (1)
  • src/functions/summarize.ts

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

Labels

None yet

Projects

None yet

1 participant