You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(suggestions): Implement typing suggestion feature for inline autocomplete - #759
…ocomplete
- Introduces learned phrase suggestions for inline autocomplete during chat.
- Suggestions are based on generalized typing habits, never storing raw message content.
- The system refreshes habits using messages across all past chat sessions.
- Adds dedicated settings UI for managing and resetting learned suggestions.
- Updates database schema and core services to handle persistent suggestion storage.
The opt-out is not durably fail-safe. AppConfig.updateField updates its cache before writing and throws on a write failure, so this handler can leave the switch looking disabled for the current process while the saved value remains enabled; after restart, message excerpts can be sent again. This privacy control needs to persist atomically (or roll back/fail closed), and the UI must surface a save failure rather than letting it escape the event handler.
The new variant participates in its own eviction selection. If the wall clock moves backward (the case explicitly handled for category eviction below), every existing variant can have a later updatedAt, causing the just-inserted variant to be immediately deleted and the new phrase silently discarded. Exclude newId from eviction candidates as is done for new categories.
A checkpoint read failure is treated exactly like “no checkpoint,” so a transient database error bypasses both persisted refresh gates and triggers another paid provider call. Fail closed on repository errors and reserve null for the successful no-checkpoint result.
The newly inserted variant participates in its own eviction. If existing rows have equal/future timestamps (clock rollback—the category path below explicitly handles this), minBy can immediately delete newId, so a full category cannot learn new variants until the clock catches up. Evict only from the variants that existed before this insertion.
Allow autocomplete matching when sessionId is null
A new-chat ChatView has a null sessionId, so this gate disables the always-on local history autocomplete precisely while the user drafts the first message. The service does not otherwise scope by session, so null should not prevent matching.
On a refresh failure for an already cached profile, leaving cachedProfileId unchanged prevents the documented retry: subsequent suggest calls see the same profile ID and never call refreshCache again. This can leave newly merged rows unavailable indefinitely and can continue serving deleted rows after a reset that reports success. Invalidate the cache on failure so the next call retries and cannot serve stale data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related Issue(s)
Type of Change
What Changed & Why
How to Test
./gradlew testScreenshots / Recordings (if applicable)
Checklist
main./gradlew spotlessApplyand./gradlew detektlocally./gradlew testand all tests passgit commit -sAdditional Notes