fix(desktop): remove expired Xiaomi activity support#472
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR removes the TouchAI Hub managed authentication system, Tauri deep-link plugin integration, and MiMo gateway/signing logic across the desktop app. It simplifies the MiMo provider to direct API endpoint configuration, migrates existing database rows away from legacy managed-auth fields, flattens the AI services settings UI, and adds a new WiX MSI installer template for Windows packaging. ChangesManaged Auth and Hub Integration Removal
WiX MSI Installer Addition
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/desktop/tests/views/SettingsView/settingsAiServicesLayout.test.ts`:
- Line 1: The file begins with a UTF-8 BOM (Byte Order Mark) character which is
unnecessary and can cause issues with some tools. Remove the BOM character from
the very beginning of the file, before the import statement that imports
flushPromises and mount from '`@vue/test-utils`'.
- Line 116: Replace all instances of the corrupted Chinese text '鐏北寮曟搸' with the
correct provider name '火山引擎' (Volcengine) in the test fixture. The corrupted
text appears in the provider name fields within the test data structure and
should be corrected to match the actual provider name defined in seed.sql.
Update both occurrences of this corrupted text to ensure the test fixture
contains valid and correct Chinese characters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 105a9619-dd41-4e61-a062-a4b6c0c21c05
⛔ Files ignored due to path filters (4)
apps/desktop/src-tauri/Cargo.lockis excluded by!**/*.lockdocs/images/touchai-mimo.en.pngis excluded by!**/*.pngdocs/images/touchai-mimo.pngis excluded by!**/*.pngpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (43)
README.en.mdREADME.mdapps/desktop/CHANGELOG.mdapps/desktop/package.jsonapps/desktop/src-tauri/Cargo.tomlapps/desktop/src-tauri/capabilities/default.jsonapps/desktop/src-tauri/src/lib.rsapps/desktop/src-tauri/tauri.conf.jsonapps/desktop/src/bootstrap.tsapps/desktop/src/database/artifacts/runtime/seed.sqlapps/desktop/src/database/queries/providers.tsapps/desktop/src/i18n/messages.tsapps/desktop/src/i18n/textMap.tsapps/desktop/src/services/AgentService/execution/retry.tsapps/desktop/src/services/AgentService/execution/runtime.tsapps/desktop/src/services/AgentService/infrastructure/providers/adapters/mimo.tsapps/desktop/src/services/AgentService/infrastructure/providers/config.tsapps/desktop/src/services/AgentService/infrastructure/providers/drivers.tsapps/desktop/src/services/AgentService/infrastructure/providers/index.tsapps/desktop/src/services/AgentService/infrastructure/providers/types.tsapps/desktop/src/services/AuthService/index.tsapps/desktop/src/services/AuthService/managedSettingsFocus.tsapps/desktop/src/services/EventService/types.tsapps/desktop/src/views/SettingsView/components/AiServices/components/BadgedLogo.vueapps/desktop/src/views/SettingsView/components/AiServices/components/ProviderCard.vueapps/desktop/src/views/SettingsView/components/AiServices/components/ProviderConfig.vueapps/desktop/src/views/SettingsView/components/AiServices/components/ProviderList.vueapps/desktop/src/views/SettingsView/components/AiServices/index.vueapps/desktop/src/views/SettingsView/index.vueapps/desktop/tests/SettingsView/ai-services-i18n.test.tsapps/desktop/tests/SettingsView/ai-services-section-i18n.test.tsapps/desktop/tests/ci/vite-dev-cache.test.tsapps/desktop/tests/database/runtime-seed.test.tsapps/desktop/tests/i18n/main-bootstrap.test.tsapps/desktop/tests/services/AgentService/catalog/providers.test.tsapps/desktop/tests/services/AgentService/contracts/errors-i18n.test.tsapps/desktop/tests/services/AgentService/execution/executor.test.tsapps/desktop/tests/services/AgentService/execution/runtime.test.tsapps/desktop/tests/services/AgentService/infrastructure/providers/mimo.test.tsapps/desktop/tests/services/AuthService/index.test.tsapps/desktop/tests/views/SettingsView/providerConfig.test.tsapps/desktop/tests/views/SettingsView/settingsAiServicesLayout.test.tsapps/desktop/vite.config.ts
💤 Files with no reviewable changes (24)
- apps/desktop/tests/services/AgentService/catalog/providers.test.ts
- apps/desktop/tests/views/SettingsView/providerConfig.test.ts
- apps/desktop/src/services/AuthService/managedSettingsFocus.ts
- apps/desktop/src/services/AgentService/infrastructure/providers/types.ts
- apps/desktop/package.json
- apps/desktop/src/services/AuthService/index.ts
- apps/desktop/tests/services/AgentService/infrastructure/providers/mimo.test.ts
- apps/desktop/tests/services/AgentService/execution/runtime.test.ts
- apps/desktop/src-tauri/tauri.conf.json
- apps/desktop/tests/SettingsView/ai-services-i18n.test.ts
- apps/desktop/tests/services/AuthService/index.test.ts
- apps/desktop/src/services/EventService/types.ts
- apps/desktop/tests/ci/vite-dev-cache.test.ts
- apps/desktop/src/services/AgentService/execution/runtime.ts
- apps/desktop/tests/SettingsView/ai-services-section-i18n.test.ts
- apps/desktop/src-tauri/capabilities/default.json
- apps/desktop/vite.config.ts
- apps/desktop/src/database/queries/providers.ts
- apps/desktop/src/services/AgentService/execution/retry.ts
- apps/desktop/src/i18n/textMap.ts
- apps/desktop/tests/database/runtime-seed.test.ts
- apps/desktop/src/bootstrap.ts
- apps/desktop/src/i18n/messages.ts
- apps/desktop/tests/i18n/main-bootstrap.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Frontend Quality
- GitHub Check: Frontend Tests
- GitHub Check: Rust Checks
- GitHub Check: Desktop E2E Smoke (Windows)
- GitHub Check: CodeQL (rust)
🧰 Additional context used
🪛 SQLFluff (4.2.1)
apps/desktop/src/database/artifacts/runtime/seed.sql
[error] 74-74: The 'WHERE' keyword should always start a new line.
(LT14)
🔇 Additional comments (19)
apps/desktop/src-tauri/Cargo.toml (1)
42-42: LGTM!apps/desktop/src-tauri/src/lib.rs (3)
59-63: LGTM!
69-75: LGTM!
182-182: LGTM!apps/desktop/src/services/AgentService/infrastructure/providers/config.ts (1)
7-16: LGTM!apps/desktop/src/services/AgentService/infrastructure/providers/index.ts (1)
6-6: LGTM!apps/desktop/src/services/AgentService/infrastructure/providers/drivers.ts (1)
19-19: LGTM!Also applies to: 115-121
apps/desktop/src/database/artifacts/runtime/seed.sql (2)
73-74: LGTM!
76-93: Migration logic correctly handles all legacy configurations.The UPDATE statement properly:
- Extracts custom endpoint/apiKey when
touchAiMode='custom'- Nullifies managed keys (
ta_live_%) for non-custom mode while preserving user keys- Clears all legacy JSON fields (
managedAuth,touchAiMode,touchAiCustom)- Targets rows via both old hub endpoint and presence of any legacy JSON fields
apps/desktop/tests/services/AgentService/contracts/errors-i18n.test.ts (1)
74-76: LGTM!apps/desktop/tests/services/AgentService/execution/executor.test.ts (1)
42-44: LGTM!Also applies to: 64-66
apps/desktop/tests/views/SettingsView/settingsAiServicesLayout.test.ts (1)
79-98: LGTM!apps/desktop/src/services/AgentService/infrastructure/providers/adapters/mimo.ts (1)
1-73: LGTM!apps/desktop/src/views/SettingsView/components/AiServices/components/ProviderConfig.vue (1)
1-121: LGTM!apps/desktop/src/views/SettingsView/components/AiServices/components/ProviderList.vue (1)
1-86: LGTM!apps/desktop/src/views/SettingsView/components/AiServices/components/BadgedLogo.vue (1)
1-69: LGTM!apps/desktop/src/views/SettingsView/components/AiServices/components/ProviderCard.vue (1)
1-115: LGTM!apps/desktop/src/views/SettingsView/components/AiServices/index.vue (1)
1-782: LGTM!apps/desktop/src/views/SettingsView/index.vue (1)
1-333: LGTM!
|
@coderabbitai review |
Dismiss stale CodeRabbit review after fixing BOM and provider fixture text in 515c3ed.
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/desktop/tests/services/AgentService/execution/retry.test.ts`:
- Around line 6-16: The test file for shouldRetryRequestFailure() currently only
covers API_ERROR with a retryable HTTP status code, but the function has two
additional code paths that need testing: error.isRetryable() which should return
true for network errors like TIMEOUT, RATE_LIMIT, SERVICE_UNAVAILABLE,
BAD_GATEWAY, GATEWAY_TIMEOUT, and EMPTY_RESPONSE (which are actively used at
runtime), and non-API_ERROR errors with retryable status codes. Add test cases
to cover these missing scenarios, including at minimum a test case that verifies
shouldRetryRequestFailure() returns true when passed an AiError with
AiErrorCode.TIMEOUT (or similar retryable error codes), and a test case for a
non-API_ERROR error type with a retryable status code to ensure these critical
error handling paths are validated and prevent regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a4da992b-0214-4852-8037-bf94ae72d35f
📒 Files selected for processing (2)
apps/desktop/tests/services/AgentService/execution/retry.test.tsapps/desktop/tests/views/SettingsView/settingsAiServicesLayout.test.ts
📜 Review details
🔇 Additional comments (1)
apps/desktop/tests/views/SettingsView/settingsAiServicesLayout.test.ts (1)
1-1: LGTM!Also applies to: 116-116, 151-151
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Related issue or RFC
Link the issue or RFC:
For code changes, link the tracking issue. Only documentation wording, link fixes, or comment-only cleanups may skip the issue-first flow.
AI assistance disclosure
If AI tools materially assisted this contribution, disclose that here or point to the relevant commit trailer.
Testing evidence
List the commands you ran and the results you observed.
pnpm.cmd --filter @touchai/desktop test:typecheck-> passedpnpm.cmd exec vitest run --configLoader runner --pool=forks --maxWorkers=1 tests/database/runtime-seed.test.ts tests/i18n/main-bootstrap.test.ts tests/ci/vite-dev-cache.test.ts tests/SettingsView/ai-services-i18n.test.ts tests/SettingsView/ai-services-section-i18n.test.ts tests/services/AgentService/provider-drivers-i18n.test.ts tests/views/SettingsView/settingsAiServicesLayout.test.ts tests/services/AgentService/execution/executor.test.ts tests/services/AgentService/contracts/errors-i18n.test.ts-> 9 files / 48 tests passedpnpm.cmd exec vitest run --configLoader runner --pool=forks --maxWorkers=1 tests/services/AgentService/execution/retry.test.ts-> 1 file / 1 test passedpnpm.cmd test:coverage-> 150 files / 928 tests passed; command exited 0, with a non-blocking trailingfailed to bundle project http status: 504message after the coverage reportpnpm.cmd exec eslint ...on touched TS/Vue files -> passed with existingvue/one-component-per-filewarnings inai-services-section-i18n.test.tspnpm.cmd exec eslint apps/desktop/tests/services/AgentService/execution/retry.test.ts-> passedcargo fmt --manifest-path apps/desktop/src-tauri/Cargo.toml --all -- --check-> passedgit diff --check HEAD~1..HEAD-> passedseed.sql465d2aband6199d1c-> checked touched files and unmatched files; no activity entry points found outside seed cleanuppnpm.cmd --filter @touchai/desktop check:rust-> not completed locally: first run hit disk exhaustion while compiling dependencies, later pre-commit run reached the app build script but timed out downloading bundled rtk from GitHub (10060timeout)pnpm test:pr-> not run locally because Rust check is blocked by the external rtk download timeout; rely on CI for full Rust/package verification before mergeDid you follow TDD (test-first) for feature and fix work? Strongly recommended. See docs/testing/testing.md.
Risk notes
AgentService, runtime, MCP, or schema impact: AgentService provider/runtime behavior changes by removing managed MiMo gateway/auth paths; no schema change.Screenshots or recordings
Not captured.
Checklist
[WIP]or similar title prefixes.AgentService, runtime, MCP, or schema boundaries, there is an accepted RFC.pnpm test:prfor this code PR, or this is a docs-only change.pnpm test:coverage:rustor relied on CI coverage evidence.pnpm test:e2elocally or documented why CI is the first valid proof.