Skip to content

Fix async batch retain incorrectly marked as internal#338

Merged
nicoloboschi merged 1 commit intomainfrom
fix/async-retain-usage-metering
Feb 10, 2026
Merged

Fix async batch retain incorrectly marked as internal#338
nicoloboschi merged 1 commit intomainfrom
fix/async-retain-usage-metering

Conversation

@cdbartholomew
Copy link
Contributor

Summary

  • User-initiated async retains (async=true) were incorrectly marked internal=True in _handle_batch_retain, causing operation validator extensions to treat them as system sub-operations instead of user-initiated operations

Changes

  • Set internal=False in _handle_batch_retain() since these are user-initiated operations processed asynchronously, not system-triggered sub-operations like consolidation

Test plan

  • Pre-commit hooks pass
  • E2E test in hindsight-deployment PR #148 verifies the fix

@cdbartholomew cdbartholomew force-pushed the fix/async-retain-usage-metering branch from 37c0195 to 4d214dd Compare February 10, 2026 21:12
@cdbartholomew cdbartholomew marked this pull request as draft February 10, 2026 21:17
Async batch retain tasks need internal=True to bypass extension auth
(worker has no API key), but extensions also need to know the operation
originated from a user request. The new user_initiated flag on
RequestContext allows extensions to distinguish user-initiated async
operations from truly internal system operations like consolidation.
@cdbartholomew cdbartholomew force-pushed the fix/async-retain-usage-metering branch from 4d214dd to e230b31 Compare February 10, 2026 21:31
@cdbartholomew cdbartholomew marked this pull request as ready for review February 10, 2026 21:33
@nicoloboschi nicoloboschi merged commit 90be7c6 into main Feb 10, 2026
27 of 28 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.

2 participants