Skip to content

fix(client): CodeRabbit follow-ups for the tenant port — update/uninstall race + exe-path slice#1360

Open
mikhailm-coder wants to merge 10 commits into
mainfrom
fix/client-coderabbit-followups
Open

fix(client): CodeRabbit follow-ups for the tenant port — update/uninstall race + exe-path slice#1360
mikhailm-coder wants to merge 10 commits into
mainfrom
fix/client-coderabbit-followups

Conversation

@mikhailm-coder

Copy link
Copy Markdown
Contributor

What

Fixes both CodeRabbit findings from #1359 in one PR, as agreed there (kept out of #1359 so the port stays a byte-faithful mirror of tenant).

Stacked on feat/port-tenant-client-updates (#1359); GitHub will retarget to main when that merges.

Fixes

  1. Update path now serialized with install/uninstall via the per-tool lock (tool_agent_update_listener). Previously install held the lock (blocking) and uninstall deferred on it (try_lock → leave unacked → JetStream redelivery), but updates never acquired it — an uninstall arriving mid-update could delete the tool while binaries/state were being written. The update listener now mirrors the uninstall listener exactly: try_lock before dispatching, defer via redelivery when busy. No blocking in the listener loop, so updates for other tools aren't head-of-line blocked.
  2. parse_exe_from_image_path: to_lowercase()to_ascii_lowercase() — the lowered string's byte index was used to slice the original string; non-ASCII Windows paths could yield a wrong path or panic on a char boundary. ASCII lowering keeps indices aligned (.exe matching needs only ASCII).

Note for upstream

Both issues exist identically in openframe-oss-tenant today; they should be fixed there too (or picked up when tenant consumes this lib).

Gates

  • cargo clippy --all-targets --features bin -- -D warnings
  • cargo fmt --all -- --check
  • cargo test: 82 passed; the 2 platform::directories failures are pre-existing on main (local-permissions-dependent), unrelated.

🤖 Generated with Claude Code

https://claude.ai/code/session_011z7MGH2qYeKt2ZQV88EaD8

danylo-babenko-flamingo and others added 10 commits July 4, 2026 09:12
…msh target) (#1981)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(#2030)

Co-authored-by: Danylo Babenko <danylobabenko@Danylos-MacBook-Pro.local>
- drop dead trailing assignment to reinstall_dir_cleared (unused_assignments;
  the flag is never read after the no-registry-record repair block)
- mesh self-heal: map_or(false, ..) -> is_some_and(..) (clippy::unnecessary_map_or)

Both warnings originate in code ported verbatim from openframe-oss-tenant;
this keeps the repo clippy gate (-D warnings) green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011z7MGH2qYeKt2ZQV88EaD8
1. tool_agent_update_listener: serialize updates with the per-tool lock.
   The per-tool lock introduced with remote uninstall was held by install
   (blocking) and uninstall (try_lock -> defer via redelivery), but the update
   path never acquired it, so an uninstall arriving mid-update could remove
   the tool while binaries/state were being written. The listener now try_locks
   before dispatching (same pattern as the uninstall listener) and leaves the
   message unacked for JetStream redelivery when the tool is busy.

2. system_service::parse_exe_from_image_path: use to_ascii_lowercase().
   to_lowercase() can change byte lengths for non-ASCII characters, so slicing
   the original string with an index found in the lowered string could return
   a wrong path or panic on a char boundary.

Both issues exist identically in openframe-oss-tenant and should be fixed
there too (or picked up when tenant consumes this lib).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011z7MGH2qYeKt2ZQV88EaD8
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 49dbf2a1-a168-4bb2-ab4c-65626364a991

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/client-coderabbit-followups

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.

❤️ Share

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

Base automatically changed from feat/port-tenant-client-updates to main July 4, 2026 13:29
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.

3 participants