Skip to content

Fix --rga-no-cache flag causing "No cache?" error instead of disabling cache#338

Merged
phiresky merged 2 commits intomasterfrom
claude/investigate-issue-337-xFZ5o
Mar 25, 2026
Merged

Fix --rga-no-cache flag causing "No cache?" error instead of disabling cache#338
phiresky merged 2 commits intomasterfrom
claude/investigate-issue-337-xFZ5o

Conversation

@phiresky
Copy link
Copy Markdown
Owner

When cache is disabled (via --rga-no-cache) or the file is not a real file,
adapt_caching() set cache to None but then immediately called
cache.context("No cache?")? which unconditionally errored on the None value.

This is a regression introduced in cde0e20 ("partial move to async", Oct 2022).
The pre-async code in dfc10cb correctly used:
if let Some(mut cache) = cache { /* cached path / } else { / no-cache path */ }
The async rewrite replaced this with:
let mut cache = cache.context("No cache?")?;
dropping the else branch that ran the adapter without caching.

Fix by matching on the Option: when cache is Some, use the existing
read/write-through-cache path; when None, run the adapter directly without
any caching via loop_adapt() + concat_read_streams().

Fixes #337

https://claude.ai/code/session_014Yhbd16V3ekdKsdBtgt8Lq

claude added 2 commits March 25, 2026 14:50
…g cache

When cache is disabled (via --rga-no-cache) or the file is not a real file,
adapt_caching() set cache to None but then immediately called
cache.context("No cache?")? which unconditionally errored on the None value.

This is a regression introduced in cde0e20 ("partial move to async", Oct 2022).
The pre-async code in dfc10cb correctly used:
  if let Some(mut cache) = cache { /* cached path */ } else { /* no-cache path */ }
The async rewrite replaced this with:
  let mut cache = cache.context("No cache?")?;
dropping the else branch that ran the adapter without caching.

Fix by matching on the Option: when cache is Some, use the existing
read/write-through-cache path; when None, run the adapter directly without
any caching via loop_adapt() + concat_read_streams().

Fixes #337

https://claude.ai/code/session_014Yhbd16V3ekdKsdBtgt8Lq
…g cache

When cache is disabled (via --rga-no-cache) or the file is not a real file,
adapt_caching() set cache to None but then immediately called
cache.context("No cache?")? which unconditionally errored on the None value.

This is a regression introduced in cde0e20 ("partial move to async", Oct 2022).
The pre-async code in dfc10cb correctly used:
  if let Some(mut cache) = cache { /* cached path */ } else { /* no-cache path */ }
The async rewrite replaced this with:
  let mut cache = cache.context("No cache?")?;
dropping the else branch that ran the adapter without caching.

Fix by early-returning from the else branch: when cache is disabled, run the
adapter directly via loop_adapt() + concat_read_streams() without caching.
The cached code path is unchanged.

Note: adapt_caching() is only called from rga_preproc() for the top-level
file. Recursive files inside archives go through loop_adapt() directly, so
in practice only --rga-no-cache triggers the None/disabled path.

Fixes #337

https://claude.ai/code/session_014Yhbd16V3ekdKsdBtgt8Lq
@phiresky phiresky force-pushed the claude/investigate-issue-337-xFZ5o branch from 0b8fd73 to a52b40d Compare March 25, 2026 14:57
@phiresky phiresky merged commit 0f10fb9 into master Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--rga-no-cache breaks preprocessing with No cache? instead of disabling cache

2 participants