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
Guard bot item updates against stale reads - #49816
A bot could read an item, then bring back an old question after you had answered it. Now a bot can tell Orca to save its update only if the item has stayed the same since it read it. If the item changed, Orca refuses the update and tells the bot to read again.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$54
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$54
Prod
17
$\color{#1a7f37}{\Huge{\mathbf{+}}}$111
$\color{#cf222e}{\Huge{\mathbf{−}}}$12
$\color{#1a7f37}{\Huge{\mathbf{+}}}$99
What Changed
bot item show displays the version from the same database snapshot as the activity. bot item set --expected-version checks it before copying files and again during the save. Bot instructions show when to use the check.
Why
A second chat can still update an item after reading it. If another update arrives first, the stale request creates no activity or mail.
Linked Issue
Maintainer change tracked internally.
Visual Proof
Seeded before and after
The same development build ran the control without the version check and the updated flow with it.
Testing
Seeded Linux app and CLI exercised stale, current, and unchecked writes from a second bot chat.
Store test checks status, activity, and mail on refusal. Race replays verified the read snapshot, zero copies on early refusal, and a concurrent winner's file remaining readable.
Performance
A checked write requests host capabilities and compares versions on existing item reads. Showing an item loads its row and activity together. The host advertises the CLI capability without increasing the phone bundle size.
Risk
Level: Low. An older host refuses a checked CLI write with an update message. If an item changes during file copying, Orca refuses the update and may retain unused copies for as long as the item chat exists. Revert the PR to restore the previous behavior.
AI Disclosure
Review
Check that a refused update preserves the owner's answer and that files used by saved activity stay readable.
Agent skill upstream boundary
No upstream skill-installer source is involved.
Notes
The new flag is optional. The JSON output already includes the item version.
Checklist
Behavior, compatibility, risk, and revert documented.
No actionable comments were generated in the recent review.
Walkthrough
Bot item show now displays the item version and retrieves the item view with its event page. Bot item set accepts an optional expected version. The CLI validates the value and checks runtime capability before sending a versioned write. The runtime checks the expected version before updating and rejects stale writes. Bot guidance and command help now describe reading and supplying the version.
Merge Risk: Minimal · up to 4c39c
Bot item updates can now carry an optional version check that refuses stale writes, and item show displays the version. No concrete merge-blocking risk was found in the supplied changes. Older hosts refuse checked CLI writes, as the author describes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Guard bot item updates against stale reads" matches the main change: optional version checks via --expected-version that refuse bot item set writes when the item has changed since it was re…
Description check
The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, Checklist) …
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.
Full details: Title check
Explanation
The title "Guard bot item updates against stale reads" matches the main change: optional version checks via --expected-version that refuse bot item set writes when the item has changed since it was read. It is specific and concise, and it does not describe anything absent from the changeset.
Full details: Description check
Explanation
The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, Checklist) and explains the mechanism, the user-facing before/after, and the risk and revert path. The Risk level is filled in as Low. Gaps: the Linked Issue section says only "Maintainer change tracked internally" and has no issue reference, the Testing section does not state which automated test commands ran, the Testing checkbox for manual testing is unchecked, the Performance section does not state a measured impact, the AI Disclosure section is empty, and the Review section is not a required template field. Because the description is mostly complete, the check passes, but these items should be reviewed.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 3981ff5b-9e07-4043-a963-6a2650366ec7
Commits
Reviewing files that changed from the base of the PR and between 87d0a04 and 4c39c0f.
Files selected for processing: 1
src/shared/rpc-contract/bots-items-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 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
A bot could read an item, then bring back an old question after you had answered it. Now a bot can tell Orca to save its update only if the item has stayed the same since it read it. If the item changed, Orca refuses the update and tells the bot to read again.
What Changed
bot item showdisplays the version from the same database snapshot as the activity.bot item set --expected-versionchecks it before copying files and again during the save. Bot instructions show when to use the check.Why
A second chat can still update an item after reading it. If another update arrives first, the stale request creates no activity or mail.
Linked Issue
Maintainer change tracked internally.
Visual Proof
Seeded before and after
The same development build ran the control without the version check and the updated flow with it.
Testing
Performance
A checked write requests host capabilities and compares versions on existing item reads. Showing an item loads its row and activity together. The host advertises the CLI capability without increasing the phone bundle size.
Risk
Level: Low. An older host refuses a checked CLI write with an update message. If an item changes during file copying, Orca refuses the update and may retain unused copies for as long as the item chat exists. Revert the PR to restore the previous behavior.
AI Disclosure
Review
Check that a refused update preserves the owner's answer and that files used by saved activity stay readable.
Agent skill upstream boundary
Notes
The new flag is optional. The JSON output already includes the item version.
Checklist