You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retain item attachments when storage is unavailable - #49402
When Orca temporarily cannot read the saved item data, it now keeps screenshot files instead of deleting them. Once the saved data is available again, normal cleanup resumes.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$92
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$92
Prod
6
$\color{#1a7f37}{\Huge{\mathbf{+}}}$76
$\color{#cf222e}{\Huge{\mathbf{−}}}$19
$\color{#1a7f37}{\Huge{\mathbf{+}}}$57
What Changed
Represent an unavailable item store as unknown retention data and have attachment cleanup preserve uploads in that state. An opened store with no pending item mail still permits normal cleanup.
Why
A temporary startup storage failure previously looked like an empty list of retained uploads, so a screenshot accepted for delivery could be removed before its recipient claimed it.
Linked Issue
Tracked in STA-18518.
Visual Proof
Example result
Testing
Added coverage for unopened, failed, empty, and recovered item-store retention reads, plus attachment sweeping behavior.
TC_GATE_POOL=test tc-gate node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/native-chat/agent-session-attachments/agent-session-attachment-sweep.test.ts src/main/bots/bot-items-runtime.test.ts
tc-gate pnpm tc:node
I manually tested these changes locally
Automated tests added/updated
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because this adds no repeated work and skips deletion only while the required retention data cannot be read.
Risk
Level: Low
The riskiest path is temporary item-store unavailability; affected uploads are retained longer rather than deleted. This does not alter attachments on remote hosts or user settings, and a plain revert restores the prior cleanup behavior.
AI Disclosure
N/A
Review
Pending.
Agent skill upstream boundary
Not applicable.
Notes
Security, cross-platform behavior, remote hosts, mobile, backwards compatibility, and performance were considered; no new platform-specific paths or external effects are introduced.
Checklist
This PR is small and focused
I explained what changed and why
I stated the risk and rollback
Screenshot included
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path impact considered
Targeted tests and node typecheck pass; final checks pending
No actionable comments were generated in the recent review.
Walkthrough
The item-store lookup now distinguishes an absent store from a store that cannot be read. The attachment sweep receives nullable retention results. It keeps old uploads when the result is null, and it can remove unlisted uploads when the result is an empty set and markForSweep succeeds.
Merge Risk: Minimal · up to d8081
Attachments are now kept when item storage cannot be read, and normal cleanup resumes once the data is readable again. No remaining defect was found. The cost is that affected uploads are retained longer during temporary storage unavailability, which the PR intends.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Retain item attachments when storage is unavailable" matches the main change. The PR makes attachment cleanup keep uploads when item-store retention data cannot be read, instead of treating…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template and fills in every required section: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk (level Low), AI Disclosure, Review,…
Full details: Title check
Explanation
The title "Retain item attachments when storage is unavailable" matches the main change. The PR makes attachment cleanup keep uploads when item-store retention data cannot be read, instead of treating the failure as an empty retained set. The title is short, specific, and describes the behavior change.
Full details: Description check
Explanation
The description follows the repository template and fills in every required section: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk (level Low), AI Disclosure, Review, upstream boundary, Notes, and Checklist. It explains the mechanism (an unavailable item store is treated as unknown retention data, and cleanup skips deletion in that state) and the reason (a temporary startup storage failure could make a pending screenshot look unclaimed and get deleted). It names the targeted test command and a rollback path. Gaps: the Linked Issue section cites only 'Tracked in STA-18518' and not a 'Fixes #' issue link, which the template asks for; Manual testing is unchecked; the Testing section does not state which platforms were tested; the Visual Proof is a single screenshot of an 'Orca remains usable' result rather than a before/after pair as the template requests; and the Review section says 'Pending.' The overall description is mostly complete, so the check passes, but the author should address the issue link and the before/after visual proof.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca temporarily cannot read the saved item data, it now keeps screenshot files instead of deleting them. Once the saved data is available again, normal cleanup resumes.
What Changed
Represent an unavailable item store as unknown retention data and have attachment cleanup preserve uploads in that state. An opened store with no pending item mail still permits normal cleanup.
Why
A temporary startup storage failure previously looked like an empty list of retained uploads, so a screenshot accepted for delivery could be removed before its recipient claimed it.
Linked Issue
Tracked in STA-18518.
Visual Proof
Example result
Testing
Added coverage for unopened, failed, empty, and recovered item-store retention reads, plus attachment sweeping behavior.
TC_GATE_POOL=test tc-gate node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/native-chat/agent-session-attachments/agent-session-attachment-sweep.test.ts src/main/bots/bot-items-runtime.test.tstc-gate pnpm tc:nodeI manually tested these changes locally
Automated tests added/updated
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because this adds no repeated work and skips deletion only while the required retention data cannot be read.
Risk
Level: Low
The riskiest path is temporary item-store unavailability; affected uploads are retained longer rather than deleted. This does not alter attachments on remote hosts or user settings, and a plain revert restores the prior cleanup behavior.
AI Disclosure
N/A
Review
Pending.
Agent skill upstream boundary
Notes
Security, cross-platform behavior, remote hosts, mobile, backwards compatibility, and performance were considered; no new platform-specific paths or external effects are introduced.
Checklist