Repository navigation
LastChat 1.4.6 - #211
Merged
Merged
LastChat 1.4.6#211
Conversation
This reverts commit b24e4ea.
This reverts commit 86e4893.
Add the comprehensive Memory v2 design and supporting developer tooling updates. - Add docs/memory-system-v2-plan.md — full Memory v2 design, phases, and implementation plan. - Add .claude/settings.json with graphify PreToolUse hooks to enforce running graphify before source reads. - Update CLAUDE.md and .gitignore (ignore graphify-out/). - WorkspaceDetailPage.kt: prefer Alpine armv7 minirootfs for armeabi-v7a/armeabi builds (fix rootfs URL mapping). - ProotShellRunner.kt: replace occurrences of "--root-id" with "-0" to use the correct proot flag. These changes add planning/docs and small runtime fixes to improve development workflows and ARM compatibility.
Cleanup: removed unused Lucide icon dependency and references (build.gradle.kts, libs.versions.toml). Deleted legacy/stub API interfaces and implementations (LastChatAPI, RikkaHubAPI, SponsorAPI + Sponsor model) and unregistered SponsorAPI from DI. Removed MemoryItemEntity and its FTS entity (memory DB types), and the legacy Python executor. Small runtime fixes: adjust MinimalChatInput padding and trim/cleanup logic in TextChunker. Added graphify agent rules/workflow and a Codex pretool hook. Minor docs update (iOS portability). These changes remove dead/unused code and tidy dependencies.
Implements phase P1a of the Memory v2 plan (docs/memory-system-v2-plan.md §4, §16.1): the graph store schema, with no behavior changes anywhere and the legacy memory system untouched. - 14 additive Room tables (plan §4): memory_node, memory_alias, memory_fact, memory_fact_link, memory_episode, memory_mention, memory_frame, memory_provenance, memory_fts (FTS4 unicode61 remove_diacritics=2 per §19.6), memory_goal, memory_activity, memory_budget_ledger, memory_conversation_state, memory_store_meta, plus int-code objects (MemoryGraphCodes) and 10 DAOs. - Kotlin model layer data/model/MemoryGraph.kt: read-side domain models + entity mappers + the closed sealed MemoryOp vocabulary (§6.3). - Room v34 via AutoMigration(33->34); 34.json committed. - Every new table added to DatabaseSanitizer's allowlist (§11.3, critical). - MigrationTestHelper 33->34 test + room-testing dep + androidTest schema assets. Note: the plan's `memory_entity` table is named `memory_node` here to avoid a Room codegen identifier clash with the legacy `MemoryEntity` table (which stays until v35). Domain concept is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add docs/memory-system-v2-sessions.md (per-session starter prompts / P1..P11 breakdown, companion to the plan) and refine docs/memory-system-v2-plan.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PythonSandbox was deleted with the legacy Python executor, leaving two androidTest files referencing it and breaking :app:compileDebugAndroidTestKotlin (blocking all instrumented tests). - ContextUtilAndroidTest: create the owned file via importOwnedFile (OwnedFileStorage) instead of PythonSandbox; still exercises openOwnedUriInputStream. - WebdavSyncBackupRoundTripTest: seed the generated tool-output file directly under the workspaces/ managed backup dir and derive its URI, preserving the same backup/restore round-trip assertions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This reverts commit fecb53b.
This reverts commit 115ba19.
This reverts commit 8aa2afc.
This reverts commit f8d5eab.
Introduce a new local-llm module and integrate an on-device LiteRT-LM provider. - Add new :local-llm module (catalog, runtime, provider bridge, tool bridge, installer, download manager, model store, memory guard, tests, assets). - New ProviderSetting.LiteRtLocal and ProviderManager/DI registration to expose the provider (registered at startup). - UI: SettingLocalLlm page + ViewModel, routing entry, provider list pinned top item (non-reorderable), provider detail tweaks. - Backup/restore: exclude workspace linux/tmp from backups and implement safe workspace restore. - Persistence: sync installed models into settings, DataStore for local models, SecretKeyManager adjustments. - Misc: add litertlm dependency, update app build files/strings/web DTOs/AIIcon/AppShortcutManager decoding improvements. Enables running curated models on-device via LiteRT-LM; pins a built-in local provider and avoids bundling huge reinstallable rootfs in backups.
Improves the local LLM page by: - Adding foreground service (LocalModelDownloadService) with persistent notifications for model downloads - Integrating catalog metadata to display model icons from the catalog - Making provider presets dynamic via withSpecialProviderPresets() - Adjusting UI card shapes for better list grouping - Removing hardcoded 'recommended' model logic in favor of catalog-driven discovery - Relaxing file size validation from exact match to within 10MB tolerance - Adding Koin dependency to local-llm module for service injection
UnsupportedFileTransformer: remove the previous role==USER guard so document/image fallbacks are applied for all message roles (ensures non-user attachments from tools/assistant are handled). MinimalChatInput: add a remembered visualLineCount updated from TextField.onTextLayout and use maxOf(text.lines, visualLineCount) for lineCount to avoid height/line-count mismatches during layout.
Use the correct progress field (bytesDownloaded) in LocalModelDownloadService to accurately accumulate downloaded bytes. Add Koin BOM to local-llm module dependencies to align Koin versions. Also adjust imports in SettingLocalLlmPage (itemsIndexed, RoundedCornerShape) for upcoming UI changes.
Implement system-level assist gesture overlay that allows LastChat to be set as the device's default digital assistant. Features include: - VoiceInteractionService + VoiceInteractionSessionService integration for system hookup - Floating overlay UI with Material You design (glow, reply panel, input bar) - STT/TTS support with auto-start and auto-send options - Screenshot capture of trigger-time screen with optional model attachment - Settings UI for overlay configuration (assistant character, auto-behaviors, attachment) - AssistScreenshotTool for model-initiated screen access - New service: LastChatRecognitionService (stub for framework requirement) Also includes minor UI fixes in LocalLlmPage (border radius consistency) and improved MemoryGuard logic for better RAM availability checks during model loading.
Integrates on-device text embeddings (EmbeddingGemma) into the local-llm stack. Adds localagents-rag dependency and ProGuard keep rules; introduces LiteRtEmbedder (ABI-gated to arm64-v8a) and wires it into the provider and DI. Extends model types/metadata (LocalModelKind, tokenizer, embeddingDimension) and catalog with an EmbeddingGemma entry. ModelInstall now downloads tokenizer files and supports HuggingFace auth (token provider). Exposes HuggingFace token in SecretKeyManager and UI (settings page). LiteRtProvider implements createEmbedding delegating to the embedder. Also hides generation controls for embedding models and filters recommendations accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…chMethodError during Firebase init
- Add requiresLicense field to LocalModelMetadata; mark gated Gemma models - UI: show lock icon + 'Needs HF Token' for licensed models, link to HF license acceptance page on 403 download failure - Add protobuf-javalite dependency to local-llm module - Add docs/memory-system-v3-plan.md - Gitignore temp_aar/ (binary extraction artifacts)
- Fix moveMove→moveModel (false typo claim removed) - Fix Room v33→v35 (both mentions + schema path) - Fix baseline profile path: release/→main/ - Add :local-llm module to Modules table - Add service/assist/ to package layout - Note AssistantOverlayActivity as 2nd Compose host - Fix normalization stages: 5→6 (add normalizeLocalProvider), lines 491-496→500-506 - Fix importers/→importer/ (singular) - Fix Screen sealed interface line: ~1282→~1284 - Fix strings.xml count: ~1402→~1421 - Note AppToast.kt Icons.Default exception, update counts
…panel Rebuilds the assistant overlay to match the design sketches: UI: - Remove blurred backdrop; underlying app stays fully visible behind a light 22% scrim (was 55% dim + 28dp blur) - Replace bottom-only radial glow with EdgeGlow: soft Material You color blobs (primary/secondary/tertiary) drifting along all four screen edges on a 12s organic cycle, revealed bottom→top (~900ms entrance) - Glow swells via spring while speaking or listening - Split input into a floating "+" circle (opens model picker / file attach / open-in-app sheet) beside a dark pill with the assistant's real avatar as the voice button; both rise with spring(0.7, 300) - Send arrow replaces avatar only when text is present - Reply panel: drag handle snaps 170dp ↔ 72% screen height, assistant avatar + activity pill, "Open in app" chip, MarkdownBlock rendering, top text fade via offscreen compositing, auto-scroll while streaming - Attachment chips for file picker results Data: - Add modelId (Uuid?) to AssistantOverlayConfig for per-overlay model override; cleared in clearMissingModelReferences via ensureValidOrNull - VM.send() accepts attachments, resolves modelId override → falls back to assistant's chat model - QuickAskContinuationData carries attachments for continuation Activity pill: hide when done (null label) instead of showing "Done"
Replace the overlay's custom input UI with MinimalChatInput, aligning it with the app's real input system. This enables the overlay to support all input features (file pickers, STT/TTS, search, etc.) without duplication. Key changes: - Remove modal bottom sheet for model/file selection; use MinimalChatInput instead - Replace manual input state (inputText + attachments) with ChatInputState - Update send() to accept UIMessagePart list instead of raw text - Integrate blur effect system (haze + blurred container) - Add backdrop image from summon-time capture for blur sampling - Redesign edge glow as "silk" dot grid with Material You colors, masked by blob field - Inject STT state via CompositionLocal for unified voice handling - Simplify conversation/model updates via callbacks
The STT recording overlay Surface was using plain surfaceContainer color without the blur treatment, causing it to lose the glass/blur effect when STT mode was active. Now uses blurredContainerColor + lastChatBlurEffect to match the parent input capsule. Fixes both main chat and assistant overlay (which reuses MinimalChatInput and provides LocalLastChatBlur).
Replace FLAG_ACTIVITY_CLEAR_TASK with FLAG_ACTIVITY_NO_USER_ACTION so launching the assistant overlay no longer clears the main task (which killed RouteActivity when the overlay was dismissed). Also add a separate taskAffinity to AssistantOverlayActivity so it runs in its own task, fully isolating it from the main app task.
…nstead of full context window Root cause: EngineConfig.maxNumTokens controls KV cache allocation, not the context window ceiling. LastChat was passing the model's full contextLength (up to 32K tokens for Gemma 4), allocating gigabytes of KV cache and causing OOM crashes. Google's Edge Gallery app passes maxTokens (1024-4096) instead. Fixes: - LiteRtRuntime: new resolveKvCacheSize() defaults to maxTokens (matching Gallery behavior); user-explicit contextLength override is honored but capped at model's maxContextLength - MemoryGuard: || changed to && (OR allowed loads when available RAM was too low but total RAM was sufficient); now accounts for KV cache cost; uses advertisedMem on API 34+ - AndroidManifest: added android:largeHeap=true (critical for multi-GB model loads) - LocalModelTypes: updated contextLength KDoc to reflect new behavior
…verlay nav Replace isSystemInDarkTheme() with LocalDarkMode.current across Blur.kt, OnboardingPage.kt, SettingProviderPage.kt, and ModelList.kt so dark mode follows the app's ColorMode setting (SYSTEM/LIGHT/DARK) instead of only the system setting. Unify ModelList item backgrounds to surfaceContainerHigh and fix ModelIcon contentColor to respect selection state. Provide a no-op NavHostController via LocalNavController in AssistantOverlayActivity so composables that read LocalNavController (e.g. ModelList long-press) don't crash with "No NavController provided". Remove obsolete memory-system-v3-plan.md planning doc.
The pinned LiteRT provider card used 4dp for its bottom corners when grouped with other providers, while every other grouped item uses 10dp (PhysicsSwipeToDelete default, preset list, SettingsGroup). Aligns the inner radius so the grouping looks consistent.
Add a MemoryContextPlanner and integrate deterministic memory selection into GenerationHandler and ChatService; include memoryRevision in context usage keys to ensure cache invalidation. Refactor context accounting (token caps, budget fractions, saturated tool token sum, safety margin logic) and improve SmartContextManager/limitContext to preserve recent tool call/result chains. Add streaming blur visuals to Markdown streaming reveal and tests. Expand backup/restore portable tables (skills, tool_outputs) and DatabaseSanitizer.PORTABLE_TABLES, update WebDAV tests, MCP preset badges to "OAuth", and bump app version to 1.4.6.
Switch CodexOAuthManager OAuth endpoints to auth0.openai.com. Remove the preset "Command Code" provider from catalog/lastchat_catalog.json. Add .commandcode/taste/workflow/taste.md to document a cross-agent taste-learning workflow (session import intent).
Retry OAuth client registration with heuristic client names and clearer failures; add resolveOAuthClientNames and loop/register fallback logic in McpOAuthManager, and add unit test. Improve Codex OAuth callback flow: show richer HTML success/error page, surface detailed messages, and correct auth endpoints (auth.openai.com). Small UI polish: switch pill animations to springs, adjust pill colors/spacing in ActivityPill, and refine dark-mode tints and outlined text field colors in MCP settings. Minor test added for client-name resolution. Overall: better error UX, more robust OAuth registration, and visual polishing.
Replace FLAG_ACTIVITY_REORDER_TO_FRONT usage with FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP in CodexOAuthRedirectActivity and McpOAuthRedirectActivity to correctly resume the existing RouteActivity instance after OAuth redirects (fixes crash when provider ID was treated as route). Also add .commandcode/taste/workflow/taste.md to .gitignore and update the taste.md content (preferences and workflow notes). Files changed: CodexOAuthRedirectActivity.kt, McpOAuthRedirectActivity.kt, .gitignore, .commandcode/taste/workflow/taste.md.
Stop embedding archives/binaries or very large files into prompts by adding detection helpers (MAX_TEXT_FILE_SIZE_BYTES, ARCHIVE_AND_BINARY_EXTENSIONS, EXPLICIT_BINARY_MIME_TYPES) and isSupportedTextDocument/isArchiveOrBinaryFile. UnsupportedFileTransformer now advises binding a Linux Workspace. UI: show a WorkspaceRequiredCard in MinimalChatInput for attached unsupported archives. Improve MCP UI (favicon, status tags, icons, pull-to-refresh behavior) and add nicer empty-state cards for Provider/Search/TTS pages. Tweak ActivityPill animations/layout and simplify reasoning display; fix reasoning detection in ChatMessageV2. Guard searchSelected index in PreferencesStore. Add unit test for archive/binary detection and new i18n strings.
Introduce a reusable EmptyStateCard composable and replace multiple ad-hoc empty-state UIs with it for a consistent look (ModelList, AssistantLorebooksSubPage, AssistantSkillsSubPage, SettingProviderDetailPage, SettingLocalLlmPage, WorkspacePage, SettingMcpPage). Also add a Codex OAuth sign-in step in onboarding (CodexSignInPage, wiring in Setup flow) and filter out ComfyUI presets in OnboardingVM. Purpose: DRY the UI, improve consistency and simplify future empty-state updates.
Introduce a DNS-over-HTTPS fallback for Codex network calls to mitigate broken/polluted system DNS or private DNS issues. Adds createCodexDnsResolver() (CodexDnsResolver.kt) which tries system DNS → Google DoH → AliDNS DoH with an 8s timeout, and wires it into the Codex OkHttp client in DataSourceModule. Handle UnknownHostException in CodexOAuthManager to show a user-friendly string resource. Adds okhttp-dnsoverhttps dependency and new localized error string. Files: + app/src/main/java/.../CodexDnsResolver.kt, M app/src/main/java/.../CodexOAuthManager.kt, M app/src/main/java/.../DataSourceModule.kt, M app/src/main/res/values/strings.xml, M app/build.gradle.kts, M gradle/libs.versions.toml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Overhaul TTS pipeline: add queued/gapless playback API (enqueue, skipNext, setTotalChunks) and update TtsAudioPlayer interface. iOS and Android players now support queued playback and chunk-index tracking. Rewrite TextChunker (better paragraph/sentence/CJK handling, avoid breaking decimals/abbrev) and expand unit tests. Refactor TtsController to use enqueue/prefetch model and simplified worker. Misc fixes: MessageUtils.limitContext behavior, improved speakablePrefixLength logic and autoplay guard in ChatPage, and pin dav4jvm full revision in libs.versions.toml.
Remove Star History section and update dav4jvm dependency
…t on app re-entry
Refactor activity pill & timeline UI and make fades animatable. Key changes: direct-open single completed reasoning entries and ExpandedReasoning support; compact/expanded pill animations and grouping logic simplified; timeline sheet uses accordion layout for multi-step non-live timelines, improved shapes and padding, and copy uses app toaster; ChatMessage click handling now dismisses timeline; fadeEdges now supports animated top/bottom progress (and a boolean overload) with larger default fade. Added tests to cover parsing and single-completed activity behavior.
This commit removes legacy app code and unused configuration while rebranding the remaining RikkaHub references to LastChat. It strips stale banner state, screenshot tooling, legacy DAO/repository APIs, and obsolete Android permissions/dependencies; updates ProGuard and Gradle wiring for the current build; and adds the web UI Node/npm install step to the release workflow. The web UI labels and metadata were also refreshed to match LastChat branding and the current search provider list.
Compute and persist embeddings when updating core/episodic memories: chunk text, call embeddingService.embedBatch, store embeddingBlob/modelId, update EmbeddingCacheDAO and in-memory embeddingCache, and invalidate old caches. MemoryConsolidationWorker now persists embedding cache for consolidated episodes using the effective episode id. UI: ContextStackIndicator and LorebookStackIndicator badges now adapt width into a pill for >=10, center text, remove extra clipping, and refine layout. Memory recall logic simplified in MemoryVectorMath.passesRecallThreshold (tests updated). Also normalize gradlew mode, add a web-ui lockfile dependency, and set workspace compileSdk to 36.
Add a RacingDns resolver (concurrent race across system + Cloudflare/Google/AliDNS with IPv6 bootstrap) and reduce DoH timeout to improve DNS reliability. Introduce McpServerConfig.endpointUrl and findMcpConnectionPreset helpers; add McpServerIcon and enhanced McpServerFavicon composables that prefer preset icons and provide a fallback. Ensure manual/configured providers are enabled by default during onboarding and provider configuration (copyProvider(enabled = true)). Improve Codex OAuth error messaging to detect DNS vs timeout causes. Add unit tests for RacingDns, MCP preset matching, and onboarding provider behavior.
This change reduces native memory pressure and improves rendering stability under streaming updates. It lowers image/logging caches, adds regex and highlight caches, fixes visual-only transforms for the latest message, tightens memory-search and vector math normalization, and makes chat auto-scroll/IME handling safer. It also adds guarded cleanup on low-memory events and skips attachment syncing during streaming persistence.
Refactor ThinkTagTransformer to correctly parse multiple <think> tags, produce UIMessagePart.Reasoning parts, and finish open reasoning when streaming ends. Replace LruCache-based regex cache with a synchronized LinkedHashMap cache and an invalid-regex sentinel; add clearCompiledRegexCache() and call it on memory pressure. Optimize Transformer.visualTransforms list handling, make ImeAutoScroller robust to cancellations, and coalesce streaming snap requests in ChatList. Tighten JSON expression fast-path handling, clamp cosine similarity to [-1,1], add CMake links for c++ static libs, and include unit tests for these features.
- Remove opinionated starter recommendations from strings and catalog - Remove dead recommendedModel heuristic from LiteRtCatalog - Bump allowlist reference to 1_0_19 - Add Phi-4 Mini 3.8B, Qwen2.5 Coder 3B, DeepSeek R1 Distill 7B, and SmolLM2 360M
This change adds catalog-driven reasoning configuration and MAX effort support across shared model metadata, provider payloads, and the reasoning picker UI. It also refreshes the 2026 model catalog and registry heuristics, improves reasoning timeline/live-state handling, and moves the Coil singleton image loader setup into Application for safer initialization.
Add DeepSeek V4 vision variant and introduce multiple Qwen family entries in the model catalog (qwen3 covering 3.8/3.5, qwen-vl, qwen-long, qwen-plus, qwen-turbo, qwen-max, qwen-omni, etc.). Update context window sizes, vision/input modalities and abilities for affected models. Sync human-facing docs by updating .agents/skills/lastchat-catalog/SKILL.md. Update app unit tests (ModelCatalogTest) to assert the new catalog entries and their expected capabilities.
Enrich catalog metadata across many models/providers: add context_window and max_images_in_context fields, set type/input_modalities/output_modalities where missing, and normalize image limits for image/chat models. Add new model entries (e.g. gpt-4.1, gemini-1.5-pro, claude-3-5-haiku, mistral-medium-3.5, codestral, devstral-2) and enhance existing entries with context and modality info. Increase several reasoning_config.max_tokens and preset token lists. Mark STT models (whisper variants, others) with AUDIO→TEXT modalities. Also add context_window defaults for some provider entries and fix EOF newline.
This change lets resolved model metadata fall back to catalog context-window and image limits when a model entry leaves them unset, while still preserving explicit per-model overrides. It also tracks catalog schemaVersion/updatedAt in the snapshot and prefers the bundled catalog when it is newer or equivalent to the downloaded copy. The tests were updated to cover both fallback and precedence behavior, and the bundled catalog entries for several Qwen models were normalized to alias/match-based metadata.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.