Commit Graph
111 Commits
Author SHA1 Message Date
CodeGhost21andGitHub 13ce2cdcbf test(coverage): raise Rust unit test coverage to ≥80% on 10 critical modules (issue #530) (#567)
* test(coverage): raise 9 critical modules to ≥80% line coverage

Pushes unit test coverage to meet issue #530's 80% target on 9 modules:
  socket (17% → 80%), credentials (46% → 81%), composio (55% → 81%),
  memory (75% → 80%), tools (73% → 83%), plus previously-passing
  cron, context, learning, embeddings.

Additions span ~400+ new tests across 44 files:
  - Pure-function tests for types, schemas, parsers, URL builders,
    and error-classification helpers.
  - Mock-backend integration tests using axum for HTTP-dependent
    code (composio client + ops, socket ws_loop against a local
    WebSocket server).
  - End-to-end RPC handler tests using tempdir + OPENHUMAN_WORKSPACE
    env override (credentials, memory, config, cron).

Also fixes 4 pre-existing flaky tests on macOS dev machines by
pinning absolute paths (/bin/ls, /bin/sleep, /bin/sh, /usr/bin/touch)
in cron scheduler tests so sh -lc does not pick up homebrew-shadowed
binaries that macOS SIP refuses to execute, and relaxing a
screen_intelligence capture-permission hang assertion.

Remaining work: voice, config, screen_intelligence, channels,
local_ai still below 80% (62%, 61%, 54%, 68%, 35% respectively).

* test(coverage): add config module tests (62% → ~71%)

Adds tests for:
- config/ops.rs: env_flag_enabled, core_rpc_url_from_env, snapshot_config_json,
  workspace_onboarding_flag_exists/_set, set_browser_allow_all, agent_server_status
- config/schemas.rs: catalog parity, all 21 registered schema keys, helpers
- config/schema/proxy.rs: normalize_*, parse_proxy_scope, parse_proxy_enabled,
  validate_proxy_url, service_selector_matches, ProxyConfig defaults
- config/schema/load.rs: apply_env_overrides for api_key, model, temperature,
  reasoning_enabled, web_search.*, storage.*; resolve_config_dir_for_workspace
- config/settings_cli.rs: settings_section_json all sections (model/memory/runtime/browser/unknown)

* test(coverage): config reaches 80.49%, socket back to 80.10%

- config/ops.rs: apply_model/memory/runtime/browser/analytics/screen_intelligence_settings
  roundtrips via in-memory Config; load_and_apply_dictation/voice_server_settings
  activation-mode validation; get_dictation/voice_server/onboarding readers;
  workspace_onboarding_flag_set/resolve error and happy paths.
- config/schema/load.rs: apply_env_overrides coverage for OPENHUMAN_MODEL,
  OPENHUMAN_TEMPERATURE (range clamp), OPENHUMAN_REASONING_ENABLED,
  OPENHUMAN_WEB_SEARCH_*, OPENHUMAN_STORAGE_* env branches.
- config/schema/proxy.rs: normalize_* helpers, parse_proxy_scope/enabled,
  ProxyConfig defaults, validate_proxy_url schemes + hosts,
  service_selector_matches wildcards.
- config/schemas.rs: every registered controller key, namespace parity.
- config/settings_cli.rs: all section projections (model/memory/runtime/browser/unknown).
- Shared `TEST_ENV_LOCK` at config::mod level so config::ops and config::schema::load
  test modules serialize OPENHUMAN_WORKSPACE mutations.
- socket: a couple more schema assertions to keep module at 80%+.

* test(coverage): channels partial push (68.12% → 68.91%)

- channels/controllers/schemas.rs: every registered key resolves, required
  input coverage for describe/send_message/telegram_login_check.
- channels/providers/web.rs: catalog parity, chat/cancel schema required
  inputs, unknown fallback, key_for, event_session_id_for stability,
  normalize_model_override trimming/empty, broadcast channel subscribe,
  field-builder helpers.
- channels/providers/discord/api.rs: auth_header prefix, BotPermissionCheck
  serde with empty/full missing_permissions lists, permission bit flags
  are single-bit and distinct.

Channels remains below the 80% issue target — the bulk of remaining
uncovered code lives in telegram/channel.rs (574 lines), ops.rs (462),
lark.rs (433) and runtime/startup.rs (350), which depend on live HTTP /
socket / runtime bootstrap state that would require extensive mock
infrastructure to exercise from unit tests.

* test(coverage): partial push on local_ai (34→45%), screen_intelligence (54→62%), voice (62→63%)

- local_ai/schemas.rs: catalog parity, every registered key resolves,
  field-builder helpers, deserialize_params happy/error, download_force optional.
- local_ai/ops.rs: local-ai-disabled error paths for prompt/vision_prompt/
  embed/summarize/transcribe/tts/chat; empty-messages rejection; suggestions
  return empty when disabled (graceful degradation).
- local_ai/install.rs: find_system_ollama_binary env-override happy/missing/
  empty cases; PATH-based lookup stub.
- screen_intelligence/schemas.rs: catalog parity, all 15 registered keys
  resolve to non-unknown, unknown fallback.
- screen_intelligence/ops.rs: accessibility_status/doctor_cli_json/
  capture_image_ref/stop_session/vision_recent error-free behaviour.
- voice/server.rs: truncate_for_log ellipsis + multibyte; try_global_server
  after init; additional hallucination-pattern coverage.

Remaining gap on these modules lives almost entirely in:
- local_ai/service/ollama_admin.rs (625 lines) — real HTTP + Ollama subprocess
- local_ai/service/{assets,public_infer,vision_embed}.rs — same
- voice/{server,audio_capture}.rs deep paths — audio hardware
- screen_intelligence/{engine,processing_worker}.rs — active capture session

* test(coverage): channels providers (+0.9%) — qq ensure_https, lark parsers

- qq: ensure_https accept/reject, QQ_API_BASE/AUTH_URL constants, constructor.
- lark: parse_post_content zh_cn/en_us fallback + links/mentions; invalid
  JSON returns None; strip_at_placeholders for @_user_N tokens; group
  should_respond_in_group mention gating.

* test(coverage): push all 4 remaining modules

- discord/api.rs: list_bot_guilds_at_base/list_guild_channels_at_base test
  seams with mock axum server; parse happy-path, error status, channel
  filter+sort, empty list.
- channels/controllers/ops.rs: parse_allowed_users for string CSV/array/
  newline/@-prefix/case-insensitive dedup/non-string; credential_provider;
  list_channels/describe_channel; connect_channel unknown-channel and
  non-object credentials.
- local_ai/ollama_api.rs: `ollama_base_url()` honours OPENHUMAN_OLLAMA_BASE_URL
  env var so tests can point at mock servers; DEFAULT_OLLAMA_BASE_URL
  preserved.
- local_ai/service/public_infer.rs: mock-backend tests for inference/prompt
  happy path, non-success status, suggest_questions parsing, disabled-
  local-ai short-circuits for summarize/prompt/suggest_questions/
  inline_complete.
- voice/schemas.rs: overlay_notify cancelled→released, unknown state
  errors, missing state errors, server_start handler, TranscribeParams +
  TtsParams deserialize happy/error paths, server_start all-optional
  invariant, description completeness.

* test(coverage): local_ai HTTP mock tests (49→53%)

- ollama_api: ollama_base_url() helper now used by ollama_admin/has_model
  + ollama_healthy (in addition to public_infer + vision_embed).
- public_infer: inference against mock /api/generate happy/error/empty;
  suggest_questions parses line-separated output; disabled short-circuits
  for summarize/prompt/suggest/inline_complete.
- vision_embed: mock /api/embed with /api/tags preflight; empty-input
  rejection; disabled short-circuits for embed and vision_prompt.
- ollama_admin: has_model matches exact + prefixed tags; errors on 5xx
  /api/tags; ollama_healthy true on 200 and false on unreachable URL.

* test(coverage): more local_ai + voice gains

- local_ai/ollama_admin: diagnostics against mock Ollama (unreachable +
  missing models + all models present), list_models happy/error paths.
- voice/dictation_listener: start_if_enabled early-returns for disabled/
  empty-hotkey/unparseable-hotkey; normalize_hotkey_for_rdev coverage
  for Shift+Alt, lowercase, function keys, whitespace trimming.

* test(coverage): local_ai schemas handlers + voice flakiness fix

- local_ai/schemas: handle_device_profile; handle_presets tier+device
  shape; handle_apply_preset invalid/custom/valid paths; handle_set_ollama_path
  nonexistent/empty-to-clear paths.
- voice/schemas: relax server_status/stop assertion to tolerate other
  tests in the same binary having initialised the global voice server
  (it's a OnceLock, so state is shared across the whole test process).

* test(coverage): channels incremental push (71→73%)

- presentation.rs: split_sentences, group_sentences, merge_short,
  segment_delay monotonic/bounded, is_structured_content detection,
  segment_for_delivery edge cases.
- runtime/dispatch.rs: contains_any, starts_with_any, full coverage of
  select_acknowledgment_reaction across all 7 categories + deterministic
  + empty/single-char inputs.
- commands.rs: doctor_channels with telegram/discord/slack/imessage/
  multiple-config branches.
- discord/api: check_channel_permissions mock-server tests — admin bypass,
  all-missing, everyone-allow, channel overwrite deny, member lookup
  failure. Added check_channel_permissions_at_base seam.
- lark: should_refresh_last_recv, LarkChannel::new, is_user_allowed
  wildcard/empty allowlist, parse_event_payload edge cases (unsupported
  type / empty sender / missing event / post type).
- email_channel: is_sender_allowed full matrix (empty/wildcard/exact/
  @-prefix/bare-domain/subdomain-confusion), strip_html empty/tags-only/
  unclosed/whitespace collapse.
- voice/schemas: tolerate event interleaving in broadcast-channel test
  (schema bus is process-global).

* test(coverage): address review findings — assertions, determinism, observability

Tighten assertions so regressions surface:
- credentials/ops: assert decrypt migrate path returns Ok
- credentials/session_support: assert trimmed profile name directly
- computer/mouse: check Err branch in single-axis scroll tests
- filesystem/git_operations: assert exact error substrings and verify
  `git init` success before each test
- channels/controllers/ops: exact credential_provider key + concrete
  parse_allowed_users expectation with accurate normalisation note;
  merged the three duplicate list/describe tests into existing coverage
- tools/impl/browser/screenshot: cfg-branched support-matrix assertions
- tools/impl/agent: replace misleading stub test with one that actually
  exercises dispatch_subagent's graceful-failure paths
- local_ai/install: cfg-branched build_install_command expectations
- local_ai/service/public_infer: exercise empty-response reject path via
  inference() (allow_empty=false) and assert the error
- screen_intelligence: only take the macOS slow-path skip on macOS

Test determinism:
- local_ai/install: serialise env mutations via a module Mutex and RAII
  EnvGuard that restores prior values on drop
- composio/ops: poll TCP readiness with backoff before returning the
  mock-backend URL
- memory/global: bind TempDir at test scope so its workspace outlives
  any lazy-init reference

Consistency:
- local_ai/service/ollama_admin: route every Ollama HTTP call and the
  diagnostics URL through ollama_base_url(); drop the stale
  OLLAMA_BASE_URL import so /api/pull, /api/tags (runner check),
  /api/show, and the health message all honour the env override

Observability:
- local_ai/service/vision_embed: tracing::debug at entry/response and
  tracing::error on send/non-success
- local_ai/service/ollama_admin::list_models: entry/response/parse
  logging including raw body on parse failure
- channels/providers/discord/api: tracing::debug with endpoint, status,
  body, and context before every non-success bail!

New coverage:
- channels/providers/lark: anchor href-only fallback in parse_post_content
- local_ai/ollama_api: five-case env-override suite for ollama_base_url
  (unset / normal / trimmed / trailing slashes / empty|whitespace)

Miscellaneous:
- voice/server: OnceCell-backed comment (was OnceLock); drop duplicate
  initial-status test; supply the HallucinationMode argument to two
  stale hallucination tests so the crate type-checks
2026-04-14 12:52:59 -07:00
github-actions[bot] d5be45d42d chore(release): v0.52.9 2026-04-14 07:12:04 +00:00
github-actions[bot] 95ccf86069 chore(release): v0.52.8 2026-04-14 06:01:16 +00:00
08d9fd2d4d fix(voice): recover buffered hotkey events after select! race (#527) (#545)
* fix(voice): return receiver count from publish_transcription

publish_transcription now returns the number of active TRANSCRIPTION_BUS
subscribers that received the message. When no receivers are connected
(e.g. Socket.IO bridge not yet subscribed), the function logs a warning
instead of silently discarding the broadcast.

This makes it possible to diagnose "transcription produced but never
delivered" scenarios from logs alone.

Closes #527 (partial)

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

* fix(voice): recover buffered hotkey events after select! race

On warm CPAL init (second+ recording), audio_capture::start_recording()
completes fast enough that the pending_ready branch and the hotkey_rx
branch are both ready simultaneously inside tokio::select!. select!
picks one pseudo-randomly — when it picks pending_ready, the Released
event sits unprocessed in hotkey_rx. The recording is stored as "live"
with no deferred stop, then the next loop iteration processes the
buffered Released and stops the recording almost immediately, producing
a near-zero-length clip that the duration gate silently drops.

Fix: after pending_ready resolves, call hotkey_rx.try_recv() to check
for a buffered stop event that lost the race. If found, apply the
deferred stop mechanism (MIN_RECORDING_AFTER_SETUP = 1500ms) instead
of treating the recording as live.

Also adds pipeline_id (UUID prefix) to all process_recording_bg log
lines for end-to-end correlation, and labels each pipeline stage
(stop_recording, gate_duration, gate_silence, transcribe, deliver)
so dropped recordings are diagnosable from logs.

Closes #527

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 14:07:28 -07:00
github-actions[bot] 57a8bedddf chore(release): v0.52.7 2026-04-13 13:27:38 +00:00
github-actions[bot] af454afbb3 chore(release): v0.52.6 2026-04-13 07:03:29 +00:00
Steven EnamakelandGitHub 403f239ca5 refactor: remove QuickJS skills runtime (#508)
* refactor: remove quickjs skills runtime

* style: apply repo formatting

* refactor: clean up error reporting and connection handling

- Removed the 'skill' source option from the error report structure to streamline error reporting.
- Refactored the ConnectionsPanel component to simplify connection status badge rendering and improve clarity.
- Updated the CronJobsPanel to enhance logging for cron job loading processes.
- Adjusted SkillCard component to use a more consistent type for icons.
- Deleted outdated end-to-end tests for Gmail and Notion skills, improving test suite maintainability.

* fix: remove unnecessary ESLint disable comment in Conversations component

- Cleaned up the Conversations component by removing the ESLint disable comment for exhaustive dependencies in the useEffect hook, improving code clarity and maintainability.

* fix: remove unnecessary whitespace in Conversations component

- Eliminated an extra line of whitespace in the Conversations component, enhancing code readability and maintainability.

* refactor: streamline SkillCard imports for improved clarity

- Combined import statements in the SkillCard component to enhance code readability and maintainability.
2026-04-11 14:57:35 -07:00
Steven Enamakel 5420ede6c4 fix(entitlements): enable audio input device access in macOS sidecar configuration
- Added a key to the entitlements file to allow audio input device access, ensuring proper functionality for applications utilizing audio features under the macOS Hardened Runtime.
2026-04-11 13:48:36 -07:00
github-actions[bot] 69c4fa46cc chore(release): v0.52.5 2026-04-11 10:54:58 +00:00
Steven EnamakelandGitHub 73f8d1287a refactor: remove hardware-related components and streamline service management (#502)
* feat(config): introduce pre-login user directory structure

- Added support for a pre-login user directory to encapsulate configuration, memory, and state before any user logs in. This ensures that all initial data is scoped under a dedicated user directory (`users/local`), preventing direct writes to the root `.openhuman` path.
- Implemented the `pre_login_user_dir` function to return the appropriate path for the pre-login user.
- Updated configuration loading logic to defer disk state creation until the first successful login, enhancing user data management and isolation.
- Added tests to verify the correct behavior of the pre-login directory structure.

* refactor: remove hardware-related components and streamline service management

- Deleted hardware configuration and related tools from the codebase, including `HardwareConfig`, `HardwareTransport`, and associated memory management tools.
- Introduced a new `service.ts` module for managing service and daemon commands, consolidating service-related functionalities.
- Updated import paths across the application to reflect the removal of hardware references and the addition of the new service management module.
- Refactored the `build_system_prompt` function to remove hardware access instructions, focusing on action instructions instead.
- Cleaned up the Cargo.toml and Cargo.lock files by removing unused dependencies related to hardware management.

* chore: apply formatting and tauri lockfile sync

* refactor(tests): extract config file writing logic into a reusable function

- Introduced a `write_config_file` function to encapsulate the logic for creating directories and writing configuration files, improving code reuse and readability.
- Updated test cases to utilize the new function for writing configuration files, ensuring consistency and reducing duplication.
- Added handling for pre-login user directory structure to ensure configuration is correctly written to the appropriate paths.
2026-04-10 22:55:47 -07:00
github-actions[bot] f181ae1d3b chore(release): v0.52.4 2026-04-11 04:02:25 +00:00
Steven EnamakelandGitHub 31297ad19d refactor(memory): remove GLiNER/GLiREL ingestion phase (#499)
* refactor(memory): replace GLiNER model with heuristic extraction

- Removed GLiNER-related code and dependencies from the memory ingestion pipeline, transitioning to a heuristic-only extraction approach.
- Updated documentation and comments to reflect changes in extraction methods.
- Adjusted tests to ensure compatibility with the new heuristic extraction configuration.
- Bumped version of the tokenizers dependency and updated Cargo.lock accordingly.

* chore: apply formatting and tauri lockfile sync
2026-04-10 20:52:36 -07:00
github-actions[bot] 88ae66ae71 chore(release): v0.52.3 2026-04-10 23:12:32 +00:00
b8ded44fbf fix(core): send SIGTERM before SIGKILL on sidecar shutdown (#460) (#495)
The Tauri shell's CoreProcessHandle::shutdown() was calling child.kill()
which sends SIGKILL on Unix, instantly terminating the core process
without giving it a chance to run graceful shutdown hooks. This left the
autocomplete Swift overlay helper (unified_helper_bin) orphaned, causing
persistent error notifications even after the app was closed.

Now sends SIGTERM first and waits up to 5s for the core to exit
gracefully (running shutdown hooks that stop the autocomplete engine and
quit the Swift helper), then falls back to SIGKILL if still alive.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 21:51:28 +05:30
8e8da17ad9 fix(voice): cross-platform microphone permission handling (#489) (#491)
* fix(voice): add cross-platform microphone permission handling (#489)

Voice dictation in release DMG silently fails because the macOS hardened
runtime enforces entitlements and the sidecar plist lacked the audio-input
entitlement. This adds the entitlement, NSMicrophoneUsageDescription for
the system permission prompt, and cross-platform microphone permission
detection (CPAL device probe) with clear error messages on macOS, Windows,
and Linux.

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

* fix(permissions): use plist file for infoPlist and fix cross-platform warnings (#489)

- infoPlist expects a file path, not inline JSON — create Info.plist with
  NSMicrophoneUsageDescription and reference it as a string
- Move Microphone permission request out of macOS-only cfg block since
  request_microphone_access() is cross-platform (fixes unused import warning on Linux CI)
- Treat persistent Unknown mic permission as Denied per CodeRabbit review

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cyrus Gray <144336577+graycyrus@users.noreply.github.com>
2026-04-10 20:17:05 +05:30
Mega MindandGitHub 49cbbbebaf Fix/skill start issue (#493)
* chore: update .gitignore and bump openhuman version to 0.52.2

- Added `overlay/src-tauri/target/` to .gitignore to prevent tracking of build artifacts.
- Updated the openhuman package version from 0.52.0 to 0.52.2 in Cargo.lock files for both the main and app/src-tauri directories.
- Enhanced entitlements for macOS Hardened Runtime to allow outbound HTTPS calls and server connections.
- Refactored registry operations to use rustls explicitly, improving network reliability on macOS.

* refactor(logging): improve debug message formatting in fetch_url_bytes function

- Updated the logging statement in the fetch_url_bytes function to enhance readability by formatting the debug message across multiple lines. This change improves clarity in log outputs, making it easier to track the number of bytes fetched from URLs.
2026-04-10 20:16:08 +05:30
YellowSnnowmannandGitHub aee9c52e88 fix(channels): Telegram threading, live listeners, core restart, and webhook cleanup (#485)
* feat(config): enhance world-readable config warning mechanism

- Introduced a new static variable to track previously warned world-readable config files, preventing duplicate warnings.
- Updated the warning logic to only log a warning for each unique world-readable config file, improving log clarity and reducing noise.
- Added new `ChannelReactionReceived` and `ChannelReactionSent` events to the DomainEvent enum, expanding event handling capabilities in the event bus.
- Included tests for the new reaction events to ensure proper functionality and integration.

* feat(logging): add log file constraints and event filtering

- Introduced functions to parse log file constraints from environment variables and filter log events based on these constraints.
- Enhanced the `init_for_cli_run` function to apply the new filtering logic, improving log management and clarity.
- Updated the `conversation_history_key` function to include thread context for Telegram, ensuring accurate message targeting.
- Added a new trait method `supports_reactions` to the `Channel` trait, indicating support for emoji reactions.
- Implemented integration tests for Telegram channel features, including reaction handling and thread message forwarding.

* feat(telegram): enhance message handling with reactions and typing indicators

- Added support for emoji reactions in Telegram responses, allowing for contextual acknowledgment of user messages.
- Implemented a decision heuristic for when to use reactions, improving user interaction quality.
- Introduced a typing indicator that activates immediately upon receiving a message, providing instant feedback to users.
- Updated the channel delivery instructions to include new reaction syntax and guidelines for usage.
- Enhanced tests to cover new reaction handling and message acknowledgment features, ensuring robust functionality.

* fix(tests): update route key for Telegram message handling tests

- Changed the route key in tests from `telegram_alice` to `telegram_alice_chat-1` to match the updated `conversation_history_key` format for Telegram.
- This adjustment ensures accurate routing and consistency in message handling tests.

* refactor(tests): streamline message handling in runtime tool calls

- Refactored the message handling tests to utilize a `ChannelMessage` struct for improved clarity and maintainability.
- Updated the route key generation to use the `conversation_history_key` function, ensuring consistency in message routing.
- Simplified the invocation of `process_channel_message` by directly passing the constructed message, enhancing readability.

* fix(telegram): enhance finalize_draft method to support thread context

- Updated the `finalize_draft` method in the `Channel` trait and its implementation for `TelegramChannel` to accept an optional `thread_ts` parameter, allowing for message threading.
- Adjusted related message handling functions to utilize the new parameter, ensuring proper message context during sending.
- Modified tests to reflect changes in the `finalize_draft` method signature, enhancing the robustness of message handling in threaded conversations.

* refactor(tests): ran format

* feat(discord, telegram): implement core process restart on channel connection

- Added functionality to restart the core process when a channel connection requires a restart, enhancing the user experience by automating the process.
- Implemented error handling to log any issues during the restart, ensuring users are informed to restart the app if necessary.
- Updated both Discord and Telegram configuration components to include this new behavior, improving consistency across channel integrations.

* feat(core-update): enhance core update logging and error handling

- Added warnings for outdated sidecar versions and potential mismatches in UI features, improving user awareness of version compatibility.
- Implemented detailed error logging for failed attempts to fetch the latest core release, providing users with clear instructions for manual updates if necessary.
- Enhanced logging for reusing existing core RPC endpoints, alerting users to potential issues with stale connections.

* feat(channels): implement real-time channel listeners and enhance logging

- Added support for real-time channel listeners for Telegram and Discord, ensuring inbound bot messages are polled during `openhuman run`.
- Introduced a method to check for configured listening integrations, preventing unnecessary listener spawning when not needed.
- Enhanced logging for channel connection events and message handling, providing better visibility into channel operations and user interactions.
- Updated the Telegram channel connection to log the count of allowed users and mention-only settings for improved debugging.

* chore(dependencies): update openhuman version to 0.51.18 and refactor imports in channel config components

- Bumped the openhuman package version from 0.49.17 to 0.51.18 in Cargo.toml and Cargo.lock.
- Refactored import statements in DiscordConfig.tsx and TelegramConfig.tsx to maintain consistency and ensure proper functionality.

* Implement webhook deletion for long polling in TelegramChannel

- Added `delete_webhook_for_long_polling` method to clear the Bot API webhook, enabling `getUpdates` long polling.
- Updated error handling in `fetch_bot_username` to call the new method when a 409 conflict indicates an active webhook, allowing for retries after webhook deletion.
- Enhanced logging for better traceability of webhook deletion and polling conflicts.

* Refactor Discord and Telegram connection handling to ensure channel connection updates are dispatched regardless of restart requirement. Improved error handling during core process restart and enhanced logging for connection status.
2026-04-10 15:06:08 +05:30
github-actions[bot] ce5523c34f chore(release): v0.52.2 2026-04-10 08:50:16 +00:00
github-actions[bot] ca4ea9bb12 chore(release): v0.52.1 2026-04-10 06:58:40 +00:00
Steven EnamakelandGitHub 6410db1fad feat(thu-fullrun): overlay attention, skills sync, credits & settings refresh (#479)
* Update Conversations component to enhance user messaging for budget limits. Changed the warning text for exhausted weekly inference budget to improve clarity and user experience.

* feat(schemas): add new configuration option for vision model usage

- Introduced a new optional boolean field `use_vision_model` in the schemas for enabling vision LLM for screenshot analysis.
- Updated the screen intelligence schemas to include a required `consent` field for starting sessions, replacing the previous `sample_interval_ms` field.
- Enhanced the `ttl_secs` field description for clarity and modified the `capture_policy` to `screen_monitoring` for better understanding of its purpose.

* feat(CoreStateProvider): enhance state management with optimistic updates and error handling

- Implemented optimistic local commits for `setAnalyticsEnabled` and `setOnboardingCompletedFlag` to provide instant UI feedback while ensuring state consistency through authoritative snapshot refreshes.
- Added error handling for the `refresh` function calls in `setAnalyticsEnabled`, `setOnboardingCompletedFlag`, and `clearSession` to log failures, improving robustness in state management during user interactions.
- Updated dependencies in the `useCallback` hooks to include `refresh`, ensuring proper state updates and synchronization with the core.

* feat(paths): centralize runtime path resolution for user-scoped skills data

- Introduced a new module `paths.rs` to handle the resolution of runtime paths for skills, ensuring that `skills_data` and `workspace` directories are scoped per user.
- Updated `bootstrap_skill_runtime` and `bootstrap_skills_runtime` functions to utilize the new path resolution logic, improving consistency and clarity in directory management.
- Enhanced error logging for directory creation failures to include the specific path that failed, aiding in debugging.
- Added a new optional field `overlay_ttl_ms` in the autocomplete schemas to support overlay time-to-live configuration.

* feat(ScreenIntelligencePanel): optimize config synchronization to prevent user edit clobbering

- Introduced a reference to track the last synced configuration signature, ensuring that user edits are preserved during periodic updates from the CoreStateProvider.
- Updated the effect to compare serialized configuration values, allowing for re-sync only when actual changes occur, enhancing user experience and preventing unintended data loss.

* feat(SkillManager): implement initial sync after OAuth completion

- Added functionality to trigger an initial data sync immediately after OAuth completion, ensuring users see fresh data without waiting for the next scheduled sync.
- Updated comments to clarify the change in sync behavior due to recent modifications in the Rust core, which no longer auto-triggers sync on OAuth completion.

* fix(UsageLimitModal, Conversations): enhance user messaging for budget limits

- Updated warning messages in both UsageLimitModal and Conversations components to provide clearer information regarding weekly limits and reset times.
- Improved clarity in user notifications to enhance overall experience when budget limits are reached.

* refactor(SkillSetupModal): improve session mode handling for skill configuration

- Updated the SkillSetupModal component to lock the mode at mount time, ensuring users remain in the setup wizard during their session even if the skill is marked as complete.
- Simplified mode management by replacing the forceSetup state with a sessionMode state, allowing explicit mode switching while maintaining a consistent user experience.

* feat(SkillManager): enhance setup flow for OAuth-based skills

- Updated the `startSetup` method to handle OAuth-based skills more effectively by implementing a fallback to core RPC for skills without a frontend runtime.
- Improved error handling to treat missing `onSetupStart` implementations as successful completion for pure OAuth skills, allowing the setup wizard to display the "Connected!" screen.
- Added detailed logging for both local runtime and core RPC fallback scenarios to improve traceability during the setup process.

* feat(Home): enhance local AI status handling and asset management

- Introduced a new state for local AI assets, allowing for better tracking of model file readiness.
- Updated the loading logic to fetch both local AI status and assets concurrently, improving performance and error handling.
- Implemented a mechanism to hide the Local Model Runtime card once all models are fully downloaded, enhancing user experience.
- Added comprehensive comments to clarify the logic behind model readiness checks based on asset states.

* refactor(Credits): update credit balance structure and terminology

- Renamed credit categories in the RewardsCouponSection and PayAsYouGoCard components for clarity, changing "General credits" to "Promo credits" and "Top-up credits" to "Team top-up."
- Updated the credit balance API to reflect the new structure, replacing `balanceUsd` and `topUpBalanceUsd` with `promotionBalanceUsd` and `teamTopupUsd`.
- Adjusted normalization logic in the credits API to accommodate the new credit balance fields.
- Modified tests to ensure correct handling of the updated credit balance structure.

* feat(Settings): reorganize billing settings and update descriptions

- Added a new top-level billing section to the settings, promoting it out of the Account & Security category for better visibility.
- Updated the description for the Account & Security section to remove billing references, focusing on recovery phrase, team management, and linked account access.
- Adjusted the settings navigation to accommodate the new billing section, ensuring proper routing and user experience.

* refactor(Config): change logging level from info to debug for environment overrides

- Updated logging statements in the Config implementation to use debug level instead of info, reducing verbosity during runtime while maintaining necessary traceability for configuration loading.

* feat(Overlay): implement overlay attention event handling and refactor overlay app structure

- Introduced a new overlay module to manage attention events, allowing the core to publish messages to the overlay window.
- Enhanced the OverlayApp component to handle dictation and attention events, improving user interaction with the overlay.
- Refactored the overlay state management to support different modes (idle, stt, attention) and added auto-dismiss functionality for attention messages.
- Removed the Browser Access Toggle from the Skills page, streamlining the UI and focusing on core functionalities.
- Updated tests to reflect changes in the Skills component and removed unnecessary mocks related to browser access.

* fix(OverlayBubbleChip): reset typewriter animation on new bubble identity

- Updated the OverlayBubbleChip component to reset the typewriter animation correctly when a new bubble is displayed by using the `key` prop.
- Refactored the cleanup logic in the useEffect hook to ensure proper interval management and state reset, enhancing the user experience with bubble transitions.

* refactor(rest): streamline key_bytes_from_string function and improve readability

- Simplified the condition for checking the ASCII key length and character restrictions in the key_bytes_from_string function.
- Consolidated the import statements for base64 engines into a single line for better clarity.
- Adjusted test data formatting for improved readability in the key_bytes_from_string_tests module.

* enhance(logging): improve color detection logic for terminal output

- Updated the color detection logic in the logging module to prioritize environment variables (`NO_COLOR`, `FORCE_COLOR`, `CLICOLOR_FORCE`) for better control over color output.
- Added detailed comments explaining the color resolution order, enhancing code clarity and maintainability.

* test(Home): add mock for openhumanLocalAiAssetsStatus in tests

- Enhanced the Home and HomeBootstrapButtons test files by adding a mock implementation for openhumanLocalAiAssetsStatus, which resolves to an object with null result and empty logs. This improves the test setup for local AI asset status handling.

* refactor(SkillSetupModal): improve session mode handling and loading state

- Updated the SkillSetupModal component to ensure session mode is determined after the first snapshot resolution, preventing premature defaults to the setup wizard.
- Introduced a loading state to display a message while waiting for the skill setup status, enhancing user experience during the modal's initial render.
- Refactored the SkillManager to throw errors for real failures during setup, ensuring proper error handling and user feedback.

* refactor(Config): simplify logging for invalid proxy scope values

- Consolidated the logging statement for invalid OPENHUMAN_PROXY_SCOPE values into a single line, improving code readability while maintaining the warning functionality.
2026-04-09 23:01:56 -07:00
Steven EnamakelandGitHub a1f8bc55c4 Improve upsell flow and retire legacy overlay app (#473)
* fix(autocomplete): disable autocomplete feature by default

- Updated the default configuration for the Autocomplete feature to be disabled instead of enabled in both the frontend and backend configurations. This change aims to improve user experience by preventing unintended activations of the autocomplete functionality upon application startup.

* feat(overlay): enhance overlay window functionality and responsiveness

- Updated the OverlayApp component to dynamically adjust its size and position based on the overlay status (idle/active), improving user interaction.
- Introduced new constants for overlay dimensions and margins, enhancing visual consistency.
- Implemented hover effects to adjust opacity, providing better visual feedback.
- Refactored window resizing and positioning logic to ensure the overlay remains user-friendly and visually appealing across different scenarios.
- Updated macOS window level to NSScreenSaverWindowLevel for improved behavior in fullscreen and multi-space environments.

* feat(dependencies): add objc2-core-graphics and related packages

- Introduced `objc2-core-graphics` as a new dependency in the Cargo.toml for macOS support.
- Updated Cargo.lock to include `objc2-metal`, `block2`, and `libc` as dependencies for enhanced functionality.
- Refactored overlay window configuration to utilize `CGShieldingWindowLevel`, improving window behavior in macOS environments.

* refactor(billing): remove storage limits and update plan budgets

- Removed `storageLimitBytes` from the `PlanMeta` interface and all plan definitions, simplifying the billing structure.
- Updated the `Free` plan to have zero budgets for monthly and weekly usage, aligning with the new billing strategy.
- Adjusted the `BillingPanel` and related components to conditionally display budget information based on the updated plan values.
- Enhanced the `InferenceBudget` and `PayAsYouGoCard` components to reflect changes in budget handling and improve user messaging.
- Updated tests to ensure consistency with the new billing logic and removed references to storage limits.

* feat(upsell): enhance GlobalUpsellBanner and PayAsYouGoCard components

- Added the GlobalUpsellBanner component to the App, improving user visibility of upgrade options.
- Refactored PayAsYouGoCard to better handle credit balance calculations, separating promo and top-up credits for clarity.
- Updated the UpsellBanner styles for a more consistent visual presentation.
- Introduced normalization functions in creditsApi to ensure robust handling of credit balance data.
- Added tests for creditsApi to validate the normalization logic and prevent UI crashes with missing data.

* feat(upsell): reintroduce GlobalUpsellBanner in App and enhance UpsellBanner styling

- Added the GlobalUpsellBanner back into the App component to improve user visibility of upgrade options.
- Updated the UpsellBanner component to include a new `rounded` prop for customizable styling.
- Removed dismissible functionality from the GlobalUpsellBanner, streamlining the user experience.
- Enhanced visual presentation by adjusting CSS styles for better consistency.

* refactor(overlay): remove obsolete overlay files and configurations

- Deleted unused files including .gitignore, index.html, package.json, postcss.config.js, README.md, tailwind.config.js, tsconfig.json, vite.config.ts, and yarn.lock from the overlay directory.
- Removed all source files related to the overlay functionality, including App.tsx, main.tsx, parentCoreRpc.ts, styles.css, and various components.
- Cleaned up the src-tauri directory by removing configuration files, icons, and capabilities related to the overlay, streamlining the project structure.
- This commit enhances maintainability by eliminating legacy code and unused resources.

* refactor(rewards): move DISCORD_INVITE_URL to a separate utility file

- Refactored the Rewards component to import the DISCORD_INVITE_URL from a new links utility file, improving code organization and maintainability.
- Created a new links.ts file to centralize URL constants, enhancing clarity and reusability across the application.

* style(app): apply formatter hook fixes

* chore(dependencies): remove @heroicons/react from yarn.lock

- Deleted the entry for @heroicons/react@^2.2.0 from yarn.lock, streamlining dependency management and reducing potential conflicts.
2026-04-09 20:41:26 -07:00
Steven EnamakelandGitHub d66ee0d4de feat: consolidate overlay into desktop app and add compact orb demo (#450)
* feat(overlay): implement overlay window functionality and related RPC integration

- Added a new OverlayApp component to handle overlay-specific UI and functionality.
- Introduced an overlay window configuration in tauri.conf.json, allowing for a transparent, always-on-top overlay.
- Implemented parent RPC communication for the overlay to interact with the main application.
- Updated main.tsx to conditionally render the OverlayApp based on the current window context.
- Enhanced CSS styles to support the overlay's visual requirements.

This commit establishes the foundation for overlay functionality, improving user experience with a dedicated interface for specific tasks.

* refactor(overlay): remove overlay functionality and related configurations

- Deleted the overlay module and its associated files, including process management and configuration settings.
- Removed environment variable checks and overlay-related logic from the core process and configuration schema.
- Updated documentation to reflect the removal of overlay features, simplifying the codebase and improving maintainability.

This commit streamlines the application by eliminating unused overlay components, enhancing overall performance.

* feat(overlay): enhance overlay bubble functionality and styling

- Added a new CSS animation for overlay bubble appearance, improving visual feedback.
- Introduced an OverlayBubble interface to manage bubble properties such as tone and text.
- Updated OverlayApp component to include a new OverlayBubbleChip for displaying messages with dynamic styling based on tone.
- Adjusted overlay window dimensions in tauri.conf.json for a more compact design.

This commit improves the user experience by providing visually distinct overlay messages and a refined interface.

* feat(rotating-tetrahedron): add inverted color support and refactor canvas component

- Introduced an optional `inverted` prop to the `RotatingTetrahedronCanvas` component, allowing for dynamic color changes based on the prop value.
- Updated fill and edge materials to reflect the inverted state, enhancing visual customization.
- Refactored the component to improve readability and maintainability by utilizing the new prop in the rendering logic.
- Adjusted the effect dependencies to include the `inverted` prop for proper reactivity.

This commit enhances the user experience by providing a more flexible and visually appealing tetrahedron display.

* fix(rotating-tetrahedron): adjust opacity and emissive intensity for inverted colors

- Updated the opacity of the fill material in the RotatingTetrahedronCanvas component to enhance visual clarity when the inverted prop is true.
- Reduced the emissive intensity for the inverted state to improve the overall appearance of the tetrahedron.

This commit refines the visual representation of the rotating tetrahedron, ensuring better contrast and aesthetics based on user preferences.

* feat(rotating-tetrahedron): enhance dynamic color handling and performance

- Implemented useRef hooks for fill and edge materials in the RotatingTetrahedronCanvas component to optimize rendering performance.
- Updated the useEffect hook to adjust material properties based on the inverted state, improving visual consistency.
- Refactored animation speed handling to utilize a reference for smoother updates.
- Cleaned up resource management by ensuring materials are disposed of correctly when the component unmounts.

This commit enhances the visual fidelity and performance of the rotating tetrahedron, providing a more responsive and visually appealing experience.

* fix(overlay): adjust bubble alignment and overlay positioning

- Changed the text alignment of the OverlayBubbleChip component from left to right for improved readability.
- Updated the vertical positioning logic in the Tauri overlay to account for a right margin, ensuring consistent placement of the overlay window.

These adjustments enhance the visual presentation and positioning of overlay elements, contributing to a better user experience.

* fix(overlay): update overlay dimensions and bubble styling

- Adjusted the overlay dimensions for a more refined appearance.
- Modified the bubble tone classes for improved color consistency and readability.
- Enhanced the text size and line height in the OverlayBubbleChip component for better visual clarity.
- Updated the orb button size and styling to enhance user interaction.

These changes contribute to a more polished and user-friendly overlay experience.

* feat(overlay): enhance overlay scenario handling and text display

- Introduced a new scenario management system in the OverlayApp component, allowing for dynamic cycling between different overlay states.
- Added a new text display feature for scenario two, providing real-time feedback as the text is typed out.
- Refactored the bubble rendering logic to accommodate the new scenario structure, improving the overall user interaction experience.

These changes enhance the functionality and interactivity of the overlay, making it more engaging for users.

* fix(overlay): reorder demo scenarios

* fix(overlay): update overlay dimensions and improve text display logic

- Adjusted overlay dimensions for better visual consistency.
- Enhanced text display in OverlayBubbleChip to show text progressively based on bubble content.
- Refactored the handling of scenario text in OverlayApp to streamline the display logic.

These changes contribute to a more polished and engaging user experience in the overlay.

* refactor(overlay): simplify type parameters in RPC functions

- Removed unnecessary generic type parameter from `unwrapCliCompatibleJson` and `callParentCoreRpc` functions for improved clarity and conciseness.
- These changes enhance code readability and maintainability without altering functionality.
2026-04-09 15:01:14 -07:00
0b23ae6b96 fix(voice): resolve dictation pipeline in embedded Tauri app (#466)
* fix(voice): guard dictation_listener when voice_server is active

macOS only supports one rdev::listen() global event tap per process.
When voice_server.auto_start is true, skip starting the separate
dictation_listener — the voice server owns the single listener and
forwards hotkey events itself.

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

* feat(voice): add TRANSCRIPTION_BUS broadcast channel

Make publish_dictation_event public so the voice server can forward
hotkey events. Add a new TRANSCRIPTION_BUS broadcast channel with
subscribe_transcription_results() and publish_transcription() for
delivering completed transcriptions to frontend clients via Socket.IO.

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

* fix(voice): forward hotkey events and route transcription delivery

In the voice server's hotkey handler, forward events to the dictation
bus so Socket.IO clients receive dictation:toggle even without the
separate dictation_listener running.

In process_recording_bg, detect when the OpenHuman app is focused and
deliver transcription via Socket.IO instead of OS-level Cmd+V paste,
preventing text from disappearing into the unfocused WebView.

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

* feat(voice): bridge transcription results to Socket.IO

Subscribe to TRANSCRIPTION_BUS and emit dictation:transcription events
to all connected Socket.IO clients. This completes the Rust-side
pipeline for delivering transcribed text to the frontend.

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

* fix(socket): queue listeners registered before socket connects

Add a pendingListeners queue to socketService so that on()/once()
calls made before the socket is established are replayed once the
connection opens, preventing silently dropped event listeners.

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

* fix(voice): use dedicated unauthenticated socket for dictation events

Replace the auth-gated socketService dependency with a direct Socket.IO
connection to the core process (127.0.0.1:7788). This bypasses the
SocketProvider auth requirement and ensures dictation:toggle and
dictation:transcription events are received regardless of login state.
Dispatches the existing dictation://insert-text DOM event to bridge
transcribed text into the Conversations chat input.

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

* fix(voice): fallback to default audio config when preferred config fails

macOS may advertise a 16kHz F32 config as supported but reject it at
stream creation time (known cpal quirk). Add a fallback path that
retries with the device's default_input_config(), handling F32, I16,
and U16 sample formats with proper resampling.

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

* fix(voice): add 3s timeout on Ollama LLM cleanup

Wrap the Ollama inference call in a 3-second tokio::time::timeout so
dictation feels responsive. If cleanup doesn't complete in time, fall
back to raw Whisper text immediately instead of blocking for 2+ minutes.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:54:40 -07:00
github-actions[bot] 382038fcc8 chore(release): v0.52.0 2026-04-09 20:17:25 +00:00
Mega MindandGitHub dc5e7adeb6 fix(auth): update RPC method names for authentication calls (#463)
* fix(auth): update RPC method names for authentication calls

Refactor authentication-related RPC method names to use underscores instead of dots for consistency. Updated methods include `get_state`, `get_session_token`, `clear_session`, and `store_session`.

chore: update OpenHuman version to 0.51.19

style: standardize string formatting in quickjs_libs/bootstrap.js and other files

- Replace single quotes with double quotes for string literals in various functions.
- Ensure consistent formatting across console logging and error handling.

fix(config): improve token retrieval logic in ops_core.rs

- Enhance the logic for retrieving the active session token from the credentials store, accommodating user-specific directories.

* test: align auth and OAuth assertions with current behavior

Update stale test expectations for underscore-style auth RPC methods and light-theme OAuth button classes, and make the bypass-login E2E assertion resilient to the current auth persistence model.

Made-with: Cursor

* chore: apply formatter output for login flow spec

Include Prettier formatting adjustments produced by the pre-push hook so the branch can pass repository push checks cleanly.

Made-with: Cursor
2026-04-09 22:20:20 +05:30
github-actions[bot] c10f087d51 chore(release): v0.51.19 2026-04-08 22:57:41 +00:00
Steven EnamakelandGitHub 4ee518cf31 feat(tree-summarizer): hierarchical summary tree module with CLI (#423)
* feat(tree-summarizer): implement hierarchical summarization engine and event handling

- Introduced a new `tree_summarizer` module to manage hierarchical time-based summaries, organizing data into a tree structure (root → year → month → day → hour).
- Added functionality to ingest raw content, summarize it into hour leaves, and propagate summaries upward through the tree.
- Implemented event handling for summarization completion and tree rebuild events, enhancing observability and modularity.
- Created RPC operations for ingesting content, triggering summarization, querying the tree, and retrieving tree status.
- Added comprehensive tests to ensure the reliability of the summarization process and event handling.

This update significantly enhances the summarization capabilities of the system, allowing for efficient data organization and retrieval.

* feat(tree-summarizer): add CLI support for tree summarization commands

- Introduced a new `tree-summarizer` command to the CLI, allowing users to ingest content, run summarization jobs, query the summary tree, check status, and rebuild the tree.
- Updated the CLI help documentation to include the new command and its subcommands.
- Added a new module `tree_summarizer_cli` to encapsulate the tree summarization functionality.

This enhancement improves the usability of the summarization features, providing a streamlined interface for managing hierarchical summaries directly from the command line.

* style: apply cargo fmt to tree_summarizer module

* feat(tree-summarizer): implement TreeSummarizerEventSubscriber for observability logging

- Added a new `TreeSummarizerEventSubscriber` to log events related to tree summarization, enhancing observability.
- Updated the `start_channels` function to register the new subscriber.
- Refactored the `run_summarization` function to group buffered entries by hour and publish events upon completion of summarization.
- Improved documentation and added tests for the new subscriber functionality.

This update aims to provide better insights into the summarization process and facilitate future cross-module workflows.

* refactor(tree_summarizer): streamline buffer backup and function signature

- Simplified the buffer backup process by consolidating the rename operation with context handling for better error reporting.
- Cleaned up the function signature of `derive_node_ids_from_hour_id` for improved readability.

These changes enhance code clarity and maintainability within the tree summarization engine.

* feat(tree_summarizer): enhance tree summarization with metadata support

- Updated the `tree_summarizer_ingest` function to accept an optional metadata parameter, allowing users to include additional context during content ingestion.
- Refactored related functions to validate and handle metadata, improving the overall robustness of the summarization process.
- Adjusted the buffer write functionality to store metadata alongside content, enhancing the data structure for future retrieval and processing.

These changes aim to enrich the summarization capabilities and provide more context for ingested content.

* refactor(tree_summarizer): improve error message formatting in node ID validation

- Enhanced the formatting of error messages in the `validate_node_id` function for better readability and consistency.
- Adjusted the string formatting to use multi-line syntax, improving clarity in error reporting.
- Minor formatting changes in the `strip_buffer_frontmatter` function to enhance code readability.

These changes aim to improve the maintainability and clarity of error handling within the tree summarization module.

* refactor(tree_summarizer): enhance buffer management and summarization process

- Replaced the buffer draining mechanism with a non-destructive read approach, allowing for safer data handling during summarization.
- Introduced a new `buffer_delete` function to explicitly manage the deletion of buffer entries after successful processing.
- Updated the `run_summarization` function to reflect these changes, ensuring that buffer entries are only deleted after durable writes are confirmed.
- Improved the backup process for the buffer directory during tree rebuilds, ensuring it is preserved outside the tree structure.

These modifications aim to improve data integrity and clarity in the summarization workflow.

* refactor(tree_summarizer): improve markdown parsing and timestamp handling

- Updated the `parse_node_markdown` function to trim trailing whitespace from the body after splitting frontmatter, enhancing data cleanliness.
- Modified test cases to use specific timestamps instead of the current time, ensuring consistent and predictable test results.
- Adjusted assertions in tests to reflect the new timestamp-based ordering of entries.

These changes aim to improve the robustness of markdown parsing and the reliability of test outcomes in the tree summarization module.
2026-04-08 01:56:25 -07:00
github-actions[bot] 3034ec1fa2 chore(release): v0.51.18 2026-04-08 06:29:16 +00:00
91996a1dd0 fix(voice): reduce dictation hallucinations and improve Fn/focus reliability (#385) (#409)
* fix(voice): add per-segment confidence validation in whisper engine (#385)

Reject whisper segments with avg token log-probability below -0.7 or
entropy above 2.4. Return TranscriptionResult with confidence metadata
instead of plain String. Update callers in speech.rs and streaming.rs.

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

* fix(voice): upgrade default STT model from tiny to base (#385)

Base model produces significantly fewer hallucinations than tiny,
especially in noisy/quiet conditions. User can still override via config.

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

* fix(voice): add real-time silence gating in audio capture (#385)

Gate sustained silence (>500ms) from being sent to whisper to prevent
hallucinations. Maintain 100ms look-ahead ring buffer so speech onset
after pauses is not clipped. Thresholds adapt to source sample rate.

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

* fix(voice): fix Fn key timing race condition in hotkey event loop (#385)

start_recording() blocks 1-7s on cpal device init but macOS fires Fn
Release almost immediately, causing skipped cycles. Move recording
start to spawn_blocking so the event loop stays responsive. Buffer
Release events during setup and ensure minimum 1.5s recording duration
when release arrives before recording handle is ready.

Also includes: capture focused app on hotkey press, pass through
pipeline for focus validation before paste.

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

* fix(voice): validate and restore focus before paste, attempt regardless (#385)

Add expected_app parameter to insert_text(). Before Cmd+V, validate
focus via accessibility API and restore via AppleScript if shifted.
Don't abort paste on focus validation failure — attempt insertion
regardless so text is never silently lost.

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

* fix(voice-ui): align voice server RPC response shape in settings panel (#385)

* style(voice): apply rustfmt formatting in text_input

* fix(voice): address CodeRabbit regressions in server, streaming, and settings polling

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 09:11:57 -07:00
github-actions[bot] 17c9b39f74 chore(release): v0.51.17 2026-04-07 07:32:01 +00:00
github-actions[bot] 8d96f28f96 chore(release): v0.51.16 2026-04-07 07:30:34 +00:00
Steven Enamakel 97e0974c0c Merge remote-tracking branch 'upstream/main' 2026-04-07 00:29:55 -07:00
Steven Enamakel 6b1b2b9ba2 update 2026-04-07 00:29:41 -07:00
github-actions[bot] 3361ec040f chore(release): v0.51.15 2026-04-07 07:25:21 +00:00
github-actions[bot] 4dd9da88a9 chore(release): v0.51.14 2026-04-07 06:56:12 +00:00
github-actions[bot] 621f862095 chore(release): v0.51.13 2026-04-07 06:52:20 +00:00
Steven Enamakel d05b724fd3 Merge remote-tracking branch 'upstream/main' 2026-04-06 23:49:39 -07:00
github-actions[bot] 3ac6bc6a8a chore(release): v0.51.12 2026-04-07 06:37:11 +00:00
Steven Enamakel cb0cec0c70 fix 2026-04-06 23:32:13 -07:00
Steven Enamakel 39ce04a02d Merge remote-tracking branch 'upstream/main' 2026-04-06 23:31:19 -07:00
github-actions[bot] c8c0f8bb5d chore(release): v0.51.11 2026-04-07 06:31:17 +00:00
Steven Enamakel 8bda914576 ifix buils 2026-04-06 23:30:03 -07:00
github-actions[bot] fbbdc07062 chore(release): v0.51.10 2026-04-07 06:23:10 +00:00
github-actions[bot] 766ad5af48 chore(release): v0.51.9 2026-04-07 06:03:37 +00:00
Steven EnamakelandGitHub 3851d1ef67 fix(voice): anti-hallucination, clipboard paste, Fn key reliability (#380)
* fix(dictation): update hotkey default value and documentation

- Changed the default global hotkey for dictation from "CmdOrCtrl+Shift+D" to "Fn" in both the configuration schema and the associated documentation.
- Updated the hotkey parsing function to recognize "Fn" as a valid key, enhancing the flexibility of hotkey configurations.
- Added a test case to ensure the "Fn" key can be parsed correctly, improving the robustness of the hotkey handling functionality.

* fix(voice): update default activation mode and hotkey in configuration

- Changed the default activation mode for voice and dictation from "tap" to "push" in the respective configuration schemas.
- Updated the default hotkey for voice commands from "ctrl+shift+space" to "Fn" across various modules and documentation.
- Adjusted related tests to reflect the new defaults, ensuring consistency in behavior and expectations.

* feat(voice): integrate embedded global voice server startup

- Added a new asynchronous function `start_if_enabled` to the voice server module, which initializes the embedded voice server based on configuration settings.
- Updated the server run logic to check if the voice server should auto-start, enhancing the startup process for the core application.
- Integrated the new server startup function into the main server run logic, ensuring the voice server is launched if enabled in the configuration.

* feat(voice): add VoicePanel for managing voice server settings

- Introduced a new `VoicePanel` component to handle voice server configurations, including startup options, hotkeys, and runtime controls.
- Updated routing in the settings page to include the new voice settings section.
- Enhanced the `useSettingsNavigation` hook to support navigation to the voice settings.
- Added tests for the `VoicePanel` to ensure functionality and reliability of the voice server management features.

* refactor(dictation): update documentation and improve component initialization

- Revised comments in `DictationHotkeyManager` to clarify the component's mounting process within the app tree.
- Removed unused imports and unnecessary state management from `ServiceBlockingGate`, streamlining the component's logic.
- Updated tests for `ServiceBlockingGate` to reflect changes in behavior, ensuring accurate rendering of child components based on service status.
- Enhanced the `Cargo.lock` file by updating dependencies to their latest versions for improved stability and security.

* fix(voice): update default skip_cleanup setting and enhance VoicePanel options

- Changed the default value of `skip_cleanup` in the voice server configuration from `false` to `true` to improve transcription handling.
- Reordered options in the `VoicePanel` component to ensure "Natural cleanup" is displayed alongside "Verbatim transcription" for better user clarity.
- Updated tests to reflect the new default settings and ensure proper functionality of the VoicePanel component.

* feat(window): add window management commands for Tauri application

- Introduced a new module `window.ts` containing functions for managing window visibility and state in a Tauri application.
- Implemented commands to show, hide, toggle visibility, minimize, maximize, close, and set the title of the main window.
- Added checks to ensure commands are only executed in a Tauri environment, enhancing compatibility with web contexts.

* feat(tauriCommands): add comprehensive Tauri command modules

- Introduced multiple new modules for Tauri commands, including `accessibility`, `autocomplete`, `config`, `conscious`, `core`, `cron`, `hardware`, `localAi`, and `window`.
- Each module contains functions for managing specific functionalities such as accessibility permissions, autocomplete suggestions, configuration settings, and hardware interactions.
- Implemented checks to ensure commands are executed only in a Tauri environment, enhancing compatibility and reliability.
- This addition significantly expands the command capabilities of the Tauri application, providing a robust framework for future development.

* feat(voice): enhance audio transcription with initial prompt support

- Added functionality to transcribe audio with an optional initial prompt, allowing for vocabulary bias and improved conversational continuity.
- Updated the `transcribe_pcm_f32` and `transcribe_wav_file` functions to accept an `initial_prompt` parameter, enhancing recognition of specific vocabulary.
- Implemented peak RMS energy tracking during audio recording for silence detection, ensuring recordings below a defined threshold are skipped.
- Enhanced the voice server configuration to include a silence threshold and custom dictionary for better transcription context.
- Introduced methods to build and manage recent transcripts for improved continuity across consecutive recordings.
- Updated tests to validate new features and ensure proper functionality of the transcription process.

* feat(voice): enhance VoiceServerConfig with silence detection and custom dictionary

- Added `silence_threshold` to the `VoiceServerConfig` for improved silence detection, allowing recordings with low RMS energy to be skipped.
- Introduced `custom_dictionary` to bias transcription towards specific vocabulary, enhancing recognition of names and technical terms.
- Updated the `voice_transcribe` and `voice_transcribe_bytes` functions to utilize the new `initial_prompt` parameter for better context during transcription.
- Adjusted the `transcribe_pcm_i16` function to accept additional parameters for improved flexibility in handling audio input.

* feat(voice): add silence threshold and custom dictionary features to VoicePanel

- Implemented a new input for setting the silence threshold, allowing recordings with low RMS energy to be skipped.
- Added functionality for a custom dictionary, enabling users to add specific vocabulary words to improve transcription accuracy.
- Updated the VoiceServerSettings interface and related functions to support the new features, ensuring seamless integration with existing settings.
- Enhanced the UI in the VoicePanel to facilitate user interaction with the new settings.

* feat(voice): propagate silence threshold and custom dictionary to voice server command

- Added `silence_threshold` and `custom_dictionary` parameters to the `run_voice_server_command` function, ensuring these settings are utilized during voice server operations.
- Enhanced integration with the existing voice server configuration to support improved transcription accuracy and silence detection.

* fix(tauriCommands): update import paths for coreRpcClient

- Adjusted import paths for `callCoreRpc` in multiple Tauri command modules to ensure correct referencing from the updated directory structure.
- This change enhances module organization and maintains consistency across the codebase.

* feat(dependencies): update Cargo.lock and Cargo.toml for new packages and versions

- Added new dependencies including `arboard`, `fax`, `fax_derive`, `gethostname`, `half`, `quick-error`, `tiff`, and `x11rb` to enhance functionality and support for clipboard operations, transcription improvements, and system interactions.
- Updated existing dependencies to their latest versions for better performance and compatibility.
- Modified `VoicePanel` to utilize the updated settings and ensure proper handling of voice server configurations.
- Enhanced the text input mechanism to use clipboard-paste for improved reliability in text insertion.

* fix(voice): update skip_cleanup default value and enhance logging

- Changed the default value of `skip_cleanup` in `VoiceServerConfig` from `true` to `false` to align with expected behavior and improve transcription handling.
- Added detailed logging in the transcription cleanup process to provide better insights into the LLM state and cleanup decisions.
- Removed unused functions related to unreliable key releases in hotkey handling to simplify the codebase.
- Updated tests to reflect the new default settings for `skip_cleanup` and ensure proper functionality across components.

* style: apply linter formatting fixes

* fix(voice): remove unused warn import in hotkey module

* test(voice): add silence threshold and custom dictionary to VoicePanel tests

- Updated tests for the VoicePanel component to include new parameters: `silence_threshold` and `custom_dictionary`.
- Ensured that the tests reflect the latest configuration settings for improved transcription accuracy and functionality.
2026-04-06 18:15:48 -07:00
88257d3231 feat(update): core sidecar self-update with version detection (#372)
* update

* update

* Refactor code style for consistency and readability in core update module

- Reformatted platform_triple function to improve readability by aligning braces.
- Simplified async function calls and error handling in various places for better clarity.
- Enhanced logging statements for improved observability during update processes.

These changes enhance the maintainability of the codebase while ensuring consistent formatting across the module.

* feat(update): periodic background update checker with config flag

Add a periodic update scheduler that checks GitHub Releases for newer
core binary versions on a configurable interval (default: 1 hour).
Controlled by `[update]` config section with `enabled = true` by default.

- New `UpdateConfig` in config schema (enabled, interval_minutes)
- Env var overrides: OPENHUMAN_AUTO_UPDATE_ENABLED, OPENHUMAN_AUTO_UPDATE_INTERVAL_MINUTES
- Background scheduler spawned at server startup in run_server()
- Reports to health registry as "update_checker" component

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

* fix(update): address PR review — restart path, security, version tracking

- CoreProcessHandle: add set_core_bin/effective_core_bin so ensure_running
  launches the newly staged binary instead of the original one
- check_and_update_core: add `force` param — auto-check uses MINIMUM_CORE_VERSION,
  manual apply_core_update uses latest release (force=true)
- Acquire restart_lock before download+staging to prevent concurrent updates;
  shutdown old process before staging; use unique temp filename
- check_core_update Tauri command now queries GitHub for latest_version and
  returns update_available alongside outdated
- Harden update_apply RPC: validate download URL is GitHub HTTPS, validate
  asset_name is safe filename starting with openhuman-core-, ignore caller
  staging_dir (always use safe default)
- download_and_stage accepts target_version so installed_version reflects the
  staged release, not the running process
- Add update.check and update.apply to about_app capability catalog
- ops.rs: unwrap_or_default → unwrap_or_else with error context
- tauriCommands.ts: convert to arrow-function exports, add latest_version
  and update_available to CoreUpdateStatus interface

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

* format

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:21:13 -07:00
24b892439d feat(channels): Discord server/channel wiring and picker (#289) (#349)
* feat(channels): add channel_id to DiscordConfig schema

Add optional channel_id field to DiscordConfig for restricting the bot
to a specific Discord channel, matching the pattern used by SlackConfig
and MattermostConfig.

Refs: #289

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

* feat(channels): add channel_id field to Discord definition

Expose channel_id as an optional field in the Discord BotToken auth mode
so users can specify a default channel for outbound messages via the UI.

Refs: #289

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

* feat(channels): create Discord API helper module for guild/channel discovery

Refactor discord.rs into discord/ folder module and add api.rs with:
- list_bot_guilds: GET /users/@me/guilds
- list_guild_channels: GET /guilds/{id}/channels (filtered to text channels)
- check_channel_permissions: compute bot permissions from roles + overwrites

Includes unit tests for type serialization and permission bit constants.

Refs: #289

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

* feat(channels): add Discord RPC handlers for guild/channel discovery

Add three new RPC endpoints:
- openhuman.channels_discord_list_guilds: list servers the bot is in
- openhuman.channels_discord_list_channels: list text channels in a guild
- openhuman.channels_discord_check_permissions: validate bot permissions

These retrieve the stored Discord bot token from credentials and call
the Discord REST API directly from the Rust core.

Refs: #289

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

* feat(channels): wire channel_id into Discord provider for channel filtering

Add channel_id field to DiscordChannel struct and update all construction
sites. When channel_id is set, the listen loop only processes messages
from that specific channel, enabling server+channel-scoped operation.

Refs: #289

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

* feat(channels): add Discord guild/channel API types and RPC methods

Add TypeScript types for DiscordGuild, DiscordTextChannel, and
BotPermissionCheck. Wire up three new RPC methods in channelConnectionsApi
for listing guilds, listing channels, and checking bot permissions.

Refs: #289

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

* feat(channels): create DiscordServerChannelPicker component

Add server and channel selection UI that loads guilds and channels from
the Discord API via the Rust core RPC. Includes permission checking with
visual feedback for missing permissions.

Refs: #289

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

* feat(channels): integrate server/channel picker into DiscordConfig

Show DiscordServerChannelPicker below the connect buttons when the
bot_token connection is active. Guild and channel selections flow back
into the credential field values for persistence.

Refs: #289

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

* test(channels): add unit tests for Discord channel_id and config serde

Add tests for:
- DiscordConfig TOML/JSON deserialization with and without channel_id
- channel_id field storage on DiscordChannel struct
- Config roundtrip serialization

Refs: #289

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

* test(channels): add Vitest tests for DiscordServerChannelPicker

Test guild loading, rendering, and placeholder states with mocked
RPC responses. Verifies the component renders heading, loads guilds
from the mock, and shows the select placeholder.

Refs: #289

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

* fix(ci): resolve discord module conflict and format drift

* fix(reviews): address CodeRabbit Discord picker and permission issues

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 17:35:55 +05:30
github-actions[bot] 32c583aafd chore(release): v0.51.8 2026-04-06 06:16:27 +00:00
github-actions[bot] 36e5736814 chore(release): v0.51.7 2026-04-06 05:54:52 +00:00
Steven EnamakelandGitHub e13980d8ca feat: encrypted OAuth token flow with XOR key-splitting (#327)
* feat: implement encrypted OAuth flow and client key management

- Updated the SkillSetupWizard to include an encryption mode parameter in the OAuth connection URL.
- Enhanced the SkillManager to handle client key shares during OAuth completion, allowing skills to use encrypted proxy requests.
- Introduced a new API endpoint for fetching client key shares, facilitating secure communication.
- Modified the OAuth deep link handler to retrieve and pass the client key share to the skill runtime.
- Implemented client key persistence and restoration in the skill instance, ensuring secure access during runtime.
- Updated the JavaScript fetch implementation to utilize the client key for encrypted proxy requests.

* refactor: improve registry URL handling in registry_cache.rs

- Updated the registry_url function to filter out empty environment variable values for SKILLS_REGISTRY_URL, ensuring a valid URL is always returned.
- Enhanced the code readability by using method chaining for better clarity in the URL retrieval process.

* feat: enhance SkillSetupWizard with manual integration ID entry for dev mode

- Added support for manual entry of integration IDs in development mode within the OAuthLoginView component.
- Implemented functionality to handle OAuth completion using the provided integration ID, including error handling and state management.
- Updated the component's props to include skillId and onManualComplete for better integration with the setup wizard flow.

* feat: enhance SkillSetupWizard with skill runtime readiness check

- Added a mechanism to wait for the skill runtime to be fully running after starting it, improving reliability in the OAuthLoginView component.
- Introduced a new JSON file for skill preferences, enabling configuration for skills like Notion, including setup completion status.

* refactor: streamline code formatting and improve readability in various files

- Simplified the formatting of function calls and JSON output definitions in `desktopDeepLinkListener.ts`, `rest.rs`, and `schemas.rs` for better clarity.
- Cleaned up import statements in `instance.rs` to enhance organization and maintainability.

* feat: remove dictation functionality and related components

- Deleted the DictationOverlay component and its associated hooks, streamlining the application by removing unused dictation features.
- Updated the App component to reflect the removal of dictation-related UI elements.
- Cleaned up settings and navigation to eliminate references to dictation settings and panels, enhancing overall code maintainability.

* refactor: update MemoryWorkspace title and enhance skill runtime error handling

- Changed the title in MemoryWorkspace from "Memory (EverMind)" to "Memory" for clarity.
- Improved error handling in SkillSetupWizard during skill runtime startup, ensuring more informative error messages and a timeout check for skill readiness.
2026-04-04 20:44:42 -07:00