Skip to content

fix(claude): honor Desktop native model opt-out - #1363

Merged
Wibias merged 1 commit into
lidge-jun:devfrom
luvs01:agent/fix-claude-desktop-native-optout
Aug 10, 2026
Merged

fix(claude): honor Desktop native model opt-out#1363
Wibias merged 1 commit into
lidge-jun:devfrom
luvs01:agent/fix-claude-desktop-native-optout

Conversation

@luvs01

@luvs01 luvs01 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make the native-integration Claude Desktop enable route use the same Desktop-specific native model visibility helper as the CLI, apply route, model list, and profile renderer.
  • Preserve the existing default behavior while honoring an explicit claudeCode.desktopNativeModels: false opt-out.
  • Add a focused regression that verifies the Desktop writer receives no native slugs after the persisted opt-out is reloaded.

Previously this one route used the generic native model list, so enabling Claude Desktop could re-add native entries that the user had explicitly disabled for Desktop.

Verification

  • bun test tests/native-claude-desktop-toggle.test.ts — 10 passed, 0 failed on Bun 1.3.14.
  • bun run typecheck
  • bun run privacy:scan
  • git diff --check
  • Independent final diff review found no actionable P0–P3 findings.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were not needed because this restores the existing Desktop opt-out contract.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes

    • Claude Desktop enablement now respects the setting that disables native models.
    • Only native integrations available for desktop are included during configuration.
  • Tests

    • Added coverage to verify successful Claude Desktop activation without native model configuration when opted out.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 01966d50-25fe-4532-8fe2-3d5fa3df2f0d

📥 Commits

Reviewing files that changed from the base of the PR and between d517161 and 03465c6.

📒 Files selected for processing (2)
  • src/server/management/native-integration-routes.ts
  • tests/native-claude-desktop-toggle.test.ts

📝 Walkthrough

Walkthrough

Claude Desktop configuration now receives desktop-specific visible native slugs. A regression test verifies that disabling native models produces an empty slug list while enablement succeeds.

Changes

Claude Desktop native model filtering

Layer / File(s) Summary
Desktop model selection
src/server/management/native-integration-routes.ts
The Claude Desktop route imports desktopVisibleNativeSlugs and passes it to configuration generation at line 659.
Opt-out regression coverage
tests/native-claude-desktop-toggle.test.ts
The test verifies successful enablement with desktopNativeModels: false, no discovered models, and an empty native-slug list passed to the configuration writer.

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

Possibly related PRs

Suggested reviewers: lidge-jun, ingwannu, wibias

🚥 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: honoring the Claude Desktop native model opt-out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

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

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently. If no CodeRabbit review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Please rebase this PR onto the latest dev (e8ce2b93dd3ef8074d96dee407704c5dc06e2699) before merge, then rerun the exact-head CI checks.

@luvs01
luvs01 force-pushed the agent/fix-claude-desktop-native-optout branch from 983088d to 03465c6 Compare August 9, 2026 23:25
@Wibias
Wibias marked this pull request as ready for review August 9, 2026 23:45
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_dev="e8ce2b93dd3ef8074d96dee407704c5dc06e2699"
head="$(git rev-parse HEAD)"

printf 'HEAD=%s\n' "$head"
printf 'EXPECTED_DEV=%s\n' "$expected_dev"

if git cat-file -e "${expected_dev}^{commit}" 2>/dev/null; then
  if git merge-base --is-ancestor "$expected_dev" HEAD; then
    echo "EXPECTED_DEV_IS_ANCESTOR=true"
  else
    echo "EXPECTED_DEV_IS_ANCESTOR=false"
  fi
else
  echo "EXPECTED_DEV_AVAILABLE=false"
fi

printf '\nChanged files against first parent:\n'
git diff --stat HEAD^ HEAD
git diff --name-status HEAD^ HEAD

printf '\nSource outlines:\n'
ast-grep outline src/server/management/native-integration-routes.ts --items all 2>/dev/null || true
ast-grep outline tests/native-claude-desktop-toggle.test.ts --items all 2>/dev/null || true

printf '\nChanged hunks:\n'
git diff --unified=40 HEAD^ HEAD -- \
  src/server/management/native-integration-routes.ts \
  tests/native-claude-desktop-toggle.test.ts

Length of output: 17574


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' 'Catalog helper definitions and call sites:'
rg -n -A18 -B8 --type ts \
  '\bdesktopVisibleNativeSlugs\b|\bvisibleNativeSlugs\b' \
  src tests

printf '%s\n' 'Test helper implementations:'
ast-grep outline tests/native-claude-desktop-toggle.test.ts --items all --type function
sed -n '1,70p' tests/native-claude-desktop-toggle.test.ts

printf '%s\n' 'Claude Desktop toggle implementation:'
sed -n '600,675p' src/server/management/native-integration-routes.ts

printf '%s\n' 'Catalog export implementation candidates:'
fd -t f -e ts . src/codex | while IFS= read -r file; do
  if rg -q '\bdesktopVisibleNativeSlugs\b' "$file"; then
    echo "--- $file"
    rg -n -A24 -B12 '\bdesktopVisibleNativeSlugs\b' "$file"
  fi
done

Length of output: 106107


@github-actions[bot] I verified the PR head.

  • Commit 03465c64490f98e06c54f6d0ca2808323e67d3c1 descends from required dev commit e8ce2b93dd3ef8074d96dee407704c5dc06e2699.
  • src/server/management/native-integration-routes.ts now uses desktopVisibleNativeSlugs(latest) after it reloads persisted configuration.
  • desktopVisibleNativeSlugs() preserves the default native-model list and returns an empty list when claudeCode.desktopNativeModels is false.
  • tests/native-claude-desktop-toggle.test.ts persists that opt-out and verifies that writeDesktop3pConfig receives no native slugs.

I found no issue in the reviewed change.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="lidge-jun/opencodex"
pr_number="1363"
required_dev_sha="e8ce2b93dd3ef8074d96dee407704c5dc06e2699"

echo "== PR metadata =="
gh pr view "$pr_number" --repo "$repo" \
  --json number,url,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,mergeable,mergeStateStatus,statusCheckRollup \
  --jq '{
    number, url, state, isDraft, headRefName, headRefOid, baseRefName, baseRefOid,
    mergeable, mergeStateStatus,
    checks: [.statusCheckRollup[] | {name, status, conclusion, detailsUrl}]
  }'

head_sha="$(gh pr view "$pr_number" --repo "$repo" --json headRefOid --jq '.headRefOid')"

echo
echo "== Required dev commit ancestry =="
gh api "repos/$repo/compare/$required_dev_sha...$head_sha" \
  --jq '{status, ahead_by, behind_by, merge_base_commit: .merge_base_commit.sha}'

echo
echo "== Exact-head check runs =="
gh api --paginate "repos/$repo/commits/$head_sha/check-runs?per_page=100" \
  --jq '.check_runs[] | {name, status, conclusion, details_url}'

Length of output: 12549


@github-actions[bot] The rebase requirement is satisfied. PR #1363 is based on e8ce2b93dd3ef8074d96dee407704c5dc06e2699, with 0 commits behind it.

The exact-head CI requirement is not complete yet. The test 3/4 check for head 03465c64490f98e06c54f6d0ca2808323e67d3c1 is still in_progress. GitHub reports the PR merge state as UNSTABLE.

Wait for test 3/4 to complete successfully, then rerun the readiness check.

You are interacting with an AI system.

@Wibias
Wibias merged commit 220cedd into lidge-jun:dev Aug 10, 2026
62 of 69 checks passed

Wibias commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks @luvs01 — good catch and a clean fix. Reusing the Desktop-specific visibility helper keeps the native-model opt-out consistent across the integration surfaces, with a focused regression to lock it in. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants