Skip to content

[WRONG BRANCH] fix(claude): avoid blocking registry probes by async probe + cache - #381

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-synchronous-policy-probe-issue
Draft

[WRONG BRANCH] fix(claude): avoid blocking registry probes by async probe + cache#381
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-synchronous-policy-probe-issue

Conversation

@luvs01

@luvs01 luvs01 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the /api/claude-desktop/status handler from synchronously spawning reg.exe on every request and blocking the server event loop on Windows.
  • Bound and coalesce registry checks so repeated GUI polling or a malicious local client cannot starve other proxy traffic.

Description

  • Add a non-blocking probe probeClaudeDesktopPolicyAsync (uses execFile) that preserves the same timeout, decoding, and probe semantics as the synchronous runner.
  • Implement a cache/coalescing helper createCachedClaudeDesktopPolicyProbe and getCachedClaudeDesktopPolicy with a 30s TTL to limit registry refreshes and single-flight concurrent refreshes.
  • Update the management route at GET /api/claude-desktop/status to await the cached asynchronous probe in production while keeping the existing dependency seam (deps.probeClaudeDesktopPolicy) for tests.
  • Add unit tests that assert the async probe does not synchronously settle and that concurrent status requests coalesce and reuse a cached result.

Testing

  • Ran bun test tests/claude-desktop-policy.test.ts and all tests passed (7/7).
  • Ran bun run typecheck and the typecheck passed.
  • Ran bun run privacy:scan and the privacy scan passed.
  • Ran parts of the full suite (bun run test); the focused tests for this change passed, while unrelated full-suite failures/timeouts were observed and are unrelated to this change.

Codex Task

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b0e07ec7-5a76-4fa0-9d87-67b515fad8b9


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 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-08-31T00:50:43.701677Z 0798f4e 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.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 31, 2026
@github-actions

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request is being kept as a draft automatically. Once every issue above is resolved, it will be marked ready for review again.

@github-actions github-actions Bot changed the title fix(claude): avoid blocking registry probes by async probe + cache [WRONG BRANCH] fix(claude): avoid blocking registry probes by async probe + cache Aug 31, 2026
@github-actions
github-actions Bot marked this pull request as draft August 31, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant