Commit Graph
362 Commits
Author SHA1 Message Date
YellowSnnowmannandGitHub c09983b49b feat(about_app): add a runtime capability catalog for app discovery (#267)
* feat(about_app): introduce user-facing capability catalog

- Added a new module for the capability catalog, providing a single source of truth for user-facing features in the OpenHuman app.
- Implemented functions for listing, looking up, and searching capabilities, enhancing user interaction with the app's features.
- Created a structured schema for capabilities, including categories and statuses, to improve organization and accessibility.
- Added comprehensive end-to-end tests to validate the functionality of the new capability catalog, ensuring robust performance and reliability.

This update significantly enhances the app's ability to expose its features to users, improving overall usability and experience.

* feat(about_app): update capability catalog with new features and improved instructions

- Revised existing capability instructions for clarity and accuracy, enhancing user guidance on accessing features.
- Introduced several new capabilities related to skills and authentication, including connections to Google, Notion, and Web3 wallets, expanding the app's functionality.
- Added new settings management capabilities, allowing users to manage desktop services and clear app data, improving user control over the application.

These updates significantly enhance the capability catalog, providing users with more options and clearer instructions for utilizing the app's features.
2026-04-02 16:45:00 +05:30
c134d96056 fix(skills): route sync RPC to onSync handler and persist state to memory (#183)
* feat(debug): add script for Notion sync memory verification and enhance memory persistence

- Introduced `debug-notion-sync-memory.sh` to facilitate live testing of the Notion skill with memory verification.
- The script validates the full flow from skill start to memory persistence, ensuring required environment variables are set.
- Updated `handle_skills_sync` to change the RPC method from `skill/tick` to `skill/sync` for better clarity in the sync process.
- Implemented `persist_state_to_memory` function to ensure published ops state is saved to memory after sync, cron, and tick events.
- Enhanced end-to-end tests to validate memory persistence during skill sync and tick operations, ensuring robust functionality.

This update improves the debugging process for the Notion skill and enhances the overall reliability of memory operations.

* style: apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(memory): implement background memory-write worker for skill state persistence

- Introduced a `MemoryWriteJob` struct to encapsulate the details of memory write operations.
- Added a bounded background worker using `tokio::spawn` to handle memory writes asynchronously, improving performance and responsiveness.
- Updated `persist_state_to_memory` to queue memory write jobs instead of executing them directly, allowing for better flow control and error handling.
- Enhanced logging for memory persistence operations to provide clearer insights into success and failure cases.
- Modified event handling in `handle_message` to ensure state persistence occurs only after successful operations, reducing the risk of data loss.

This update significantly enhances the memory management capabilities of the skill instance, ensuring more reliable state persistence.

* feat(skills): enhance skills synchronization and memory persistence

- Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations.
- Updated `persist_state_to_memory` to include a memory write transaction, ensuring state persistence is handled more robustly and efficiently.
- Enhanced event handling in `handle_message` to ensure memory writes are queued correctly, improving the reliability of state persistence during skill operations.

These changes improve the overall functionality and reliability of skills synchronization and memory management.

* feat(skills): enhance skills synchronization and memory persistence

- Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations.
- Updated `persist_state_to_memory` to include a `memory_write_tx` parameter, allowing for more efficient state persistence in the event loop.
- Enhanced tests for skills synchronization to ensure robust memory handling and state persistence during skill operations.

This update improves the reliability and traceability of skills synchronization processes, ensuring better memory management and debugging capabilities.

* refactor(tests): update JSON-RPC sync handling in end-to-end tests

- Enhanced comments in `json_rpc_skills_runtime_start_tools_call_stop` to clarify the sync process routing through the `skill/sync` RPC.
- Updated assertions in `skills_sync_rpc_calls_on_sync_not_on_tick` to ensure proper handling of the new sync flow, verifying that the `skills_sync` method routes correctly to `onSync`.
- Improved logging for better observability during skill synchronization tests, ensuring that the expected behavior aligns with the updated RPC structure.

These changes improve the clarity and reliability of the end-to-end tests related to skills synchronization.

* feat(env): enhance environment configuration for skills development

- Updated `.env.example` to include `SKILLS_LOCAL_DIR` for local skills source directory, allowing developers to specify a path for skill discovery and installation.
- Improved comments in the environment file to clarify the usage of `SKILLS_REGISTRY_URL` for both remote and local paths, enhancing the development experience.
- Refactored `qjs_engine.rs` to prioritize the `SKILLS_LOCAL_DIR` for skill source directory resolution, improving local development workflows.
- Added utility functions in `registry_ops.rs` to support local file path handling for skill registries, enhancing flexibility in skill management.

These changes streamline the development process for skills by providing clearer configuration options and improving local development capabilities.

* feat(tests): enhance skills directory discovery in test files

- Updated `try_find_skills_dir` function across multiple test files to include support for the `SKILLS_LOCAL_DIR` environment variable, improving the flexibility of skills directory resolution.
- Enhanced comments to clarify the order of directory search priorities, ensuring better understanding for developers.
- Improved error handling and logging for cases where the specified directory does not exist, aiding in debugging and test reliability.

These changes streamline the skills directory discovery process in tests, enhancing the overall development experience.

* feat(tests): enhance skills directory discovery in test files

- Updated `try_find_skills_dir` function to include support for the `SKILLS_LOCAL_DIR` environment variable, allowing for more flexible skills directory resolution.
- Improved documentation to clarify the priority order for skills directory discovery.
- Refactored multiple test files to utilize the updated skills directory discovery logic, enhancing consistency and maintainability across tests.

These changes streamline the skills directory discovery process in tests, improving the overall testing framework.

* refactor(tests): streamline memory client verification in Notion live tests

- Updated the memory client verification process in `notion_live_with_real_data` to utilize `MemoryClient::new_local()` for improved clarity and consistency.
- Enhanced comments to clarify the memory store check location and removed redundant error handling for workspace directory creation.
- Simplified the error logging to focus on the memory client creation failure, improving readability and maintainability of the test code.

These changes enhance the reliability of memory verification in the Notion live tests, ensuring a clearer understanding of the memory client initialization process.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:00:57 -07:00
2545ae374a refactor: extract accessibility middleware module (#184)
* feat(autocomplete): add target_role to EngineState for improved context validation

- Introduced a new field `target_role` in `EngineState` to store the AXRole of the text element when suggestions are generated.
- Updated the `AutocompleteEngine` to validate the focused element against the expected app and role before applying suggestions.
- Enhanced the `apply_text_to_focused_field` function to include role validation, ensuring better accuracy in text insertion.
- Improved the handling of suggestion context and error states during autocomplete operations.

This update enhances the reliability of the autocomplete feature by ensuring that suggestions are applied only when the correct context is maintained.

* fix(package): update dev:app script to include core staging step

- Modified the `dev:app` script in `package.json` to run `yarn core:stage` before executing `tauri dev`, ensuring that the core sidecar is properly staged during development.
- This change enhances the development workflow by automating the staging process, reducing manual steps for developers.

This update improves the reliability of the development environment setup.

* feat(autocomplete): implement core autocomplete engine and supporting modules

- Introduced a new `AutocompleteEngine` struct to manage the state and operations of the autocomplete feature, including starting, stopping, and refreshing suggestions.
- Added `EngineState` to track the current status, phase, and context of the autocomplete process.
- Implemented helper functions for managing focus and overlay notifications, enhancing user interaction with suggestions.
- Created utility functions for terminal context extraction and text sanitization, improving the accuracy of suggestions.
- Developed a comprehensive set of types and structures to support autocomplete operations, including suggestion handling and status reporting.

This update lays the foundation for a robust autocomplete feature, enhancing user experience through improved context awareness and interaction.

* refactor(autocomplete): remove unused functions and improve clipboard handling

- Deleted the `normalize_ax_value` and `parse_ax_number` functions as they were not utilized in the codebase, streamlining the autocomplete module.
- Enhanced the `clipboard_save` function to improve readability by formatting the string conversion of clipboard output, ensuring better handling of empty or "missing value" cases.

This update simplifies the code and improves the overall maintainability of the autocomplete functionality.

* refactor(autocomplete): remove unused functions and improve clipboard handling

- Deleted the `normalize_ax_value` and `parse_ax_number` functions as they were not utilized in the codebase, streamlining the autocomplete module.
- Enhanced the `clipboard_save` function to improve readability by formatting the string conversion of clipboard output, ensuring better handling of empty or "missing value" cases.

This update cleans up the code and optimizes the clipboard handling logic for the autocomplete feature.

* feat(autocomplete): enhance focus handling and text insertion methods

- Implemented a unified Swift helper for querying focused text elements, improving performance and reliability on macOS.
- Added fallback mechanisms to use osascript for focus queries when the helper is unavailable, ensuring consistent functionality.
- Refactored text insertion logic to prioritize the unified helper, with osascript and AXValue as fallback options, enhancing user experience during text application.
- Cleaned up and organized focus-related functions, improving code readability and maintainability.

This update significantly enhances the autocomplete feature's ability to interact with focused text elements, providing a more robust and responsive user experience.

* feat(accessibility): introduce comprehensive accessibility module for macOS

- Added a new `accessibility` module that centralizes focus queries, screen capture, key state detection, and permission management for macOS.
- Implemented a unified Swift helper process to enhance performance and reliability in querying focused text elements and managing overlays.
- Introduced various functionalities including screen capture, text insertion into focused fields, and permission detection for accessibility features.
- Enhanced user experience by providing robust methods for interacting with accessibility APIs, ensuring consistent behavior across different contexts.

This update significantly improves the accessibility capabilities of the application, providing a more responsive and user-friendly interface for macOS users.

* feat(accessibility): introduce screen capture and focus query modules

- Added a new `accessibility` module to centralize platform-specific accessibility functionalities, including screen capture and focus queries.
- Implemented `capture.rs` for screen capture using platform-native tools, supporting both windowed and fullscreen modes.
- Developed `focus.rs` to handle accessibility focus queries, utilizing a unified Swift helper for improved performance on macOS.
- Introduced helper functions for managing overlays and permissions, enhancing user interaction and accessibility features.

This update significantly enhances the application's accessibility capabilities, providing robust tools for screen capture and focus management.

* refactor(accessibility): remove unused accessibility functions and streamline modules

- Deleted unused functions from the accessibility module, including `focused_text_context`, `is_text_role`, `normalize_ax_value`, and `parse_ax_number`, to enhance code clarity and maintainability.
- Updated module documentation to reflect the current structure and purpose, ensuring consistency across the accessibility and screen intelligence modules.

This update simplifies the codebase and improves the overall organization of accessibility-related functionalities.

* feat(image-processing): implement image compression and resizing for vision LLM

- Added a new module `image_processing` to handle the compression and resizing of screenshots before sending them to the vision LLM.
- Implemented the `compress_screenshot` function, which decodes PNG data-URIs, resizes images to fit within a specified maximum dimension, and re-encodes them as JPEGs.
- Updated the `AccessibilityEngine` to utilize the new image processing functionality, ensuring that images sent for analysis are optimized for size and quality.
- Introduced new dependencies in `Cargo.toml` for image handling and compression.

This update enhances the efficiency of image processing in the application, reducing token usage and improving inference speed.

* feat(tests): add end-to-end tests for screen intelligence vision pipeline

- Introduced a new test file `screen_intelligence_vision_e2e.rs` to validate the complete flow of the screen intelligence vision pipeline.
- Implemented tests that cover generating images, compressing and resizing them, simulating LLM responses, and persisting results to memory.
- Utilized temporary directories and environment variable management to ensure test isolation and reliability.
- Enhanced the testing framework by including helper functions for image creation and mock responses, improving the overall test coverage and robustness.

This update significantly strengthens the testing capabilities of the screen intelligence module, ensuring that the entire pipeline functions correctly under various scenarios.

* style: apply cargo fmt and import ordering fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(accessibility): add non-macOS stub for validate_focused_target

The function was gated with #[cfg(target_os = "macos")] but exported
unconditionally from mod.rs, causing compilation failure on non-macOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(accessibility): enhance screen capture and error handling

- Updated the screen capture functionality to include a timestamp helper in the documentation.
- Improved error handling when reading resized screenshots, ensuring temporary files are removed on failure.
- Added logging for raw errors returned by the helper in the focus context, providing better debugging information.
- Refactored clipboard handling in the paste functionality to preserve multi-line text, enhancing usability.
- Introduced a constant for terminal application names to simplify terminal detection logic.

This update improves the robustness and clarity of the accessibility module, enhancing both screen capture and focus handling capabilities.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:58:45 -07:00
0dd4d1f60b fix(macos): restart sidecar so TCC permission state updates after System Settings (#133) (#182)
* fix(macos): restart sidecar so permission grants show after System Settings

Fixes #133

- Tauri: restart core after kill+wait; fail fast when port held by non-managed process
- ACL: allow core_rpc_url and restart_core_process (IPC was blocked in Tauri 2)
- Dev: default_core_bin falls through to release search when binaries/ empty
- Core: expose permission_check_process_path on accessibility status
- App: Restart & refresh UX, extractError for invoke, Vitest for RPC + slice
- Stage script: optional dev codesign helper for stable TCC identity

Made-with: Cursor

* refactor(onboarding): update button text for clarity and enhance core process restart handling

- Changed button text in ScreenPermissionsStep from 'Refresh Status' to 'Restart & Refresh Permissions' for better user understanding.
- Introduced a restart lock in CoreProcessHandle to serialize overlapping restart requests, ensuring smoother core process management.
- Updated restart_core_process function to acquire the restart lock before initiating a restart, improving reliability during the process.

* fix: improve text clarity in AccessibilityPanel and ScreenIntelligencePanel

- Adjusted text formatting in AccessibilityPanel for better readability.
- Enhanced text clarity in ScreenIntelligencePanel regarding permission refresh instructions.
- Standardized the formatting of permission_check_process_path in test files for consistency.

---------

Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
2026-04-01 16:34:38 -07:00
a5788b88e3 fix(autocomplete): reliability bugs and in-app ghost text (#107) (#179)
* fix(autocomplete): add 30s timeout to inference HTTP client

reqwest::Client::new() creates a client with no timeout, causing
inference calls to block indefinitely when Ollama is slow or
unreachable. Admin endpoints had explicit timeouts but inference
did not.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(autocomplete): improve engine reliability and suppress in-app notifications

- Wrap engine loop refresh() in 15s tokio timeout to prevent blocking
- Handle AX error -1728 (Electron apps) gracefully as idle, not error
- Clear stale state (last_error, suggestion, context) on stop()
- Add skip_apply flag to AutocompleteAcceptParams so frontend can
  accept without triggering AppleScript text insertion
- Skip AX-based Tab accept and overlay when OpenHuman is focused
- Guard all show_overflow_badge calls with app_name check to suppress
  Script Editor notifications when typing in the chat composer
- Cache inference results: skip Ollama call when context is unchanged
  and a suggestion already exists

Closes #107

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(autocomplete): add skip_apply to AutocompleteAcceptParams type

Frontend passes skip_apply: true when accepting ghost text so the
backend only persists for personalization without AppleScript insertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(autocomplete): fix ghost text display, alignment, and acceptance

- Fix getInlineCompletionSuffix to handle backend's continuation
  suffix format (not just full-string format)
- Add 120s safety timeout to clear isSending if no response arrives
- Match textarea CSS to overlay div (leading-normal, whitespace-pre-wrap,
  break-words, font-sans) so ghost text aligns on multi-line wrap
- Pass skip_apply: true when accepting to prevent double text insertion
- Add Right Arrow key acceptance when cursor is at end of input

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: apply prettier + cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* format

* Update README.md to enhance installation instructions and clarify project overview

- Added installation commands for MacOS/Linux and Windows users.
- Removed redundant download section and streamlined the project description.
- Updated the GitHub star section to be commented out for clarity.

This update improves user onboarding by providing clear installation steps and a concise project overview.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
2026-04-01 16:18:47 -07:00
207ec7d45c feat: local model auto-reaction on user messages by channel type (#181)
* feat(conversations): implement auto-reaction feature for user messages

- Added functionality to automatically react to user messages with emojis based on the local AI's evaluation of the message content and channel type.
- Introduced `maybeAutoReact` function to handle the decision-making process for emoji reactions.
- Updated the `Conversations` component to store the last user message and trigger reactions accordingly.
- Enhanced the `tauriCommands` with a new method `openhumanLocalAiShouldReact` to facilitate local model evaluations for reactions.
- Updated local AI operations to include reaction decision logic, ensuring efficient and context-aware responses.

This feature enhances user engagement by adding a personal touch to interactions.

* style: fix prettier formatting in Conversations.tsx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt to ops.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR review — race condition, invisible reactions, flag emoji, PII log

- Replace lastUserMessageRef with per-thread pendingReactionRef Map so
  cancellation/retry clears stale entries and onDone only applies to
  the matching request round
- Render reactions on user message bubbles (not just agent messages)
  so auto-reactions are actually visible; manual picker stays agent-only
- Fix extract_first_emoji to consume consecutive regional indicator
  symbols as a single flag emoji (e.g. 🇺🇸); add regression test
- Replace raw_output in should_react debug log with output_len to
  avoid persisting user PII in traces

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(conversations): remove unused imports for local AI transcription and TTS

- Cleaned up the Conversations component by removing unused imports related to local AI transcription and text-to-speech functionalities, streamlining the codebase and improving maintainability.es

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:11:32 -07:00
cf344facf9 feat(voice): dedicated voice assistance module for STT/TTS (#178)
* feat(voice): add dedicated voice assistance module for STT/TTS

Extracts speech-to-text (whisper.cpp) and text-to-speech (piper) into a
dedicated `src/openhuman/voice/` domain module with its own RPC namespace
(`openhuman.voice_*`). Adds proactive availability checking via
`voice_status` so the UI can show clear errors when binaries/models are
missing instead of failing silently at transcription time.

- New module: voice/types.rs, voice/ops.rs, voice/schemas.rs, voice/mod.rs
- 4 RPC endpoints: voice_status, voice_transcribe, voice_transcribe_bytes, voice_tts
- 21 unit tests + 1 integration test (json_rpc_e2e)
- Frontend updated to use voice_* endpoints with status check on mode switch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix cargo fmt in voice/ops.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(e2e): add voice mode integration spec

Tests switching to voice input mode, verifying status check fires,
recording button renders, and switching back to text mode restores
text input. Also checks reply mode toggle visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unused waitForText import in voice-mode e2e spec

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(voice): in-process whisper engine and LLM post-processing

- Add whisper-rs (0.16) for in-process whisper.cpp inference, eliminating
  cold-start latency from subprocess-per-call (~1-3s) to warm inference
  (~50ms). Model is loaded once during bootstrap and reused across calls.
  Falls back to whisper-cli subprocess if in-process loading fails.

- Add LLM post-processing layer that passes raw transcription through
  Ollama to fix grammar, punctuation, and filler words. Accepts optional
  conversation context to disambiguate names and technical terms.
  Gracefully degrades to raw whisper output if Ollama is unavailable.

- Update voice RPC endpoints with new optional params (context,
  skip_cleanup) and return both cleaned text and raw_text.

- Update frontend to pass conversation history as context for voice
  transcription cleanup, and update TypeScript interfaces to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt formatting fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(build): make whisper-rs optional behind `whisper` feature flag

The whisper-rs crate requires cmake to compile whisper.cpp from source,
which is not available in the CI environment. Move it behind an optional
cargo feature so CI builds succeed without cmake.

The whisper_engine module now compiles as a no-op stub when the feature
is disabled, returning "whisper feature not compiled in" errors. Desktop
builds can opt in with `--features whisper`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: cargo fmt whisper_engine.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): make whisper-rs mandatory and install cmake in CI

Revert whisper-rs from optional to mandatory dependency. Add cmake
installation to all CI workflows (build, typecheck, test, release) and
the CI Docker image so whisper-rs can compile whisper.cpp from source.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: cargo fmt whisper_engine.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address code review findings across voice module

- whisper_engine: validate WAV sample rate (must be 16kHz) and channel
  count (1 or 2) before feeding audio to whisper
- speech: offload load_engine and transcribe_in_process to
  tokio::task::spawn_blocking to avoid blocking the Tokio runtime
- ops: use RAII guard for WHISPER_BIN env var in test to prevent races
  and ensure restore on panic; log temp file cleanup failures instead
  of silently ignoring; sanitize paths in debug logs to basenames only
- postprocess: add test for disabled cleanup config returning raw text
- voice-mode.spec: assert failure when neither voice CTA nor
  unavailable message appears; make reply mode test runnable in
  isolation with auth/nav setup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 15:52:52 -07:00
51406535cf feat(memory): conversation segmentation, event extraction, and user profile accumulation (#176)
* feat: enhance archivist functionality with conversation segmentation and event extraction

- Updated the Archivist to manage conversation segments, including boundary detection and lifecycle management.
- Implemented event extraction from closed segments to update user profiles with preferences and facts.
- Added new methods for loading user profile context and integrating it into the bootstrap context.
- Introduced new database tables for storing events and user profiles, along with necessary SQL initialization scripts.
- Enhanced memory query capabilities to include episodic and event data, improving retrieval accuracy.

This update significantly improves the system's ability to maintain context and extract meaningful insights from conversations.

* style: apply cargo fmt formatting to new memory modules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(tests): add comprehensive tests for archivist and memory modules

- Introduced new tests for the Archivist to validate turn accumulation and preference event extraction during conversation segmentation.
- Enhanced event handling tests to ensure idempotency in event insertion and correct filtering by event type.
- Added profile management tests to verify upsert behavior and retrieval of multiple facet types.
- Implemented query tests to confirm retrieval of episodic and event hits, ensuring accurate memory querying.
- Expanded segment management tests to validate segment ordering and summary handling.

These additions improve test coverage and reliability of the memory and archivist functionalities.

* style: apply cargo fmt to new test code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(archivist, memory): enhance segment management and event handling

- Updated the `manage_segment` function to utilize the current episodic ID for turn appending and segment creation, ensuring accurate tracking of conversation turns.
- Improved event extraction logic to run outside of transactions, allowing for better handling of SQLite connection locks.
- Added `episodic_relevance` to chunk metadata for improved memory hit scoring.
- Enhanced FTS5 event search to be scoped by namespace, improving query accuracy.
- Introduced a new utility function for safe UTF-8 string truncation, enhancing content display consistency.

These changes improve the reliability and accuracy of conversation segmentation and memory operations.

* fix(archivist): use <= for segment end_timestamp filter bound

The strict < bound excluded entries at the exact end_timestamp, causing
extraction to miss content when turns have near-identical timestamps
(common in tests and rapid interactions).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:29:40 -07:00
dd2e33e1c6 fix: onboarding flow - registry skills, config-based flag, dead code cleanup (#177)
* feat(onboarding): enhance onboarding steps with back navigation and UI improvements

- Added back navigation functionality to all onboarding steps (LocalAIStep, ScreenPermissionsStep, SkillsStep, ToolsStep, MnemonicStep) for improved user experience.
- Updated Onboarding component to adjust total steps from 7 to 6.
- Modified ProgressIndicator to reflect the change in total steps.
- Enhanced LocalAIStep UI by removing unnecessary state and improving layout.
- Improved error handling and user feedback in MnemonicStep and ScreenPermissionsStep.
- General UI refinements across onboarding steps for better consistency and usability.

* refactor(onboarding): update skip button and UI elements for improved user experience

- Replaced "Set up later" button with a "Skip" button in the Onboarding component for better clarity.
- Removed unnecessary back navigation buttons from LocalAIStep to streamline the UI.
- Enhanced messaging in ScreenPermissionsStep to clarify data processing and permissions.
- Adjusted button layouts for improved accessibility and consistency across onboarding steps.

* refactor(onboarding): streamline button layout and styling in onboarding steps

- Updated button styles in ScreenPermissionsStep and ToolsStep for consistency and improved user experience.
- Replaced the back navigation button in ToolsStep with a full-width continue button, enhancing layout and accessibility.

* refactor(onboarding): update ProgressIndicator and button styles for improved consistency

- Adjusted ProgressIndicator component to use 'bg-sage-500' for active steps and increased height for better visibility.
- Streamlined button styles in LocalAIStep and SkillsStep for a more cohesive user experience, including removing unnecessary margins and ensuring full-width buttons where applicable.
- Enhanced ToolsStep to focus on skill installation, updating UI elements and descriptions for clarity and improved user engagement.

* refactor(onboarding): update SkillsStep title and description for clarity

- Changed the title from "Install Skills" to "Connect Skills" to better reflect the action.
- Revised the description to clarify that skills interact with the user's workflow and that all data is processed locally, enhancing user understanding of the feature.

* refactor(onboarding): enhance onboarding steps with UI improvements and functionality updates

- Integrated useUser hook in Onboarding component for better user state management.
- Updated MnemonicStep title and messaging for clarity, emphasizing the importance of the recovery phrase.
- Streamlined button layout in MnemonicStep and ScreenPermissionsStep for improved accessibility and consistency.
- Refactored SkillsStep to utilize available skills more effectively, enhancing the user experience with clearer skill descriptions and connection statuses.
- Transitioned ToolsStep to focus on enabling tools, updating UI elements and descriptions for better user guidance.

* refactor(onboarding): replace workspace flag checks with onboarding_completed config

- Removed Redux state checks for onboarding status and workspace flags.
- Integrated new core config methods to read and write onboarding completion status.
- Updated OnboardingOverlay and Onboarding components to utilize onboarding_completed for flow control.
- Enhanced error handling and user feedback during onboarding state persistence.

* refactor(onboarding): remove deferred flow and dead workspace flag code

The onboarding_completed config field is now the sole source of truth.
Skip and complete both write the same flag. Remove SetupBanner,
onboardingDeferredByUser, selectOnboardingDeferred, and the old
workspace flag file functions (openhumanWorkspaceOnboardingFlagExists/Set).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve lint errors for unused onBack params in onboarding steps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unused handleSkip in LocalAIStep

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:29:19 -07:00
6f8b5d6c9f feat(docker): Dockerfile, cloud server support, and parallel release pipeline (#174)
* added doceker build

* added docker files

* feat(ci): add Docker build phase to release pipeline and .dockerignore

Restructure release.yml into parallel build phases: build-desktop (matrix)
and build-docker run concurrently after create-release. Docker image is
pushed to GHCR and pull instructions are appended to release notes.
publish-release now gates on both phases succeeding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt to jsonrpc host binding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(review): address PR review findings

- .env.example: comment out OPENHUMAN_CORE_HOST so Docker's 0.0.0.0
  default isn't overridden when users copy the example file
- cli.rs: add --host to print_general_help() usage line for consistency
- jsonrpc.rs: use tuple bind (host, port) for IPv6 support, add
  debug logging with source tracking (CLI/env/default) before bind
- release.yml: push only staging tag in build-docker, promote to
  versioned + latest in publish-release after all builds succeed;
  cleanup-failed-release deletes the staging image on failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:58:37 -07:00
sanil-23andGitHub f5b66de2f1 fix: unwrap API envelope in memory tauriCommands and fix file path scope (#172)
After the controller registry migration (#138), memory RPC methods
return ApiEnvelope responses but the frontend expected flat data.
This caused "map is not a function" errors on the Intelligence page.

- Unwrap envelope in memoryListDocuments, memoryListNamespaces,
  aiListMemoryFiles, and aiReadMemoryFile in tauriCommands.ts
- Fix resolve_existing_memory_path and resolve_writable_memory_path
  to scope against workspace root instead of memory/ subdirectory —
  workspace files (MEMORY.md, SOUL.md) live at the root

Closes #170
2026-04-01 11:01:00 -07:00
sanil-23andGitHub 2383d51ea6 revert: remove unnecessary prompt and parser changes from #156 (#169)
The actual fix in #156 was adding chat(ChatRequest) to
ReliableProvider. The prompt changes in instructions.rs and the
bracket tool call parser in parse.rs were added during investigation
but are not needed — the model uses native tool calls when
ReliableProvider properly delegates to the inner provider.
2026-04-01 21:08:23 +05:30
3c247a2439 Feat/humanlike replies (#168)
* fix(chat): prevent stacked socket listeners on reconnect

subscribeChatEvents was declared async despite having no awaits, so the
cleanup function was returned in a microtask after React's synchronous
cleanup had already run. Each socket reconnect added another layer of
listeners that were never removed, causing chat:done to fire N times and
produce duplicate message bubbles.

- Remove async keyword from subscribeChatEvents; return cleanup fn directly
- Update useEffect call site to store cleanup synchronously and return it
  to React (eliminates the mounted/then race entirely)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(local-ai): add multi-turn chat via Ollama /api/chat

Expose openhuman.local_ai_chat RPC method so the UI can run full
conversation-history chat directly through the bundled Ollama model
without touching the cloud inference API.

- ollama_api.rs: add OllamaChatMessage / OllamaChatRequest / OllamaChatResponse
  types for the /api/chat endpoint
- service/public_infer.rs: add LocalAiService::chat_with_history() — sends
  multi-turn message array to Ollama, updates latency/TPS status on response
- ops.rs: add LocalAiChatMessage struct and local_ai_chat async op
- schemas.rs: register local_ai_chat controller (schema, handler, params)
  in all_controller_schemas + all_registered_controllers

Zero cloud tokens are consumed on this path; the call never reaches the
backend socket or the /openai/v1/chat/completions endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(conversations): local-model chat gate with multi-bubble delivery

When Ollama is ready (isLocalModelActive), handleSendMessage bypasses
the cloud socket entirely and routes through openhumanLocalAiChat.
Response is segmented and delivered as multiple typed bubbles with
natural pauses — human-like reply behaviour at zero cloud token cost.

UI / delivery
- deliverLocalResponse(): segments full reply via segmentMessage(),
  dispatches each bubble with getSegmentDelay() pause between them;
  typing indicator (isDelivering) shows between segments
- Socket-connected guard skipped on local path so offline local use works
- Cloud socket path (chatSend → chat:done) fully unchanged

Frontend RPC
- tauriCommands: openhumanLocalAiChat(messages, maxTokens?) wraps
  openhuman.local_ai_chat via core RPC; LocalAiChatMessage type exported

Tests (402 passing)
- messageSegmentation: 4 new edge-case tests (whitespace, 80-char
  boundary, paragraph split, delay scaling)
- localChatGating (new file): 9 tests — segmentation correctness, delay
  bounds [500, 1400] ms, sender→role mapping for message history build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(prompts): replace vague emoji guidance with explicit contextual rules

The previous "Minimal — match the user's style" instruction was too
loose, causing the model to stack decorative emojis on every message
(e.g. "Hey! 😄 Just cooking up some AI magic! 🚀🔥").

SOUL.md — add Emoji Rules section:
- Hard cap: one emoji maximum per message; none is always acceptable
- Contextual, not decorative: emoji must reinforce the specific content
  (🔥 for exciting news, 🤔 for uncertainty,  for confirmations)
- Never open a sentence with an emoji
- Skip entirely in error/warning/technical/long responses
- Mirror the user's own emoji usage pattern
- Concrete good/bad examples so the model can calibrate

BOOTSTRAP.md — tighten the Communication Preferences entry to reference
the same rules rather than the old vague one-liner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: scope PR_DESCRIPTION.md to feat/humanlike-replies only

Remove unrelated package manager distribution content (was from a
different branch). Description now covers only the 4 commits on this
branch: socket listener fix, Rust local_ai_chat RPC, frontend local
chat gate + multi-bubble delivery, and emoji prompt rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(local_ai): improve code formatting and readability in chat operations

- Adjusted formatting in local_ai_chat function for better readability by adding line breaks.
- Simplified the mapping of messages to OllamaChatMessage in ops.rs.
- Streamlined the await syntax in schemas.rs for clarity.
- Enhanced formatting in public_infer.rs for consistency in API request construction.

* refactor(conversations): enhance code readability and structure in Conversations component

- Improved formatting and consistency in the Conversations component, including better alignment of dispatch calls and message handling logic.
- Removed redundant imports and streamlined the mapping of stored messages for clarity.
- Adjusted conditional rendering for improved readability in the UI logic.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:43:27 +05:30
sanil-23andGitHub 305c58a6ec fix: reduce agent loop hallucination and improve tool call reliability (#156)
* fix: reduce agent loop hallucination and improve tool call reliability

- Strengthen tool-use instructions with explicit anti-hallucination rules:
  "NEVER narrate tool use without emitting tags", "use exact tool names",
  "only respond without tool call when no tool is needed"
- Wire context guard into tool loop: check utilization before each LLM
  call, abort on context exhaustion (>95% with circuit breaker tripped)
- Add 120-second timeout on tool execution to prevent hangs
- Add debug/warn/error logging at all loop boundaries: LLM request,
  response (with token counts), tool call parsing, tool execution,
  unknown tools, timeouts, and final response

Closes #144

* fix: implement chat(ChatRequest) on ReliableProvider and add bracket tool call parser

Root cause: ReliableProvider did not implement the chat(ChatRequest)
trait method. The agent loop called provider.chat() which fell through
to the default trait implementation — this used chat_with_history()
which strips native tool support and sends raw tool-role messages
without the required assistant tool_calls, causing the backend Jinja
template to reject the request with "Message has tool role, but there
was no previous assistant message with a tool call!"

Fixes:
- Add chat(ChatRequest) to ReliableProvider with full retry/failover
  logic, matching the existing chat_with_system/chat_with_history
  implementations. Delegates to inner provider's chat() which properly
  converts messages to native OpenAI format with tool_calls.
- Add [TOOL_CALL]/[/TOOL_CALL] bracket format to the tool call parser
  (parse.rs) — some models emit this format instead of <tool_call> XML.
- Add parse_bracket_tool_call() for the pseudo-syntax format:
  {tool => "name", args => { --key "value" }}

Verified with real staging backend (agentic-v1 model):
- Shell tool calls execute successfully
- File read tool calls return real content
- Knowledge questions return without tool calls
- No Jinja template errors

Closes #144
2026-04-01 19:29:31 +05:30
YellowSnnowmannandGitHub 64eb513071 feat(billing, team): add billing and team management RPC functionality (#159)
* feat(billing, team): add billing and team management RPC functionality

- Introduced billing module with methods for fetching current plans, purchasing plans, creating portal sessions, and topping up credits.
- Added team management module with methods for listing team members, creating invites, listing invites, removing members, and changing member roles.
- Updated core registry to include new billing and team controllers and schemas, enhancing the overall functionality of the application.
- Implemented comprehensive tests for billing and team RPC methods to ensure reliability and correctness.

These additions improve the application's capabilities in managing billing and team functionalities, providing a more robust user experience.

* refactor(billing, team): improve code readability and structure

* fix(billing, team): enhance error handling and response structure

- Improved error handling in  to provide clearer error messages when reading response bodies.
- Updated validation in  to ensure  is a finite number greater than zero.
- Refined output schemas for billing and team functions to include more descriptive fields, enhancing API clarity.
- Introduced a new  function to standardize URL path construction, improving code maintainability.
- Added tests to verify the correctness of new output structures and API path building.

These changes enhance the robustness and usability of the billing and team management functionalities.

* feat(billing, team): add gateway normalization and route redaction functionality

- Introduced  function to standardize payment gateway inputs, ensuring only valid options (stripe, coinbase) are accepted, with defaults and error handling.
- Enhanced  function to utilize the new gateway normalization logic, improving input validation.
- Added  function to obscure sensitive identifiers in API route paths, enhancing security in logging.
- Implemented unit tests for both  and  to ensure correctness and reliability of the new features.

These changes improve the robustness of billing operations and enhance security in route handling.
2026-04-01 19:29:05 +05:30
ed83cae117 feat(agent): multi-agent harness with 8 archetypes, DAG planning, and episodic memory (#155)
* refactor(agent): update default model configuration and pricing structure

- Changed the default model name in `AgentBuilder` to use a constant `DEFAULT_MODEL` instead of a hardcoded string.
- Introduced new model constants (`MODEL_AGENTIC_V1`, `MODEL_CODING_V1`, `MODEL_REASONING_V1`) in `types.rs` for better clarity and maintainability.
- Refactored the pricing structure in `identity_cost.rs` to utilize the new model constants, improving consistency across the pricing definitions.

These changes enhance the configurability and readability of the agent's model and pricing settings.

* refactor(models): update default model references and suggestions

- Replaced hardcoded model names with a constant `DEFAULT_MODEL` in multiple files to enhance maintainability.
- Updated model suggestions in the `TauriCommandsPanel` and `Conversations` components to reflect new model names, improving user experience and consistency across the application.

These changes streamline model management and ensure that the application uses the latest model configurations.

* style: fix Prettier formatting for model suggestions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(agent): introduce multi-agent harness with archetypes and task DAG

- Added a new module for the multi-agent harness, defining 8 specialized archetypes (Orchestrator, Planner, CodeExecutor, SkillsAgent, ToolMaker, Researcher, Critic, Archivist) to enhance task management and execution.
- Implemented a Directed Acyclic Graph (DAG) structure for task planning, allowing the Planner archetype to create and manage task dependencies.
- Introduced a session queue to serialize tasks within sessions, preventing race conditions and enabling parallelism across different sessions.
- Updated configuration schema to support orchestrator settings, including per-archetype configurations and maximum concurrent agents.

These changes significantly improve the agent's architecture, enabling more complex task management and execution strategies.

* feat(agent): implement orchestrator executor and interrupt handling

- Introduced a new `executor.rs` module for orchestrated multi-agent execution, enabling a structured run loop that includes planning, executing, reviewing, and synthesizing tasks.
- Added an `interrupt.rs` module to handle graceful interruptions via SIGINT and `/stop` commands, ensuring running sub-agents can be cancelled and memory flushed appropriately.
- Implemented a self-healing interceptor in `self_healing.rs` to automatically create polyfill scripts for missing commands, enhancing the robustness of tool execution.
- Updated the `mod.rs` file to include new modules and functionalities, improving the overall architecture of the agent harness.

These changes significantly enhance the agent's capabilities in managing multi-agent workflows and handling interruptions effectively.

* feat(agent): implement orchestrator executor and interrupt handling

- Introduced a new `executor.rs` module for orchestrated multi-agent execution, enabling a structured run loop that includes planning, executing, reviewing, and synthesizing tasks.
- Added an `interrupt.rs` module to handle graceful interruptions via SIGINT and `/stop` commands, ensuring running sub-agents are cancelled and memory is flushed.
- Implemented a `SelfHealingInterceptor` in `self_healing.rs` to automatically generate polyfill scripts for missing commands, enhancing the agent's resilience.
- Updated the `mod.rs` file to include new modules and functionalities, improving the overall architecture of the agent harness.

These changes significantly enhance the agent's ability to manage complex tasks and respond to interruptions effectively.

* feat(agent): add context assembly module for orchestrator

- Introduced a new `context_assembly.rs` module to handle the assembly of the bootstrap context for the orchestrator, integrating identity files, workspace state, and relevant memory.
- Implemented functions to load archetype prompts and identity contexts, enhancing the orchestrator's ability to generate a comprehensive system prompt.
- Added a `BootstrapContext` struct to encapsulate the assembled context, improving the organization and clarity of context management.
- Updated `mod.rs` to include the new context assembly module, enhancing the overall architecture of the agent harness.

These changes significantly improve the orchestrator's context management capabilities, enabling more effective task execution and user interaction.

* style: apply cargo fmt to multi-agent harness modules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve merge conflict in config/mod.rs re-exports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR review findings — security, correctness, observability

Inline fixes:
- executor: wire semaphore to enforce max_concurrent_agents cap
- executor: placeholder sub-agents now return success=false
- executor: halt DAG when level has failed tasks after retries
- self_healing: remove overly broad "not found" pattern
- session_queue: fix gc() race with acquire() via Arc::strong_count check
- skills_agent.md: reference injected memory context, not memory_recall tool
- init.rs: run EPISODIC_INIT_SQL during UnifiedMemory::new()
- ask_clarification: make "question" param optional to match execute() default
- insert_sql_record: return success=false for unimplemented stub
- spawn_subagent: return success=false for unimplemented stub
- run_linter: reject absolute paths and ".." in path parameter
- run_tests: catch spawn/timeout errors as ToolResult, fix UTF-8 truncation
- update_memory_md: add symlink escape protection, use async tokio::fs::write

Nitpick fixes:
- archivist: document timestamp offset intent
- dag: add tracing to validate(), hoist id_map out of loop in execution_levels()
- session_queue: add trace logging to acquire/gc
- types: add serde(rename_all) to ReviewDecision, preserve sub-second Duration
- ORCHESTRATOR.md: add escalation rule for Core handoff
- read_diff: add debug logging, simplify base_str with Option::map
- workspace_state: add debug logging at entry and exit
- run_tests: add debug logging for runner selection and exit status

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:00:17 -07:00
a1932408dd refactor(models): standardize to reasoning-v1, agentic-v1, coding-v1 (#152)
* refactor(agent): update default model configuration and pricing structure

- Changed the default model name in `AgentBuilder` to use a constant `DEFAULT_MODEL` instead of a hardcoded string.
- Introduced new model constants (`MODEL_AGENTIC_V1`, `MODEL_CODING_V1`, `MODEL_REASONING_V1`) in `types.rs` for better clarity and maintainability.
- Refactored the pricing structure in `identity_cost.rs` to utilize the new model constants, improving consistency across the pricing definitions.

These changes enhance the configurability and readability of the agent's model and pricing settings.

* refactor(models): update default model references and suggestions

- Replaced hardcoded model names with a constant `DEFAULT_MODEL` in multiple files to enhance maintainability.
- Updated model suggestions in the `TauriCommandsPanel` and `Conversations` components to reflect new model names, improving user experience and consistency across the application.

These changes streamline model management and ensure that the application uses the latest model configurations.

* style: fix Prettier formatting for model suggestions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:36:33 -07:00
35be5e99e8 feat(agent): architecture improvements — context guard, cost tracking, permissions, events (#151)
* chore(workflows): comment out Windows smoke tests in installer and release workflows

* feat: add usage field to ChatResponse structure

- Introduced a new `usage` field in the `ChatResponse` struct across multiple files to track token usage information.
- Updated various test cases and response handling to accommodate the new field, ensuring consistent behavior in the agent's responses.
- Enhanced the `Provider` trait and related implementations to include the `usage` field in responses, improving observability of token usage during interactions.

* feat: introduce structured error handling and event system for agent loop

- Added a new `AgentError` enum to provide structured error types, allowing differentiation between retryable and permanent failures.
- Implemented an `AgentEvent` enum for a typed event system, enhancing observability during agent loop execution.
- Created a `ContextGuard` to manage context utilization and trigger auto-compaction, preventing infinite retry loops on compaction failures.
- Updated the `mod.rs` file to include the new `UsageInfo` type for improved observability of token usage.
- Added comprehensive tests for the new error handling and event system, ensuring robustness and reliability in agent operations.

* feat: implement token cost tracking and error handling for agent loop

- Introduced a `CostTracker` to monitor cumulative token usage and enforce daily budget limits, enhancing cost management in the agent loop.
- Added structured error types in `AgentError` to differentiate between retryable and permanent failures, improving error handling and recovery strategies.
- Implemented a typed event system with `AgentEvent` for better observability during agent execution, allowing multiple consumers to subscribe to events.
- Developed a `ContextGuard` to manage context utilization and trigger auto-compaction, preventing excessive resource usage during inference calls.

These enhancements improve the robustness and observability of the agent's operations, ensuring better resource management and error handling.

* style: apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(agent): enhance error handling and event structure

- Updated `AgentError` conversion to attempt recovery of typed errors wrapped in `anyhow`, improving error handling robustness.
- Expanded `AgentEvent` enum to include `tool_arguments` and `tool_call_ids` for better context in tool calls, and added `output` and `tool_call_id` to `ToolExecutionComplete` for enhanced event detail.
- Improved `EventSender` to clamp channel capacity to avoid panics and added tracing for event emissions, enhancing observability during event handling.

* fix(agent): correct error conversion in AgentError implementation

- Updated the conversion logic in the `From<anyhow::Error>` implementation for `AgentError` to return the `agent_err` directly instead of dereferencing it. This change improves the clarity and correctness of error handling in the agent's error management system.

* refactor(config): simplify default implementations for ReflectionSource and PermissionLevel

- Added `#[derive(Default)]` to `ReflectionSource` and `PermissionLevel` enums, removing custom default implementations for cleaner code.
- Updated error handling in `handle_local_ai_set_ollama_path` to streamline serialization of service status.
- Refactored error mapping in webhook registration and unregistration functions for improved readability.

* refactor(config): clean up LearningConfig and PermissionLevel enums

- Removed unnecessary blank lines in `LearningConfig` and `PermissionLevel` enums for improved code readability.
- Consolidated `#[derive(Default)]` into a single line for `PermissionLevel`, streamlining the code structure.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:11:21 -07:00
1b131baf70 feat(webhooks): webhook tunnel routing for skills + remove legacy tunnel module (#147)
* feat(webhooks): implement webhook management interface and routing

- Added a new Webhooks page with TunnelList and WebhookActivity components for managing webhook tunnels and displaying recent activity.
- Introduced useWebhooks hook for handling CRUD operations related to tunnels, including fetching, creating, and deleting tunnels.
- Implemented a WebhookRouter in the backend to route incoming webhook requests to the appropriate skills based on tunnel UUIDs.
- Enhanced the API for tunnel management, including the ability to register and unregister tunnels for specific skills.
- Updated the Redux store to manage webhooks state, including tunnels, registrations, and activity logs.

This update provides a comprehensive interface for managing webhooks, improving the overall functionality and user experience in handling webhook events.

* refactor(tunnel): remove tunnel-related modules and configurations

- Deleted tunnel-related modules including Cloudflare, Custom, Ngrok, and Tailscale, along with their associated configurations and implementations.
- Removed references to TunnelConfig and related functions from the configuration and schema files.
- Cleaned up the mod.rs files to reflect the removal of tunnel modules, streamlining the codebase.

This refactor simplifies the project structure by eliminating unused tunnel functionalities, enhancing maintainability and clarity.

* refactor(config): remove tunnel settings from schemas and controllers

- Eliminated the `update_tunnel_settings` controller and its associated schema from the configuration files.
- Streamlined the `all_registered_controllers` function by removing the handler for tunnel settings, enhancing code clarity and maintainability.

This refactor simplifies the configuration structure by removing unused tunnel-related functionalities.

* refactor(tunnel): remove tunnel settings and related configurations

- Eliminated tunnel-related state variables and functions from the TauriCommandsPanel component, streamlining the settings interface.
- Removed the `openhumanUpdateTunnelSettings` function and `TunnelConfig` interface from the utility commands, enhancing code clarity.
- Updated the core RPC client to remove legacy tunnel method aliases, further simplifying the codebase.

This refactor focuses on cleaning up unused tunnel functionalities, improving maintainability and clarity across the application.

* style: apply prettier and cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:19:04 -07:00
Steven EnamakelGitHubClaude Opus 4.6CodeRabbitcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
262390274d feat(auth): Telegram bot registration flow — /auth/telegram endpoint (#150)
* feat(auth): add /auth/telegram registration endpoint for bot-initiated login

When a user sends /start register to the Telegram bot, the bot sends an
inline button pointing to localhost:7788/auth/telegram?token=<token>.
This new GET handler consumes the one-time login token via the backend,
stores the resulting JWT as the app session, and returns a styled HTML
success/error page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt to telegram auth handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* update format

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
2026-03-31 20:18:54 -07:00
Steven EnamakelGitHubClaude Opus 4.6CodeRabbitcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
684e784896 feat(agent): add self-learning subsystem with post-turn reflection (#149)
* feat(agent): add self-learning subsystem with post-turn reflection

Integrate Hermes-inspired self-learning capabilities into the agent core:

- Post-turn hook infrastructure (hooks.rs): async, fire-and-forget hooks
  that receive TurnContext with tool call records after each turn
- Reflection engine: analyzes turns via local Ollama or cloud reasoning
  model, extracts observations/patterns/preferences, stores in memory
- User profile learning: regex-based preference extraction from user
  messages (e.g. "I prefer...", "always use...")
- Tool effectiveness tracking: per-tool success rates, avg duration,
  common error patterns stored in memory
- tool_stats tool: lets the agent query its own effectiveness data
- LearningConfig: master switch (default off), configurable reflection
  source (local/cloud), throttling, complexity thresholds
- Prompt sections: inject learned context and user profile into system
  prompt when learning is enabled

All storage uses existing Memory trait with Custom categories. All hooks
fire via tokio::spawn (non-blocking). Everything behind config flags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: apply CodeRabbit auto-fixes

Fixed 6 file(s) based on 7 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix(learning): address PR review — sanitization, async, atomicity, observability

Fixes all findings from PR review:

1. Sanitize tool output: Replace raw output_snippet with sanitized
   output_summary via sanitize_tool_output() — strips PII, classifies
   error types, never stores raw payloads in ToolCallRecord

2. Env var overrides: Add OPENHUMAN_LEARNING_* env vars in
   apply_env_overrides() — enabled, reflection_enabled,
   user_profile_enabled, tool_tracking_enabled, skill_creation_enabled,
   reflection_source (local/cloud), max_reflections_per_session,
   min_turn_complexity

3. Sanitize prompt injection: Pre-fetch learned context async in
   Agent::turn(), pass through PromptContext.learned field, sanitize via
   sanitize_learned_entry() (truncate, strip secrets) — no raw
   entry.content in system prompt

4. Remove blocking I/O: Replace std::thread::spawn + Handle::block_on
   in prompt sections with async pre-fetch in turn() + data passed via
   PromptContext.learned — fully non-blocking prompt building

5. Per-session throttling: Replace global AtomicUsize with per-session
   HashMap<String, usize> under Mutex, rollback counter on reflection or
   storage failure

6. Atomic tool stats: Add per-tool tokio::sync::Mutex to serialize
   read-modify-write cycles, preventing lost concurrent updates

7. Tool registration tracing: Add tracing::debug for ToolStatsTool
   registration decision in ops.rs

8. System prompt refresh: Rebuild system prompt on subsequent turns when
   learning is enabled, replacing system message in history so newly
   learned context is visible

9. Hook observability: Add dispatch-level debug logging (scheduling,
   start time, completion duration, error timing) to fire_hooks

10. tool_stats logging: Add debug logging for query filter, entry count,
    parse failures, and filter misses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
2026-03-31 19:56:52 -07:00
58b8a0dd4d fix(skills): persist OAuth credentials and fix skill auto-start lifecycle (#146)
* refactor(deep-link): streamline OAuth handling and skill setup process

- Removed the RPC call for persisting setup completion, now handled directly in the preferences store.
- Updated comments in the deep link handler to clarify the sequence of operations during OAuth completion.
- Enhanced the `set_setup_complete` function to automatically enable skills upon setup completion, improving user experience during skill activation.

This refactor simplifies the OAuth deep link handling and ensures skills are automatically enabled after setup, enhancing the overall flow.

* feat(skills): enhance SkillSetupModal and snapshot fetching with polling

- Added a mechanism in SkillSetupModal to sync the setup mode when the setup completion status changes, improving user experience during asynchronous loading.
- Updated the useSkillSnapshot and useAllSkillSnapshots hooks to include periodic polling every 3 seconds, ensuring timely updates from the core sidecar and enhancing responsiveness to state changes.

These changes improve the handling of skill setup and snapshot fetching, providing a more seamless user experience.

* fix(ErrorFallbackScreen): update reload button behavior to navigate to home before reloading

- Modified the onClick handler of the reload button to first set the window location hash to '#/home' before reloading the application. This change improves user experience by ensuring users are directed to the home screen upon reloading.

* refactor(intelligence-api): simplify local-only hooks and remove unused code

- Refactored the `useIntelligenceApiFallback` hooks to focus on local-only implementations, removing reliance on backend APIs and mock data.
- Streamlined the `useActionableItems`, `useUpdateActionableItem`, `useSnoozeActionableItem`, and `useChatSession` hooks to operate solely with in-memory data.
- Updated comments for clarity on the local-only nature of the hooks and their intended usage.
- Enhanced the `useIntelligenceStats` hook to derive entity counts from local graph relations instead of fetching from a backend API, improving performance and reliability.
- Removed unused imports and code related to backend interactions, resulting in cleaner and more maintainable code.

* feat(intelligence): add active tab state management for Intelligence component

- Introduced a new `IntelligenceTab` type to manage the active tab state within the Intelligence component.
- Initialized the `activeTab` state to 'memory', enhancing user experience by allowing tab-specific functionality and navigation.

This update lays the groundwork for future enhancements related to tabbed navigation in the Intelligence feature.

* feat(intelligence): implement tab navigation and enhance UI interactions

- Added a tab navigation system to the Intelligence component, allowing users to switch between 'Memory', 'Subconscious', and 'Dreams' tabs.
- Integrated conditional rendering for the 'Analyze Now' button, ensuring it is only displayed when the 'Memory' tab is active.
- Updated the UI to include a 'Coming Soon' label for the 'Subconscious' and 'Dreams' tabs, improving user awareness of upcoming features.
- Enhanced the overall layout and styling for better user experience and interaction.

* refactor(intelligence): streamline UI text and enhance OAuth credential handling

- Simplified text rendering in the Intelligence component for better readability.
- Updated the description for subconscious and dreams sections to provide clearer context on functionality.
- Refactored OAuth credential handling in the QjsSkillInstance to utilize a data directory for persistence, improving credential management and recovery.
- Enhanced logging for OAuth credential restoration and persistence, ensuring better traceability of actions.

* fix(skills): update OAuth credential handling in SkillManager

- Modified the SkillManager to use `credentialId` instead of `integrationId` for OAuth notifications, aligning with the expectations of the JS bootstrap's oauth.fetch.
- Enhanced the parameters passed during the core RPC call to include `grantedScopes` and ensure the provider defaults to "unknown" if not specified, improving the robustness of the skill activation process.

* fix(skills): derive modal mode from snapshot instead of syncing via effect

Avoids the react-hooks/set-state-in-effect lint warning by deriving
the setup/manage mode directly from the snapshot's setup_complete flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(ErrorFallbackScreen): format reload button onClick handler for improved readability

- Reformatted the onClick handler of the reload button to enhance code readability by adding line breaks.
- Updated import order in useIntelligenceStats for consistency.
- Improved logging format in event_loop.rs and js_helpers.rs for better traceability of OAuth credential actions.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:37:41 -07:00
3369454cbe fix(local-ai): Ollama bootstrap failure UX and auto-recovery (#142)
* feat(local-ai): enhance Ollama installation and path configuration

- Added a new command to set a custom path for the Ollama binary, allowing users to specify a manually installed version.
- Updated the LocalModelPanel and Home components to reflect the installation state, including progress indicators for downloading and installing.
- Enhanced error handling to display detailed installation errors and provide guidance for manual installation if needed.
- Introduced a new state for 'installing' to improve user feedback during the Ollama installation process.
- Refactored related components and utility functions to accommodate the new installation flow and error handling.

This update improves the user experience by providing clearer feedback during the Ollama installation process and allowing for custom binary paths.

* feat(local-ai): enhance LocalAIDownloadSnackbar and Home component

- Updated LocalAIDownloadSnackbar to display installation phase details and improve progress bar animations during the installation state.
- Refactored the display logic to show 'Installing...' when in the installing phase, enhancing user feedback.
- Modified Home component to present warnings in a more user-friendly format, improving visibility of local AI status warnings.

These changes improve the user experience by providing clearer feedback during downloads and installations.

* feat(onboarding): update LocalAIStep to integrate Ollama installation

- Added Ollama SVG icon to the LocalAIStep component for visual representation.
- Updated text to clarify that OpenHuman will automatically install Ollama for local AI model execution.
- Enhanced privacy and resource impact descriptions to reflect Ollama's functionality.
- Changed button text to "Download & Install Ollama" for clearer user action guidance.
- Improved messaging for users who skip Ollama installation, emphasizing future setup options.

These changes enhance user understanding and streamline the onboarding process for local AI model usage.

* feat(onboarding): update LocalAIStep and LocalAIDownloadSnackbar for improved user experience

- Modified the LocalAIStep component to include a "Setup later" button for user convenience and updated the messaging to clarify the installation process for Ollama.
- Enhanced the LocalAIDownloadSnackbar by repositioning it to the bottom-right corner for better visibility and user interaction.
- Updated the Ollama SVG icon to include a white background for improved contrast and visibility.

These changes aim to streamline the onboarding process and enhance user understanding of the local AI installation and usage.

* feat(local-ai): add diagnostics functionality for Ollama server health check

- Introduced a new diagnostics command to assess the Ollama server's health, list installed models, and verify expected models.
- Updated the LocalModelPanel to manage diagnostics state and display errors effectively.
- Enhanced error handling for prompt testing to provide clearer feedback on issues encountered.
- Refactored related components and utility functions to support the new diagnostics feature.

These changes improve the application's ability to monitor and report on the local AI environment, enhancing user experience and troubleshooting capabilities.

* feat(local-ai): add Ollama diagnostics section to LocalModelPanel

- Introduced a new diagnostics feature in the LocalModelPanel to check the health of the Ollama server, display installed models, and verify expected models.
- Implemented loading states and error handling for the diagnostics process, enhancing user feedback during checks.
- Updated the UI to present diagnostics results clearly, including server status, installed models, and any issues found.

These changes improve the application's monitoring capabilities for the local AI environment, aiding in troubleshooting and user experience.

* feat(local-ai): implement auto-retry for Ollama installation on degraded state

- Enhanced the Home component to include a reference for tracking auto-retry status during Ollama installation.
- Updated the local AI service to retry the installation process if the server state is degraded, improving resilience against installation failures.
- Introduced a new method to force a fresh install of the Ollama binary, ensuring that users can recover from initial setup issues more effectively.

These changes enhance the reliability of the local AI setup process, providing a smoother user experience during installation and recovery from errors.

* feat(local-ai): improve Ollama server management and diagnostics

- Refactored the Ollama server management logic to include a check for the runner's health, ensuring that the server can execute models correctly.
- Introduced a new method to verify the Ollama runner's functionality by sending a lightweight request, enhancing error handling for server issues.
- Added functionality to kill any stale Ollama server processes before restarting with the correct binary, improving reliability during server restarts.
- Updated the server startup process to streamline the handling of server health checks and binary resolution.

These changes enhance the robustness of the local AI service, ensuring better management of the Ollama server and improved diagnostics for user experience.

* style: apply prettier and cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 15:34:53 -07:00
c5e5ae170c ci: speed up GitHub Actions builds (~14m → ~3-5m warm) (#136)
* chore: add CI profile for faster compilation in Cargo.toml files

- Introduced a new `[profile.ci]` section in both root and Tauri Cargo.toml files to optimize build settings for continuous integration.
- Adjusted compilation parameters to prioritize speed over runtime performance, including reduced optimization level and enabled code generation units.

* refactor(tests): update agent test setup to return temporary directory

- Modified the `build_agent_with` function calls in the agent tests to return a temporary directory alongside the agent instance, improving resource management during tests.
- Ensured consistency in test setup across multiple test functions.

* chore: update .gitignore to include fastembed_cache

- Added 'workflow' and '.fastembed_cache' to the .gitignore file to prevent unnecessary files from being tracked in the repository.

* test: enhance dispatch routing tests with panic handling

Updated the `dispatch_routes_memory_doc_ingest` test to use `AssertUnwindSafe` and `catch_unwind` for better handling of potential panics during execution. This ensures that the test verifies route existence even if the handler encounters a panic, improving robustness against shared state issues in concurrent tests.

* ci: speed up builds with rust-cache, sccache, mold linker, and CI profile

- Replace manual Cargo registry cache with Swatinem/rust-cache@v2 (caches
  target/ directories for both core and Tauri crates)
- Add mozilla-actions/sccache for cross-branch compilation caching
- Install mold linker on Linux for faster linking
- Use --profile ci for sidecar build (opt-level 1, codegen-units 16)
- Override release profile env vars for Tauri build with CI-tuned settings
- Add --bundles none to CI build (skip unused deb/appimage packaging)
- Restrict push triggers to main branch only (PRs already cover feature
  branches, preventing duplicate runs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): unset RUSTC_WRAPPER for cargo fmt to avoid sccache errors

The sccache-action sets RUSTC_WRAPPER globally for the job. cargo fmt
invokes rustc through sccache which fails if the GHA cache service is
unavailable. Clear RUSTC_WRAPPER for fmt steps and remove redundant
per-step env overrides (the action already sets them job-wide).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: implement Default trait for various structs and enums

- Added Default implementations for ConnectionStatus, AgentBuilder, NativeRuntime, AutocompleteEngine, CliChannel, ActionTracker, SkillStatus, and ExtractionMode to streamline object initialization.
- Simplified condition checks in several places by replacing map_or with is_some_and and is_none_or for better readability and performance.
- Updated various instances of string handling in message sending to remove unnecessary conversions.

This refactor enhances code clarity and consistency across the codebase.

* style: clean up whitespace and improve code formatting

- Removed unnecessary blank lines in several files to enhance code readability.
- Simplified condition checks by consolidating method calls into single lines for better clarity.
- Improved formatting in various functions to maintain consistency across the codebase.

* fix(ci): use --bundles deb instead of unsupported none value

Tauri CLI on this version doesn't support 'none' as a bundle type.
Use 'deb' as the lightest single bundle to minimize packaging time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(ci): add Dockerfile and CI workflows for building and pushing Docker images

- Introduced a Dockerfile to set up a CI environment with necessary dependencies for Tauri, Rust, Node.js, and sccache.
- Created a new workflow to build and push the CI Docker image to GitHub Container Registry on main branch pushes.
- Updated existing workflows to utilize the new Docker image for building and testing, enhancing consistency and efficiency in CI processes.

* chore(ci): update container image references in CI workflows

- Removed unnecessary permissions for packages in build, test, and typecheck workflows.
- Updated container image references to use a specific digest instead of the latest tag for improved stability and reproducibility in CI processes.

* fix(ci): use correct amd64 Docker image digest

Previous digest was from arm64 build (Mac). Rebuilt with
--platform linux/amd64 for GitHub Actions runners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): use tag instead of digest for Docker image reference

GHCR doesn't support pulling OCI index manifests by digest reliably.
Use the rust-1.93.0 tag which is pinned to a specific Rust version
and resolves correctly on amd64 CI runners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): rename Docker package to openhuman_ci

Move from nested ghcr.io/tinyhumansai/openhuman/ci-runner to
ghcr.io/tinyhumansai/openhuman_ci to avoid GHCR nested package
manifest resolution issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): remove sccache env vars from container jobs

sccache can't access the GHA cache API from inside a Docker container
(missing ACTIONS_CACHE_URL/ACTIONS_RUNTIME_TOKEN). Swatinem/rust-cache
already caches target/ which provides the main build speedup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: update installer smoke workflow to trigger on main branch pushes

- Added a trigger for the installer smoke workflow to run on pushes to the main branch, enhancing CI coverage for mainline changes.

* fix: enhance Sentry DSN retrieval logic

- Updated the Sentry DSN retrieval process to include an additional fallback option using `option_env!`, ensuring that the DSN can be sourced from both environment variables and optional configuration, improving robustness in observability setup.

* chore: add OPENHUMAN_SENTRY_DSN to release workflow and example secrets

- Included the OPENHUMAN_SENTRY_DSN variable in the release workflow configuration to enhance observability setup.
- Updated the ci-secrets.example.json file to include a placeholder for OPENHUMAN_SENTRY_DSN, providing clarity for developers on required environment variables.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:16:12 -07:00
sanil-23andGitHub 600dab4336 refactor: migrate memory service to controller registry pattern (#138)
Move all 23 memory RPC methods from legacy dispatch (src/rpc/dispatch.rs)
to the controller registry pattern with typed schemas.

- Create src/openhuman/memory/schemas.rs with 23 ControllerSchema
  definitions, RegisteredController entries, and handler functions
- Wire memory controllers into src/core/all.rs registry builders
- Remove all memory.* and ai.* branches from dispatch.rs (only
  security_policy_info remains)
- Update frontend to use openhuman.memory_* method names directly
  in tauriCommands.ts (no legacy aliases needed)
- Move ai.list_memory_files/read/write into memory namespace as
  openhuman.memory_list_files/read_file/write_file
- Update jsonrpc.rs and tauriCommandsMemory test method strings

Methods are now accessible via both JSON-RPC (openhuman.memory_*)
and CLI (openhuman memory <function>).
2026-03-31 13:59:21 -07:00
Mega MindandGitHub 2b33afeefe fix(skills): enforce per-skill runtime tool isolation (#140)
* Add unit tests for Mnemonic page

- Introduced comprehensive tests for the Mnemonic page, covering initial render, copy to clipboard functionality, confirmation checkbox behavior, and mode switching between generate and import.
- Validated user interactions, including input handling and button states, ensuring robust functionality and user experience.
- Enhanced test coverage for various scenarios, including validation of mnemonic phrases and loading states during operations.

* test: add cross-stack test coverage for core and tauri flows

Add focused Rust and frontend tests for core process startup behavior, CLI argument parsing, JSON-RPC error handling, and Tauri command/RPC mapping paths to improve confidence for issue #57.

Closes #57

Made-with: Cursor

* refactor(tests): streamline test code and improve readability

Consolidate mock imports and simplify function calls in coreRpcClient tests. Adjust formatting in Rust core_process and CLI tests for better clarity. Update mnemonic test assertions for improved accuracy.

Made-with: Cursor

* fix(e2e): harden deep-link login flow reliability

Stabilize auth deep-link handling and E2E delivery with readiness guards, retries, and new listener unit tests so login/onboarding flows are deterministic for issue #70.

Closes #70

Made-with: Cursor

* refactor(tests): update agent initialization in tests for consistency

Refactor test cases to use a tuple return from `build_agent_with`, improving consistency in agent setup across multiple tests. This change enhances readability and maintains uniformity in the test structure.

Made-with: Cursor

* fix(skills): enforce per-skill runtime tool isolation

Add explicit tool-call origin policy in the QuickJS runtime so skills cannot invoke other skills' tools, while preserving external orchestration through RPC/socket surfaces. Also remove the generic skills_call tool path and document the isolation contract for skill authors.

Closes #94

Made-with: Cursor
2026-03-31 13:58:56 -07:00
77fd5f9edd fix: propagate entity_type into retrieval context for graph visualization (#135)
* feat(memory): connect graph query and doc ingest APIs to frontend

Wire up memory.graph.query and memory.doc.ingest RPC endpoints and
integrate graph relations into the MemoryWorkspace UI, replacing
backend-only entity counts with local graph store data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in MemoryWorkspace and tauriCommands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add unit tests for memory graph query, doc ingest, and dispatch routing

Cover the new graph query and doc ingest APIs added in this PR:
- Rust dispatch tests: routing, param validation, unknown method fallthrough
- Frontend tauriCommands tests: Tauri guard, RPC forwarding for memoryGraphQuery/memoryDocIngest
- MemoryWorkspace component tests: graph relations rendering, evidence badges, empty states

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier and cargo fmt formatting in test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in tauriCommandsMemory test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: merge duplicate tauriCommands import in MemoryWorkspace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in MemoryWorkspace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: propagate entity_type from graph relation attrs into retrieval context

build_retrieval_context was discarding entity types that were already
present in relation attrs.entity_types (populated during ingestion by
GLiNER relex). Entities in MemoryRetrievalEntity now carry their type
(e.g. PERSON, PROJECT, WORK_ITEM) instead of always being None.

Adds unit tests for both typed and untyped paths, plus an ignored
GLiNER smoke test (gline_rs_smoke) that verifies the full pipeline
from Notion fixture ingestion through graph storage to retrieval
context with the real ONNX model.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: sanil jain <jainsanil18@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:37:03 -07:00
906b55b63e feat(observability): add Sentry error reporting to Rust core (#131)
* chore(workflows): comment out Windows smoke tests in installer and release workflows

* feat(observability): integrate Sentry for error reporting and add configuration support

- Added Sentry integration for error reporting in the application, initializing it in the main function.
- Introduced a new environment variable `OPENHUMAN_SENTRY_DSN` to configure Sentry DSN.
- Updated the observability configuration schema to include a field for Sentry DSN.
- Enhanced logging to include Sentry event filtering based on log levels.
- Implemented secret scrubbing to protect sensitive information in error reports.

* feat(analytics): add support for anonymized analytics settings

- Introduced new environment variable `OPENHUMAN_ANALYTICS_ENABLED` to enable or disable anonymized analytics and crash reports.
- Updated the PrivacyPanel component to sync analytics consent with the core configuration.
- Added new functions to handle analytics settings updates and retrieval in the Tauri backend.
- Enhanced observability configuration to include analytics settings, defaulting to enabled.
- Updated relevant schemas and handlers for analytics settings in the backend.

* refactor(tauriCommands): improve formatting and structure of analytics settings function

- Reformatted the `openhumanUpdateAnalyticsSettings` function for better readability by adjusting the parameter structure.
- Enhanced the output formatting in the `handle_get_analytics_settings` function for improved clarity in the JSON response.

* feat(analytics): sync analytics consent to core RPC and improve anonymization copy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:18:50 -07:00
Mega MindandGitHub 52b59f62d7 test: add cross-stack coverage for core and tauri flows (#130)
* Add unit tests for Mnemonic page

- Introduced comprehensive tests for the Mnemonic page, covering initial render, copy to clipboard functionality, confirmation checkbox behavior, and mode switching between generate and import.
- Validated user interactions, including input handling and button states, ensuring robust functionality and user experience.
- Enhanced test coverage for various scenarios, including validation of mnemonic phrases and loading states during operations.

* test: add cross-stack test coverage for core and tauri flows

Add focused Rust and frontend tests for core process startup behavior, CLI argument parsing, JSON-RPC error handling, and Tauri command/RPC mapping paths to improve confidence for issue #57.

Closes #57

Made-with: Cursor

* refactor(tests): streamline test code and improve readability

Consolidate mock imports and simplify function calls in coreRpcClient tests. Adjust formatting in Rust core_process and CLI tests for better clarity. Update mnemonic test assertions for improved accuracy.

Made-with: Cursor
2026-04-01 00:25:04 +05:30
4d3b63857f feat(memory): connect graph query and doc ingest APIs (#124)
* feat(memory): connect graph query and doc ingest APIs to frontend

Wire up memory.graph.query and memory.doc.ingest RPC endpoints and
integrate graph relations into the MemoryWorkspace UI, replacing
backend-only entity counts with local graph store data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in MemoryWorkspace and tauriCommands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add unit tests for memory graph query, doc ingest, and dispatch routing

Cover the new graph query and doc ingest APIs added in this PR:
- Rust dispatch tests: routing, param validation, unknown method fallthrough
- Frontend tauriCommands tests: Tauri guard, RPC forwarding for memoryGraphQuery/memoryDocIngest
- MemoryWorkspace component tests: graph relations rendering, evidence badges, empty states

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier and cargo fmt formatting in test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in tauriCommandsMemory test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: merge duplicate tauriCommands import in MemoryWorkspace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting in MemoryWorkspace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: sanil jain <jainsanil18@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 11:01:06 -07:00
Mega MindandGitHub 1a1f948e82 Merge pull request #126 from M3gA-Mind/feat/skills-resetup
feat: re-setup skills runtime and add model-callable skills bridge
2026-03-31 22:06:47 +05:30
M3gA-Mind 9aa60e6e42 feat(agent): add generic skills_call bridge for runtime skill tools
Expose a model-callable `skills_call` tool in the shared tool registry and add coverage for native dispatcher execution of generic skill invocations. Closes #67.

Made-with: Cursor
2026-03-31 22:04:51 +05:30
Mega MindandGitHub f87c2d0894 Merge pull request #125 from M3gA-Mind/feat/skills-resetup
fix(agent): execute fallback tool calls in the loop
2026-03-31 21:48:31 +05:30
M3gA-Mind 7b0e07f8ad fix(agent): execute fallback tool calls in the loop
Unify tool-call parsing across dispatcher paths and persist parsed fallback calls with stable IDs so execution and history stay aligned end-to-end.

Closes #65

Made-with: Cursor
2026-03-31 21:44:04 +05:30
oxoxDevandGitHub 5481c9266e feat(autocomplete): persist accepted completions in memory and reuse them for suggestions (#108) (#119) 2026-03-31 08:08:41 -07:00
Al629176andGitHub e7a7f90fb6 Merge pull request #113 from sanil-23/issue-60-ingestion-relex
Add GLiNER relex ingestion pipeline (#60)
2026-03-31 19:23:25 +05:30
M3gA-MindandClaude Sonnet 4.6 649c381f3d feat: set up openhuman-skills git submodule
- Add openhuman-skills submodule pointing to tinyhumansai/openhuman-skills
- Remove openhuman-skills from .gitignore so the submodule is tracked
- Update skill discovery paths in qjs_engine.rs from skills/skills to
  openhuman-skills/skills (dev cwd, parent, and bundled resource paths)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 19:22:37 +05:30
sanil jainandClaude Opus 4.6 6964abbf5f Fix CI: remove openssl dep, skip ORT init in ingestion tests, fix fmt
- Replace openssl with aes-gcm for AES-256-GCM decryption in rest.rs
- Remove openssl/openssl-sys from Cargo.toml and Cargo.lock
- Use ci_safe_config() in ingestion tests to skip ORT model loading
  (avoids Mutex poisoned panic on CI without libonnxruntime)
- Remove serial_test dependency (no longer needed)
- Fix cargo fmt issue in rest.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 19:03:27 +05:30
cyrus@tinyhumans.ai 6f6cdc5631 merge: resolve Cargo.lock conflict with main 2026-03-31 18:46:31 +05:30
cyrus@tinyhumans.ai 2570195604 feat(local-ai): add guided model tier selection by device capability
Add tiered model presets (Low/Medium/High) with device-aware recommendations
so users can pick a local AI model that fits their machine without editing
raw JSON config. Detect RAM, CPU, GPU via sysinfo crate and recommend a tier.
Persist selection to config.toml, with env var override and graceful
degradation hints on bootstrap failure.

- Rust: presets.rs (tier definitions, recommendation logic), device.rs
  (hardware detection), 3 new RPC methods, env var override, bootstrap hints
- Frontend: tier selector UI in Settings > Local AI Model with device info,
  loading/error states, and "Advanced" toggle for existing controls
- Tests: 7 Rust unit tests + comprehensive JSON-RPC E2E test
- Also fixes pre-existing lint warning in SkillSetupWizard.tsx

Closes #80
2026-03-31 18:43:50 +05:30
sanil jain 3bd86fa4d4 Fix ORT mutex poisoning: serialize ingestion tests
CI runner lacks libonnxruntime so ORT Session::builder panics inside
its internal std::Mutex, poisoning it for the parallel test. Running
them serially avoids the second test hitting the poisoned mutex.
2026-03-31 18:41:29 +05:30
sanil jain 9e6e8cafa5 Fix cargo fmt for fixture path helper 2026-03-31 18:25:34 +05:30
sanil jain c981c33c78 Fix fixture path to use platform-agnostic Path::join
The test fixture loader used Windows backslashes which broke on Linux CI.
2026-03-31 18:20:15 +05:30
sanil jain 0dc1dc25aa Fix CI: remove duplicate libloading in Cargo.lock and cargo fmt
- Remove duplicate `libloading` package entry in Cargo.lock that caused
  `failed to parse lock file` build errors
- Remove extra blank line in ingestion.rs:1098 to pass cargo fmt check
2026-03-31 18:10:16 +05:30
Al629176andGitHub fdbba4f037 Merge pull request #112 from sanil-23/issue-69-memory-rpc
Add core memory RPC surface (#69)
2026-03-31 17:52:14 +05:30
sanil jain c396014632 Merge Linux ONNX runtime fixes into relex branch 2026-03-31 17:49:33 +05:30
cyrus@tinyhumans.ai 064ec59ce0 merge: resolve conflicts with main (memory.md, Cargo.lock) 2026-03-31 17:29:54 +05:30
sanil jain 076b8beb36 Add Linux ONNX runtime bootstrap for relex 2026-03-31 17:28:49 +05:30
sanil jain 55cd5bef45 Fix Linux ONNX runtime loading for embeddings 2026-03-31 17:28:20 +05:30
cyrus@tinyhumans.ai a3fbdc68b1 fix(tests): isolate agent tests with per-test temp directories
All 26 agent tests shared std::env::temp_dir() as workspace, causing
them to contend on the same SQLite database file when running in
parallel. This caused flaky "database is locked" failures in CI
(e.g. clear_history_resets_conversation).

Fix: each test helper now creates its own tempfile::TempDir, returning
it alongside the Agent so it stays alive for the test duration.

Verified: 36/36 pass across 5 consecutive runs with zero flakiness.
2026-03-31 17:28:09 +05:30