Skip to content

fix: replace deprecated fetch_update with CAS loop - #183

Merged
senamakel merged 1 commit into
mainfrom
fix-fetch-update-deprecation
Oct 1, 2026
Merged

senamakel merged 1 commit into
mainfrom
fix-fetch-update-deprecation

Conversation

@senamakel

@senamakel senamakel commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Newest stable deprecates AtomicUsize::fetch_update (renamed try_update), failing the release workflow's clippy step at src/memory/persona/distill.rs. Replaced with a compare_exchange_weak loop, which stays MSRV-compatible. No other fetch_update uses.

Verified: clippy --all-targets --all-features -D warnings on 1.99.0 and 1.98.0; distill tests pass (12).

Summary by CodeRabbit

  • Refactor
    • Updated how shared call budgets are reserved; reservation behavior remains unchanged.

…dget

The `try_acquire` method on `CallBudget` now uses a manual compare-and-swap loop instead of `fetch_update`, which has been deprecated on the latest stable Rust toolchain. The replacement avoids `try_update` as well, since that API is not available in the project's minimum supported Rust version.

Auto-committed-on: dragonfly
@tinysweeper

tinysweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Incomplete
Priority: none
Reviewed head: e19b560b3014
Updated: 1790883708 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 0 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 5

Completeness: Incomplete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

  • Unreviewed: tinysweeper/tests

Findings

No active actionable findings.

Could not review: src/memory/persona/distill.rs, tinysweeper/description, tinysweeper/e2e, tinysweeper/tests

Before merge

  • Complete the critique review for src/memory/persona/distill.rs.
  • Complete the security review for src/memory/persona/distill.rs.
  • Complete the tests review for tinysweeper/tests.
  • Complete the description review for tinysweeper/description.
  • Complete the e2e review for tinysweeper/e2e.

How this fits together

flowchart LR
  n0["CallBudget<br/>changed"]:::changed
  n1["digest_session"]:::impacted
  n2["unlimited"]:::impacted
  n3["digest_window"]:::impacted
  n4["digest_window_recovering"]:::impacted
  n5["windows"]:::impacted
  n6["new"]:::impacted
  n1 -->|uses| n0
  n1 -->|calls| n4
  n1 -->|calls| n5
  n1 -->|calls| n6
  n1 -->|uses| n6
  n2 -->|calls| n6
  n3 -->|uses| n0
  n4 -->|uses| n0
  n4 -->|calls| n3
  n4 -->|calls| n6
  n5 -->|calls| n6
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: src/memory/persona/distill.rs
  • Lane summary: Reviewed 0 files; 0 findings. 1 file could not be reviewed: src/memory/persona/distill.rs.

security

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: src/memory/persona/distill.rs
  • Lane summary: Reviewed 0 files; 0 findings. 1 file could not be reviewed: src/memory/persona/distill.rs.

tests

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: tinysweeper/tests
  • Lane summary: No reviewer could be consulted.

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: tinysweeper/description
  • Lane summary: No reviewer could be consulted.

e2e

  • Conclusion: Success
  • Scope reviewed: incomplete; unanswered: tinysweeper/e2e
  • Lane summary: No reviewer could be consulted; only the job states below are reported. _The code index is behind this pull request (indexed at `102934d3bfa3`), so retrieved context may be out of date._ _5 memory call(s) failed (model: cortex: v1/recall: timed out after 10s), so this review saw part of what the engine holds._
Evidence and run details
  • Models: ladder/vectors
  • Spend: $0.000001
  • Tokens: 0 input · 0 output · 0 cached · 82 embedding
Head State Pass summary
e19b560b3014 incomplete 0 active finding(s), 0 resolved finding(s) (at 1790883708)

tinysweeper 0.1.0

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T19:42:37.600644Z e19b560 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5899dc75-4ab6-4890-8583-bd4e07647012

📥 Commits

Reviewing files that changed from the base of the PR and between cdc07b8 and e19b560.

📒 Files selected for processing (1)
  • src/memory/persona/distill.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

CallBudget::try_acquire replaces fetch_update with a sequentially consistent compare-and-exchange loop. Its reservation behavior remains unchanged.

Changes

Call budget

Layer / File(s) Summary
Call reservation loop
src/memory/persona/distill.rs
CallBudget::try_acquire returns false when the counter is zero, decrements the counter after a successful exchange, and retries after contention.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e19b5

Call reservations remain bounded, and exhausted budgets still prevent provider calls. No concrete merge-blocking risk is evident.

🚥 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 main change: replacing the deprecated fetch_update implementation with a CAS loop.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks the counter’s pace
One call steps down and claims its place
If others race, it tries once more
At zero, it waits beside the door
Then nibbles clover, calm and sure

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

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking, but could not review everything, so this is not an approval: src/memory/persona/distill.rs, tinysweeper/description, tinysweeper/e2e, tinysweeper/tests.

$0.0000 · 0 in / 0 out · 82 embedded · ladder/vectors

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 1, 2026
@senamakel
senamakel merged commit b357853 into main Oct 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant