Repository navigation
fix(mcp): replace deprecated fetch_update with a compare-exchange loop - #16
Merged
Merged
Conversation
Rust 1.99 deprecates AtomicU64::fetch_update in favour of try_update. The Windows cargo check builds with -D warnings, so every PR now fails there. try_update needs a newer compiler than our rust-version (1.85), so charge_egress now does the same compare-exchange loop fetch_update did: the check-and-add stays one atomic step, an overflowing or over-cap charge is refused, and a refused charge leaves the counter untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cdrake
force-pushed
the
fix/allow-deprecated-fetch-update
branch
from
October 13, 2026 20:07
5ec6f9c to
8e6f956
Compare
This was referenced Oct 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The Windows cargo check (warnings gate) job builds with
RUSTFLAGS=-D warningson the latest stable Rust. Rust 1.99 deprecatesAtomicU64::fetch_update(renamedtry_update), socharge_egressinsrc-tauri/src/ai/mcp/server.rsnow fails that job.mainlast ran CI on 2026-07-15, before that release, so any PR opened now fails, e.g. #11.Fix
charge_egressnow uses a plaincompare_exchange_weakloop, which is whatfetch_updatedoes internally. There is no deprecated call and no#[allow]. Behavior is unchanged:We didn't switch to
try_updatebecause it doesn't exist in Rust 1.85 (rust-versioninCargo.toml).Side note, not changed here: Rust 1.85 can't build the crate anyway.
darling0.23 needs 1.88, and theicu_*2.2 crates need 1.86. Sorust-versionis already behind the real minimum, and could be raised separately.Test
RUSTFLAGS="-D warnings" cargo +stable check --lib(rustc 1.99.0): fails onmain, passes here.cargo test --lib egress: 3 pass, includingegress_cap_refuses_once_session_budget_exhausted.cargo fmt --checkis clean.Once this merges, #11 (and the rest of the NeuroFlow stack #12–#15) rebase onto it.
🤖 Generated with Claude Code