Skip to content

config-redemption-time#1262

Merged
yujonglee merged 2 commits intomainfrom
config-redemption-time
Aug 1, 2025
Merged

config-redemption-time#1262
yujonglee merged 2 commits intomainfrom
config-redemption-time

Conversation

@yujonglee
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This update primarily consists of dependency version bumps across many JavaScript, TypeScript, and Rust packages, focusing on the upgrade of the @tauri-apps/api and related Tauri plugins from 2.6.x to 2.7.x. Additional dependency upgrades are made across several frontend and backend packages. There are also targeted code changes: removal of two server route files, adjustments to AI configuration schemas and forms, and internal logic updates for AI streaming and configuration handling.

Changes

Cohort / File(s) Change Summary
Tauri & Plugin API Version Bumps
Cargo.toml, plugins/*/package.json, plugins/obsidian/package.json, apps/desktop/package.json, packages/utils/package.json
Upgraded @tauri-apps/api and related plugin dependencies from 2.6.x to 2.7.x in all relevant package manifests.
General Dependency Upgrades (Frontend/Backend)
apps/admin/package.json, apps/app/package.json, admin/server/package.json, packages/client/package.json, packages/obsidian/package.json, packages/ui/package.json, packages/utils/package.json, packages/tiptap/package.json
Bumped versions for various dependencies and devDependencies (e.g., Mantine, TanStack, Zod, TypeScript, ai-sdk, etc.) across multiple package manifests. No logic changes.
AI Configuration Schema and Form Updates
apps/desktop/src/components/settings/views/ai.tsx, apps/desktop/src/components/settings/components/ai/stt-view.tsx, crates/db-user/src/config_types.rs, plugins/db/js/bindings.gen.ts, plugins/listener/src/fsm.rs
Added and integrated a new redemptionTimeMs AI config field (with validation and UI), updated schemas, backend types, and listener logic to support the new parameter.
Server Route Removals (Admin)
apps/admin/src/routes/v1/chat.completions.ts, apps/admin/src/routes/v1/models.ts
Removed server route handlers for /v1/chat/completions and /v1/models.
AI Streaming and Transform Logic Changes
apps/desktop/src/components/editor-area/index.tsx, packages/utils/src/ai.ts, apps/admin/src/services/ai.api.ts
Removed markdownTransform streaming transform, updated streaming chunk handling, error reporting, and AI API client options.
Tiptap Transcript Node and View Typing
packages/tiptap/src/transcript/nodes.ts, packages/tiptap/src/transcript/views.tsx
Relaxed and simplified typing for transcript node views, removed some attribute parsing logic, and adjusted component types.
App Integration Route Auth Redirect
apps/app/src/routes/integration.tsx
Modified unauthenticated navigation to include query parameters and added a TODO comment.
Turbo Version Bump
package.json
Updated turbo devDependency version from 2.5.4 to 2.5.5.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DesktopUI
    participant Backend
    participant DB

    User->>DesktopUI: Adjusts AI redemption time slider
    DesktopUI->>Backend: Calls setConfig({redemption_time_ms})
    Backend->>DB: Update ConfigAI.redemption_time_ms
    DB-->>Backend: Ack
    Backend-->>DesktopUI: Success
    DesktopUI->>Backend: getConfig()
    Backend->>DB: Fetch ConfigAI
    DB-->>Backend: ConfigAI with updated redemption_time_ms
    Backend-->>DesktopUI: Updated config
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~35 minutes

Possibly related PRs

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c13c8b and a55afea.

📒 Files selected for processing (6)
  • apps/desktop/src/components/settings/components/ai/stt-view.tsx (5 hunks)
  • apps/desktop/src/components/settings/views/ai.tsx (4 hunks)
  • apps/desktop/src/locales/en/messages.po (7 hunks)
  • apps/desktop/src/locales/ko/messages.po (7 hunks)
  • packages/ui/src/components/ui/slider.tsx (0 hunks)
  • packages/utils/src/ai.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch config-redemption-time

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🔭 Outside diff range comments (1)
apps/desktop/src/components/settings/views/ai.tsx (1)

721-737: Inconsistent default redemption time across components.

This component uses 5000ms as the default while the backend and stt-view component use 500ms. This inconsistency could cause confusion.

Use consistent default values:

-        redemptionTimeMs: config.data.ai.redemption_time_ms ?? 5000,
+        redemptionTimeMs: config.data.ai.redemption_time_ms ?? 500,

and

-          redemption_time_ms: values.redemptionTimeMs ?? 5000,
+          redemption_time_ms: values.redemptionTimeMs ?? 500,
♻️ Duplicate comments (8)
plugins/sse/package.json (1)

9-9: Same dependency bump as other plugins; duplication only.

Previous comment on @tauri-apps/api@2.7 applies here as well.

plugins/auth/package.json (1)

8-10: Same concern as in plugin-tray regarding the @tauri-apps/api bump

See previous comment; ensure Rust/JS versions stay in lock-step.

plugins/listener/package.json (1)

8-10: Same concern as in plugin-tray regarding the @tauri-apps/api bump

See previous comment; ensure Rust/JS versions stay in lock-step.

plugins/db/package.json (1)

8-10: Same concern as in plugin-tray regarding the @tauri-apps/api bump

See previous comment; ensure Rust/JS versions stay in lock-step.

plugins/flags/package.json (1)

8-10: Same as previous comment – duplicated advice applies here

plugins/local-stt/package.json (1)

8-10: Same as previous comment – duplicated advice applies here

plugins/windows/package.json (1)

8-10: Same as previous comment – duplicated advice applies here

plugins/local-llm/package.json (1)

8-10: Same as previous comment – duplicated advice applies here

🧹 Nitpick comments (1)
packages/tiptap/src/transcript/views.tsx (1)

8-9: Type safety relaxed for TipTap integration.

The change from strict typing to any removes compile-time type checking. While this may be necessary for TipTap integration, consider if a more specific type could be used instead of any.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5e2098 and 0c13c8b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (43)
  • Cargo.toml (1 hunks)
  • admin/server/package.json (1 hunks)
  • apps/admin/package.json (1 hunks)
  • apps/admin/src/routes/v1/chat.completions.ts (0 hunks)
  • apps/admin/src/routes/v1/models.ts (0 hunks)
  • apps/admin/src/services/ai.api.ts (0 hunks)
  • apps/app/package.json (1 hunks)
  • apps/app/src/routes/integration.tsx (1 hunks)
  • apps/desktop/package.json (4 hunks)
  • apps/desktop/src/components/editor-area/index.tsx (3 hunks)
  • apps/desktop/src/components/settings/components/ai/stt-view.tsx (5 hunks)
  • apps/desktop/src/components/settings/views/ai.tsx (5 hunks)
  • crates/db-user/src/config_types.rs (2 hunks)
  • package.json (1 hunks)
  • packages/client/package.json (1 hunks)
  • packages/obsidian/package.json (1 hunks)
  • packages/tiptap/package.json (1 hunks)
  • packages/tiptap/src/transcript/nodes.ts (2 hunks)
  • packages/tiptap/src/transcript/views.tsx (1 hunks)
  • packages/ui/package.json (2 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/utils/src/ai.ts (0 hunks)
  • plugins/analytics/package.json (1 hunks)
  • plugins/apple-calendar/package.json (1 hunks)
  • plugins/auth/package.json (1 hunks)
  • plugins/connector/package.json (1 hunks)
  • plugins/db/js/bindings.gen.ts (1 hunks)
  • plugins/db/package.json (1 hunks)
  • plugins/flags/package.json (1 hunks)
  • plugins/listener/package.json (1 hunks)
  • plugins/listener/src/fsm.rs (5 hunks)
  • plugins/local-llm/package.json (1 hunks)
  • plugins/local-stt/package.json (1 hunks)
  • plugins/misc/package.json (1 hunks)
  • plugins/notification/package.json (1 hunks)
  • plugins/obsidian/package.json (1 hunks)
  • plugins/sfx/package.json (1 hunks)
  • plugins/sse/package.json (1 hunks)
  • plugins/store2/package.json (1 hunks)
  • plugins/task/package.json (1 hunks)
  • plugins/template/package.json (1 hunks)
  • plugins/tray/package.json (1 hunks)
  • plugins/windows/package.json (1 hunks)
💤 Files with no reviewable changes (4)
  • apps/admin/src/services/ai.api.ts
  • packages/utils/src/ai.ts
  • apps/admin/src/routes/v1/models.ts
  • apps/admin/src/routes/v1/chat.completions.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/app/src/routes/integration.tsx
  • plugins/db/js/bindings.gen.ts
  • crates/db-user/src/config_types.rs
  • packages/tiptap/src/transcript/views.tsx
  • packages/tiptap/src/transcript/nodes.ts
  • apps/desktop/src/components/editor-area/index.tsx
  • plugins/listener/src/fsm.rs
  • apps/desktop/src/components/settings/views/ai.tsx
  • apps/desktop/src/components/settings/components/ai/stt-view.tsx
⏰ 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). (3)
  • GitHub Check: ci
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (37)
package.json (1)

4-4: Patch bump looks safe—CI run should catch any Turbo cache invalidations.

turbo moved from 2.5.42.5.5 (patch). No code impact expected, but watch for lock-file churn or changed hashing that can trigger full pipelines.

Trigger the full build to verify incremental caching still behaves as expected.

plugins/sfx/package.json (1)

9-9: Keep an eye on breaking API changes from @tauri-apps/api@2.7.

Version 2.7.0 claims semver-minor, but Tauri occasionally slips breaking TS typings. Make sure the plugin’s TS compilation still passes and runtime APIs (e.g., window, event) behave the same.

Run pnpm -F @hypr/plugin-sfx test && pnpm -F @hypr/plugin-sfx build to confirm.

Cargo.toml (1)

76-76: Workspace-wide tauri 2.7 upgrade: verify all plugin crates compile.

Local path plugins are still version-tagged 2.3/2.4, but cargo will unify them to tauri = 2.7. Compilation should surface any breaking ABI changes—run cargo check --workspace before merging.

plugins/misc/package.json (1)

9-9: Mirrors the other plugin bumps—no additional concerns.

Assuming tests pass with @tauri-apps/api@2.7, this is fine.

plugins/store2/package.json (1)

9-10: Confirm compatibility with Tauri 2.7 before publishing
Moving from @tauri-apps/api 2.6 → 2.7 is a minor bump but may include breaking changes flagged during the 2.7.0-rc stage (e.g. window event API tweaks). Make sure the plugin’s runtime path tests still pass and check the CHANGELOG.md for deprecations.

plugins/template/package.json (1)

9-10: Dependency bump looks good – just re-run template test-suite
Nothing else changed, so CI should remain green as long as @tauri-apps/api 2.7 is compatible with the generated template code.

plugins/analytics/package.json (1)

9-10: Analytics plugin tracks with workspace version – OK
Upgrade aligns this package with the workspace-wide Tauri 2.7 migration. No additional action beyond standard regression tests.

packages/obsidian/package.json (1)

20-21: Patch-level React-Query bump is safe but watch for API deprecations
@tanstack/react-query 5.84.0 contains only bug-fixes per upstream notes; nevertheless, verify codegen output and queryClient typings still compile.

plugins/connector/package.json (1)

9-10: Connector plugin: version alignment achieved – nice
Matches the rest of the plugins; no immediate concerns.

packages/client/package.json (1)

18-20: Confirm no SDK regeneration diffs after bumping @tanstack/react-query to 5.84.0

We’ve verified that every package.json in the monorepo now references @tanstack/react-query: "^5.84.0".

Next, please run the generator and ensure nothing changed:

pnpm install
pnpm -r exec openapi-ts

• Ensure there are no unexpected diffs in your generated SDK files.
• If any files are regenerated, review and commit those changes or adjust the generator inputs accordingly.

plugins/tray/package.json (1)

8-10: Confirm native build passes with Tauri 2.7 upgrade

All JS plugins now use “@tauri-apps/api”: ^2.7.0 and every Rust crate in the workspace references tauri = "2.7" via the shared workspace. Please run a full workspace build check to ensure there are no ABI or compilation issues on each target platform:

# From the repo root:
cargo check --workspace --all-targets
plugins/task/package.json (1)

8-10: Tauri v2.7 references ✅ – please build & test
All @tauri-apps/api entries across JS/TS packages and the tauri = "2.7" line in Cargo.toml have been upgraded; no 2.6 remains.

Next steps:

  • Run your JS/TS build and integration-test suite against Tauri 2.7.0.
  • Run the Rust tests (e.g., cargo test) to catch any breaking‐change regressions.
plugins/notification/package.json (1)

9-9: Confirm Tauri 2.7 breaking-change compatibility before merging

Bumping @tauri-apps/api from ^2.6.0 to ^2.7.0 looks innocuous, but Tauri frequently ships breaking changes even in minor releases. Please run the desktop build and smoke-test at least one notification call to ensure:

  1. No type errors are emitted by tsc.
  2. No runtime errors are thrown when invoking tauri.notification APIs.

If everything compiles and runs, we’re good.

plugins/apple-calendar/package.json (1)

9-9: Same verification needed for Apple-Calendar plugin

The plugin relies on window-side Tauri APIs (calendar access & window events). Do a quick compile/run against Tauri 2.7 to rule out signature drifts.

plugins/obsidian/package.json (1)

9-10: New local dependency ordering is harmless; focus on Tauri 2.7 upgrade

Ordering change is fine. As with other plugins, verify Obsidian bridge calls still succeed under @tauri-apps/api 2.7.

admin/server/package.json (2)

12-12: Minor → minor bump of better-auth may still introduce breaking API tweaks

1.2.121.3.4 is a semver-minor, but auth libraries sometimes sneak in behaviour changes (token structure, cookie flags, etc.). Re-run the login flow in admin/server e2e tests.


19-22: Toolchain upgrades require lock-step CI images

@types/node, tsx, and typescript were all bumped. Ensure the CI/container image installs matching versions, otherwise type-checking or tsx watch may fail.

packages/ui/package.json (1)

51-52: Dev-only bumps LGTM

react-query, @types/node, and postcss bumps are patch-level; no concerns.

Also applies to: 57-57

packages/utils/package.json (1)

15-15: Verify major version upgrade for @ai-sdk/openai-compatible

The bump from ^0.2.16 to ^1.0.0 may introduce breaking changes (client instantiation, renamed methods, removed features, etc.) similar to the OpenAI SDK’s 1.0.0 release. Please:

  • Review the @ai-sdk/openai-compatible changelog or migration guide for v1.0.0.
  • Update any client instantiation patterns (e.g. replacing global defaults with new OpenAI({ apiKey }) or equivalent).
  • Adjust method calls to match the new API surface (e.g. client.models.list() vs. old Model.list()).
  • Search your codebase for all imports from @ai-sdk/openai-compatible and refactor usages accordingly.
  • Run end-to-end tests—especially flows that use the ai package at ^5.0.0—to catch any compatibility issues.

Targets for review:

  • packages/utils/package.json (Line 15)
  • All files importing from @ai-sdk/openai-compatible
packages/tiptap/package.json (1)

25-44: Significant Tiptap version jump - ensure thorough testing

The Tiptap packages have been updated from 2.12.0 to 2.26.1, which is a substantial minor version jump. While these updates should be backward compatible, please ensure thorough testing of the editor functionality.

apps/app/package.json (1)

14-44: LGTM - Dependency updates are well-aligned

All dependency updates are minor or patch versions that maintain backward compatibility. The versions are consistent with updates across other packages in the monorepo.

apps/desktop/src/components/editor-area/index.tsx (2)

455-455: Good improvement to error handling

Throwing the actual error message instead of a generic error will provide better debugging information.


404-404: API updates align with AI SDK v5.0 migration guide

All three changes correctly follow the official migration guide:

  • Tool definitions now use inputSchema instead of parameters (line 404).
  • Streamed text chunks expose their content via chunk.text (full content) and chunk.delta for deltas; replacing chunk.textDelta with chunk.text (line 449) is valid.
  • Tool‐related chunks now carry inputs in chunk.input instead of chunk.args (line 458).

No further changes needed.

apps/desktop/package.json (1)

19-135: LGTM! Coordinated dependency upgrades look good.

The dependency updates are well-coordinated, particularly the Tauri ecosystem upgrade from 2.6.x to 2.7.x. The version bumps appear to be minor/patch updates that should be safe.

crates/db-user/src/config_types.rs (2)

89-89: Clean addition of redemption_time_ms field.

The new optional field follows Rust conventions and maintains backward compatibility.


99-99: Appropriate default value for redemption time.

The 500ms default for redemption_time_ms seems reasonable for AI response timing.

plugins/db/js/bindings.gen.ts (1)

162-162: Correct type mapping for redemption_time_ms.

The auto-generated TypeScript binding correctly maps Rust's Option<u32> to number | null.

packages/tiptap/src/transcript/nodes.ts (2)

233-239: Good simplification of parsing logic.

Streamlining the parseHTML to only match the essential div[data-speaker-index] attribute removes unnecessary complexity.


256-256: Type casting aligns with views.tsx changes.

The as any cast is consistent with the typing changes in views.tsx, though it does reduce type safety as noted in the previous file.

plugins/listener/src/fsm.rs (4)

210-230: LGTM! Proper extraction of redemption_time_ms config.

The implementation correctly extracts the redemption_time_ms from the AI config with a sensible default value of 500ms, following the same pattern as other config values.


252-258: Correctly passes redemption_time_ms to listen client setup.

The extracted redemption_time_ms value is properly passed to the setup_listen_client function.


558-563: Function signature properly updated.

The setup_listen_client function signature correctly includes the new redemption_time_ms parameter with appropriate u32 type.


586-593: Verify the 70ms redemption time for onboarding sessions.

The fixed value of 70ms for onboarding sessions is significantly lower than the default 500ms. This aggressive setting might cause performance issues as noted in the UI description.

Could you confirm that 70ms is the intended value for onboarding? This is 7x more aggressive than the minimum 300ms allowed in the UI configuration.

apps/desktop/src/components/settings/components/ai/stt-view.tsx (2)

1-21: Imports properly added for form handling and config management.

All new imports are utilized in the component for form validation, data fetching, and UI rendering.


226-244: Mutation properly configured for saving AI config.

The mutation correctly updates the redemption_time_ms in the backend config and invalidates the cache on success.

apps/desktop/src/components/settings/views/ai.tsx (2)

202-203: Verify the impact of making aiSpecificity required.

Making aiSpecificity a required field could be a breaking change if existing configs don't have this value set.

Please confirm that all existing user configs have the ai_specificity field populated, or add migration logic to handle missing values.


844-850: Properly maintains both config values when updating autonomy.

The implementation correctly retrieves current form values to ensure both aiSpecificity and redemptionTimeMs are saved together.

@yujonglee yujonglee merged commit 2a941a8 into main Aug 1, 2025
4 of 7 checks passed
@yujonglee yujonglee deleted the config-redemption-time branch August 1, 2025 02:38
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.

1 participant