Commit Graph
232 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
Cyrus GrayandGitHub 21e4a8b307 fix(onboarding): remove Screen & Accessibility Permissions step (#557)
* fix(onboarding): remove Screen & Accessibility Permissions step

The permissions step added friction to onboarding without being essential —
users can still configure screen intelligence permissions later via Settings.

Steps are now: Welcome → Referral → Skills → Context Gathering.

* fix(onboarding): remove Screen & Accessibility Permissions step

The permissions step added friction to onboarding without being essential —
users can still configure screen intelligence permissions later via Settings.

Steps are now: Welcome → Referral → Skills → Context Gathering.

* fix(onboarding): skip context gathering when no sources connected

When the user clicks "Skip for Now" on the Gmail step, complete
onboarding immediately instead of showing the context gathering step.

* fix(onboarding): address CodeRabbit review feedback

- Preserve accessibilityPermissionGranted from existing state instead
  of hardcoding false (matches ToolsPanel defensive pattern)
- Update E2E test step comments and detection logic to match the real
  onboarding flow (WelcomeStep → ReferralApplyStep → SkillsStep →
  ContextGatheringStep) and use actual UI text
2026-04-14 13:44:02 +05:30
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
Steven EnamakelandGitHub 2824850708 feat(streaming): thinking tokens, tool call deltas, and progressive channel edits (#549)
* feat(conversations): implement live streaming for assistant responses

- Added support for live streaming of assistant responses in the Conversations component, enhancing user experience during interactions.
- Introduced new interfaces for handling streaming state, including `StreamingAssistantState` and related event handlers for text, thinking, and tool argument deltas.
- Updated the state management to accommodate streaming data, ensuring smooth updates to the UI as new content arrives.
- Enhanced the rendering logic to display provisional assistant bubbles and thinking indicators while responses are being composed.
- Refactored existing event handling to integrate with the new streaming functionality, improving overall responsiveness and interactivity.

This commit significantly improves the real-time interaction capabilities of the assistant, providing users with immediate feedback during conversations.

* feat(channels): progressive-edit streaming for inbound channels

ChannelInboundSubscriber now buffers text/tool delta events on a 1s
timer and edits the outbound channel message in place, so Telegram/
Slack-style conduits can show a single evolving reply instead of a
single atomic bubble at the end. Renders a "🔧 tool …" status line
above the partial text and rewrites with the final canonical reply
on chat_done.

Falls back to atomic-final delivery if the backend's PATCH
/channels/:channel/messages/:id endpoint is unavailable or repeatedly
fails, so existing channels keep working while the edit endpoint is
rolled out.

New rest.rs helper: BackendOAuthClient::send_channel_edit.

* style: cargo fmt on streaming-related files

Auto-applied by cargo fmt after the streaming plumbing changes touched
provider traits, the session turn loop, the channel inbound subscriber,
and the compatible-provider SSE path.

* feat(streaming): compact live preview + Telegram typing indicator

UI: while streaming, show only the trailing ~120 chars of assistant
text in a monospace ticker-tape bubble (cursor + ellipsis prefix) so
the scroll position doesn't jump as tokens arrive. The full response
still replaces the preview via addInferenceResponse on chat_done.

Backend bridge: ChannelInboundSubscriber now fires Telegram's typing
indicator as soon as an inbound message is received and refreshes it
every 4 s while the turn is in flight (Telegram's sendChatAction lasts
~5 s). New BackendOAuthClient::send_channel_typing hits
POST /channels/:channel/typing; the subscriber latches
typing_disabled after two failures so channels without the endpoint
stop getting hit.

* fix(providers): fall back to JSON parse when upstream ignores stream=true

Some OpenAI-compatible backends (including our e2e mock) accept
`stream: true` in the request but reply with a regular
`application/json` body rather than an SSE stream. The previous
implementation blindly pushed the body through the SSE line parser,
which produced an empty aggregated response because the body never
contained `\n\n` event separators.

Detect the non-SSE content-type and fall through to the existing
`parse_native_response` path so the caller still gets the aggregated
response. No deltas are emitted in this case — there's nothing to
stream — but correctness is preserved.

Unblocks the json_rpc_protocol_auth_and_agent_hello E2E test.

* Enhance event handling for progressive-edit streaming in ChannelInboundSubscriber

- Introduced a new `StreamingState` struct to manage the state of progressive-edit streaming, allowing for buffered text and tool deltas.
- Implemented a timer-based flushing mechanism for edits, ensuring timely updates to the channel.
- Refactored event handling logic to accommodate new event types (`text_delta`, `tool_call`, `tool_result`) and improved error handling for chat events.
- Updated the logic for finalizing channel replies to handle both streaming and atomic delivery scenarios, enhancing overall responsiveness and user experience.

This commit significantly improves the handling of real-time updates during user interactions, providing a smoother and more interactive experience.

* Enhance tool call tracking in AgentProgress and parsing logic

- Added a `call_id` field to `ToolCallStarted` and `ToolCallCompleted` variants in the `AgentProgress` enum to uniquely identify tool calls and link them to their respective events.
- Updated the `ParsedToolCall` struct to include an optional `id` field for tool calls originating from native responses, ensuring consistent tracking across different call types.
- Modified the `parse_tool_call_value` function to initialize the `id` field appropriately, enhancing the parsing logic for tool calls.
- Adjusted the `run_tool_call_loop` function to utilize the new `call_id` for progress events, ensuring accurate tracking of tool execution across iterations.
- Enhanced the `spawn_progress_bridge` function to handle the new `call_id` field in progress events, improving the overall event handling mechanism.

These changes improve the robustness of tool call tracking and enhance the clarity of event relationships within the agent's progress reporting.

* Enhance tool call tracking and event handling in Conversations component

- Added a `tool_call_id` field to `ChatToolCallEvent` and `ChatToolResultEvent` interfaces for improved tracking of tool calls across events.
- Updated event key generation in the Conversations component to include `tool_call_id`, ensuring unique identification of tool events.
- Enhanced the logic for managing tool timelines to prevent duplication of entries by reconciling existing tool calls based on `tool_call_id`.
- Improved handling of tool argument deltas and results, allowing for more accurate updates to the UI during tool execution.

These changes significantly improve the robustness of tool call tracking and enhance the clarity of event relationships within the Conversations component.

* Enhance tool call event handling and progress reporting in Agent

- Updated the `run_tool_call_loop` function to include stable IDs for tool calls, ensuring unique identification across iterations.
- Introduced early completion events for failed tool calls, improving client-side error handling and user experience.
- Refactored the `emit_progress` function to use asynchronous sending, ensuring lifecycle events are not dropped due to backpressure.
- Enhanced the `turn` method to await progress emissions, improving synchronization during user message processing.

These changes significantly improve the robustness of tool call tracking and enhance the clarity of event relationships within the agent's progress reporting.

* fix(channels): close stuck drafts, prevent duplicate post, add bridge logs

Findings #3, #5, #6 from the follow-up review:

channels/bus.rs
- chat_done handler no longer returns early on empty reply — it now
  finalizes with a "(No response from agent.)" fallback so any draft
  we posted during streaming gets closed off instead of being left
  showing "_working…_" forever.
- StreamingState gained `draft_sent: bool`, set whenever the initial
  send_channel_message succeeds (even when the backend's response
  didn't include an id). finalize_channel_reply now checks this flag
  and silently skips the "no draft → send atomic" fallback when a
  draft was posted but id was lost — fixes a duplicate-bubble bug
  where an id-less draft plus a chat_done finalize produced two
  messages in the user's channel.

channels/providers/web.rs
- spawn_progress_bridge now logs a scoped entry message on startup
  (client_id/thread_id/request_id), a per-variant trace/debug line on
  each AgentProgress event (with call_id/iteration correlation), and
  an exit message with final round + events_seen count. SubagentFailed
  is logged at warn level for visibility.
2026-04-13 20:38:00 -07:00
Steven EnamakelandGitHub 5a8a7edb91 Refine billing, settings, rewards, and usage UI (#547)
* feat: add react-icons support and refactor skill category handling

- Added `react-icons` dependency to the project for enhanced icon usage.
- Introduced new skill icons in the `toolkitMeta.tsx` component, replacing SVG icons with `react-icons` for improved maintainability and consistency.
- Created a new `skillCategories.ts` file to define skill categories and their order, streamlining the management of skill categories across the application.
- Refactored the `SkillCategoryFilter` component to utilize the new skill categories structure, enhancing clarity and reducing redundancy in the codebase.
- Updated the `Skills` page to leverage the new icon rendering method and skill categories, improving the overall user experience.
- Added tests to ensure the correct functionality of the new skill category and icon implementations.

* feat: update environment configuration and enhance settings UI

- Updated `.env.example` and `app/.env.example` to reflect new backend URL and added optional environment selector for staging.
- Enhanced `SettingsHome` component by separating account and billing sections for improved clarity.
- Introduced a new billing section in the settings menu to streamline user navigation.
- Updated `useSettingsNavigation` hook to accommodate changes in settings structure.
- Improved `BillingPanel` to handle session token checks and ensure accurate billing state retrieval.
- Refactored `Rewards` page to enhance user experience with clearer progress indicators and improved layout.
- Added tests to validate changes in the rewards and settings components.

* feat(config): enhance API base URL handling and environment configuration

- Introduced a new staging API base URL constant for better environment management.
- Added app environment variable constants to streamline environment detection.
- Refactored effective API URL resolution to accommodate environment-specific defaults.
- Implemented functions to resolve app environment from process environment variables.
- Added tests to validate the correct behavior of staging and production API URL handling.

* feat(rewards): add community and referrals tabs for rewards management

- Introduced `RewardsCommunityTab` and `RewardsReferralsTab` components to enhance the rewards management interface.
- The `RewardsCommunityTab` displays user progress, Discord role statuses, and connection options, improving user engagement with rewards.
- The `RewardsReferralsTab` allows users to manage their referral program, track progress, and access coupon rewards in a streamlined layout.
- Updated the `Rewards` page to integrate these new tabs, enhancing overall user experience and navigation.

* feat(rewards): introduce ReferralRewardsSection and RewardsRedeemTab components

- Added `ReferralRewardsSection` to manage referral statistics and code application, enhancing user engagement with the referral program.
- Created `RewardsRedeemTab` to streamline the process of applying reward codes, improving the overall rewards management experience.
- Updated `Rewards` page to include the new redeem tab, allowing users to easily switch between referral and redeem functionalities.
- Refactored `RewardsCommunityTab` to adjust the referral selection handler, ensuring consistent navigation across the rewards interface.
- Removed redundant UI elements in `RewardsCouponSection` for a cleaner layout.
- Enhanced tests to cover new functionalities and ensure robust performance across the rewards system.

* feat(ui): introduce PillTabBar component and refactor SkillCategoryFilter and Rewards pages

- Added a new `PillTabBar` component to enhance tab navigation with customizable styles and item rendering.
- Refactored `SkillCategoryFilter` to utilize `PillTabBar`, improving code clarity and reducing redundancy in button rendering.
- Updated the `Rewards` page to replace the existing tab navigation with `PillTabBar`, streamlining the user interface for switching between referral, rewards, and redeem tabs.
- Enhanced the `ReferralRewardsSection` layout for better user experience and consistency across the rewards management interface.
- Improved tests to cover the new `PillTabBar` functionality and ensure robust performance across the updated components.

* fix(rewards): update placeholder and button text in RewardsCouponSection

- Changed the input placeholder from "Promo code" to "Coupon code" for clarity.
- Updated button text from "Apply code" to "Redeem Code" to better reflect the action being performed.
- Adjusted loading state text from "Applying…" to "Redeeming..." for consistency in user feedback.

* feat(composio): enhance toolkit handling and improve user messaging

- Updated the `ComposioConnectModal` to simplify the connection message, removing unnecessary wording for clarity.
- Introduced a `TOOLKIT_ALIASES` mapping in `toolkitMeta.tsx` to standardize toolkit slugs, improving consistency across the application.
- Refactored the `composioToolkitMeta` function to utilize the new slug mapping, enhancing toolkit metadata retrieval.
- Improved the `useComposioIntegrations` hook to leverage the canonicalized toolkit slugs for better integration handling.
- Adjusted the `Skills` page to normalize toolkit slugs during rendering, ensuring a consistent user experience.
- Updated tests to reflect changes in messaging and toolkit handling, ensuring robust functionality across the application.

* feat(intelligence): add new tabs for Dreams, Memory, and Subconscious features

- Introduced `IntelligenceDreamsTab`, which displays generated dreams based on daily life events, enhancing user engagement with a visually appealing layout.
- Added `IntelligenceMemoryTab` to manage actionable items, featuring search and filter capabilities for improved user interaction with memory data.
- Created `IntelligenceSubconsciousTab` to handle subconscious tasks and logs, providing users with insights and management options for their subconscious activities.
- Refactored the `RewardsCommunityTab` to remove unused Discord role status logic, streamlining the component for better performance.
- Implemented a new `PageBackButton` component for consistent navigation across settings pages.
- Enhanced the `BillingPanel` and its subcomponents to improve user experience in managing billing and subscription details, including transaction history and payment methods.
- Added new billing-related tabs for better organization and access to billing features, including `BillingOverviewTab`, `BillingPaymentsTab`, and `BillingPlansTab`.
- Updated tests to ensure functionality across new and refactored components, maintaining robust application performance.

* refactor(billing): update BillingPanel and BillingPlansTab for improved user experience

- Changed the default selected tab in `BillingPanel` from 'overview' to 'plans' to prioritize subscription management.
- Removed the `BillingOverviewTab` from the `BillingPanel`, streamlining the billing interface.
- Enhanced the `BillingPlansTab` header to clarify the purpose, changing "Explore tiers" to "Choose a Subscription Plan".
- Updated the description in `BillingPlansTab` for better clarity on payment options.
- Improved the layout of the `SubscriptionPlans` component to better highlight crypto payment options and their availability.
- Cleaned up unused code and comments for better maintainability.

* refactor(billing): streamline BillingPanel and BillingPlansTab components

- Removed unused `teamUsage` state and related API call from `BillingPanel` to simplify data management.
- Adjusted layout in `BillingPlansTab` for improved visual hierarchy and user experience.
- Cleaned up code by eliminating unnecessary comments and enhancing maintainability.

* refactor(billing): enhance SubscriptionPlans layout for improved responsiveness

- Updated the layout of the `SubscriptionPlans` component to ensure better responsiveness and visual consistency.
- Adjusted class names to include minimum height and width properties for better alignment across different screen sizes.
- Enhanced the layout of the pricing display section for improved clarity and user experience.

* refactor(billing): update subscription plans and billing components for improved clarity and user experience

- Adjusted pricing for BASIC and PRO plans to reflect new monthly and annual rates.
- Enhanced feature descriptions for subscription plans to better communicate value.
- Removed redundant UI elements in the BillingPaymentsTab and PayAsYouGoCard for a cleaner layout.
- Added loading and confirmation messages in SubscriptionPlans to improve user feedback during payment processes.
- Updated class names for better responsiveness and visual consistency across billing components.

* refactor(billing): improve error messaging and UI consistency in billing components

- Updated error message in BillingPanel to specify adding a payment card on Stripe for clarity.
- Changed header text in AutoRechargeSection to "Enable Auto-Recharge" for better user understanding.
- Modified button text in AutoRechargeSection to "Add card on Stripe" for consistency.
- Enhanced styling in PayAsYouGoCard for improved visual appeal and user interaction.
- Removed redundant UI elements in PayAsYouGoCard for a cleaner layout.

* refactor(billing): remove unused error handling and improve UI consistency across billing components

- Eliminated `setArError` prop from BillingPanel, AutoRechargeSection, and BillingPaymentsTab to streamline error handling.
- Enhanced layout and styling in BillingHistoryTab and SubscriptionPlans for better visual consistency and user experience.
- Removed the BillingOverviewTab component to simplify the billing interface and improve maintainability.

* refactor(billing): update feature descriptions and enhance SubscriptionPlans display

- Revised feature descriptions in the PLANS array for clarity and conciseness.
- Increased the number of displayed features in the SubscriptionPlans component to provide users with more information at a glance.

* refactor(billing): update billing components for improved clarity and functionality

- Revised feature descriptions in the PLANS array to reflect increased usage limits.
- Renamed header in BillingHistoryTab to "Transaction History" and updated description for clarity.
- Adjusted transaction amount formatting in BillingHistoryTab to display five decimal places.
- Removed redundant UI elements in BillingPaymentsTab to streamline the layout.
- Enhanced PayAsYouGoCard with improved credit balance display and top-up options, including validation for custom amounts.

* feat(usage): add budget completion message logic and update tests

- Introduced `shouldShowBudgetCompletedMessage` to the `UsageState` interface to indicate when the budget completion message should be displayed.
- Updated the `useUsageState` hook to calculate the budget completion message based on user credits and budget status.
- Enhanced tests for `useUsageState` to verify the correct behavior of the budget completion message under various scenarios.
- Modified the `Conversations` component to display the budget completion message appropriately based on the new logic.

* style: apply formatter fixes from pre-push hook

* refactor(rewards): update coupon section and test cases for clarity and consistency

- Renamed placeholder text and button labels in the RewardsCouponSection test to reflect updated terminology.
- Adjusted test assertions to ensure they align with the new button and placeholder names.
- Updated pricing details in billingHelpers tests to reflect new monthly and annual rates for BASIC and PRO plans.
- Enhanced the ContextGatheringStep labels for better clarity regarding email and LinkedIn processing stages.

* style(tests): format coupon code input changes for consistency

- Reformatted the coupon code input changes in the RewardsCouponSection test for improved readability and consistency.
- Ensured that the test cases maintain a uniform style for better maintainability.

* refactor: enhance accessibility and improve code structure in various components

- Added ARIA roles and attributes to the PillTabBar for better accessibility.
- Refactored the canonicalization logic for toolkit slugs into a new file for improved organization.
- Updated the IntelligenceDreamsTab and IntelligenceMemoryTab components for better readability and accessibility.
- Enhanced error handling and logging in the IntelligenceSubconsciousTab for improved debugging.
- Streamlined the ReferralRewardsSection and RewardsCommunityTab components by normalizing referral code input handling.
- Removed unused props and improved layout consistency in BillingPanel and related components.
- Updated the Skills page to handle subconscious escalation dismissals more effectively.

* feat(release): configure staging environment for deployment

- Added steps to configure the staging app environment in the release workflow.
- Set environment variables for staging, including OPENHUMAN_APP_ENV and VITE_OPENHUMAN_APP_ENV.
- Updated build and deployment steps to conditionally use staging settings based on the build target.
- Ensured proper handling of workspace paths for staging deployments.

* chore(env): add optional staging environment variable to .env.example

- Introduced OPENHUMAN_APP_ENV variable to specify the app environment as 'staging'.
- Updated .env.example to include new environment configuration for clarity.

* refactor(intelligence): streamline navigation and improve text formatting

- Simplified the navigation logic in the IntelligenceSubconsciousTab for better readability.
- Improved text formatting in the IntelligenceDreamsTab for enhanced clarity and consistency.
- Refactored import statements in toolkitMeta.tsx for better organization.
2026-04-13 18:10:07 -07:00
Steven EnamakelandGitHub f26a0c50b0 feat(referral): switch to link-based claims with flat $5 rewards (#546)
* refactor(referral): update referral system to a one-time flat reward structure

- Transitioned to a link-based referral system offering a one-time $5 credit to both the referrer and the referred user upon the first subscription payment.
- Removed the previous reward rate in basis points and eliminated recurring rewards, ensuring clarity in the referral process.
- Updated API endpoints and service methods to reflect the new `claimReferral` functionality, enhancing user experience and eligibility checks.
- Revised documentation and tests to align with the new referral structure, ensuring comprehensive coverage and understanding of the changes.

* refactor(referral): simplify JSON response handling in referral claim function

- Streamlined the `handle_referral_claim` function by removing unnecessary `as_deref()` and `filter()` calls, enhancing code clarity and performance.
- Updated the JSON response construction to eliminate redundant line breaks, improving readability without altering functionality.
2026-04-13 14:58:58 -07:00
Steven EnamakelandGitHub 8057f2283c feat: onboarding Gmail integration + LinkedIn profile enrichment (#524)
* refactor(composio): restructure toolkit metadata handling and onboarding steps

- Removed the old `toolkitMeta.ts` file and replaced it with a new `toolkitMeta.tsx` file that includes updated metadata handling for Composio toolkits, enhancing the integration with React components.
- Updated the `ComposioConnectModal` to directly render icons without additional markup, streamlining the component structure.
- Modified the `Skills` page to utilize the new icon rendering method, improving consistency across the application.
- Enhanced the onboarding process by introducing a new `ContextGatheringStep` component, which gathers user context from connected integrations, improving the onboarding experience.
- Updated the `SkillsStep` to reflect changes in toolkit connection handling and display, ensuring a smoother user interaction during onboarding.

* feat(apify): introduce Apify integration tools for actor execution and status retrieval

- Added new tools for running Apify actors and fetching their run statuses, enhancing automation capabilities.
- Updated the integration schema to include an `apify` toggle for user configuration, allowing for flexible integration management.
- Enhanced the onboarding experience by modifying the SkillsStep to focus on Gmail integration, streamlining user interactions.
- Improved documentation and comments for clarity on the new Apify functionalities and their usage.

* feat(learning): add LinkedIn enrichment module and schemas

- Introduced a new `linkedin_enrichment` module for enriching user profiles by scraping LinkedIn data from Gmail.
- Implemented the `run_linkedin_enrichment` function to handle the enrichment pipeline, including Gmail search, scraping via Apify, and data persistence.
- Added controller schemas for the learning domain, enabling integration with the existing controller framework.
- Updated the `all.rs` file to register the new learning controllers and schemas, enhancing the overall functionality of the learning system.

* feat(linkedin): implement PROFILE.md generation for LinkedIn enrichment

- Added functionality to generate a PROFILE.md file from scraped LinkedIn data, summarizing user profiles for agent context.
- Updated the `run_linkedin_enrichment` function to write PROFILE.md to the workspace, enhancing data persistence.
- Introduced helper functions for rendering and summarizing LinkedIn profiles, improving the overall enrichment process.
- Ensured minimal PROFILE.md creation even when scraping fails, maintaining essential user context.

* feat(onboarding): enhance ContextGatheringStep for LinkedIn enrichment pipeline

- Updated the ContextGatheringStep to integrate a new pipeline for LinkedIn enrichment, replacing the previous Gmail profile fetching stages.
- Implemented a progress animation and logging for the enrichment process, improving user feedback during data retrieval.
- Refactored stage definitions to align with the new pipeline structure, enhancing clarity and maintainability.
- Introduced error handling and status updates for each stage of the enrichment process, ensuring robust user experience.

* feat(instructions): refactor tool instruction generation for clarity and flexibility

- Introduced helper functions `tool_instructions_preamble` and `append_tool_entry` to streamline the construction of tool instructions.
- Updated `build_tool_instructions` to utilize the new helper functions, improving code readability and maintainability.
- Added `build_tool_instructions_filtered` to allow for generating instructions from a filtered list of tools, enhancing flexibility in tool usage.
- Adjusted the startup process to use the filtered instructions, ensuring only relevant tools are included in the system prompt.

* refactor(toolkitMeta): simplify component structure and improve readability

- Refactored the `BrandIcon` component to streamline its props definition, enhancing code clarity.
- Consolidated SVG path definitions in various icons for better readability and maintainability.
- Updated the `ContextGatheringStep` to simplify the RPC call syntax, improving code conciseness.
- Enhanced logging in the LinkedIn enrichment process for clearer tracking of Gmail searches and scraping stages.

* fix: address PR review — USER.md→PROFILE.md consistency, Composio tool filtering, and quality fixes

- Replace USER.md with PROFILE.md across all prompt paths: channels_prompt.rs,
  subconscious/prompt.rs, workspace/ops.rs bootstrap, and channel tests
- Remove Composio tool description from main agent system prompt (tool_descs)
  so skills_agent is the only agent that sees Skill-category tools
- Add "learning" namespace description for CLI help discovery
- Fix react-hooks/set-state-in-effect: wrap synchronous setState in
  queueMicrotask in ContextGatheringStep
- Derive SkillsStep displayToolkits from backend allowlist with error/retry UI
- Add KNOWN_COMPOSIO_TOOLKITS alternate slug variants (google_calendar, etc.)
- Add namespaced debug logging to onboarding handlers and pipeline
- Deduplicate MemoryClient creation in linkedin_enrichment persist functions

* fix: use setTimeout instead of queueMicrotask for ESLint compatibility

* refactor(onboarding): streamline debug logging in handleContextNext function

- Consolidated debug logging in the handleContextNext function to improve clarity and reduce verbosity.
- Removed unnecessary line breaks for a more concise code structure.

* refactor(linkedin): enhance enrichment pipeline with structured stage results

- Introduced a new `EnrichmentStage` struct to capture detailed results for each stage of the LinkedIn enrichment process.
- Updated the `LinkedInEnrichmentResult` to include a vector of stages, allowing for structured reporting of success, failure, and skipped stages.
- Improved error handling and logging throughout the enrichment pipeline, ensuring better traceability of issues during execution.
- Adjusted the API response to include stage results, enhancing the frontend's ability to display detailed enrichment outcomes.

* chore(workflows): update macOS E2E test configuration and comment out Linux E2E job

- Modified the description and default values in the macOS E2E test input options for clarity.
- Commented out the entire Linux E2E job configuration to prevent execution while maintaining the setup for future use.
2026-04-13 14:16:53 -07: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 a115758c6c Improve local voice readiness and add Composio trigger history (#516)
* feat: enhance local AI asset state management and error handling

- Updated the Home component to improve readiness checks for local AI assets, ensuring a more robust UI experience.
- Refactored the LocalAiService to provide clearer state management for STT and TTS models, including handling on-demand downloads and error logging.
- Enhanced the voice status function to accurately reflect the availability of transcription backends, improving overall system reliability.
- Introduced warnings for on-demand model downloads to inform users about potential delays in functionality.

* feat: implement polling for voice server status in OverlayApp

- Added a polling mechanism to periodically check the voice server status every 2 seconds, ensuring the overlay remains in sync with the server state.
- Introduced logic to activate or dismiss the speech-to-text (STT) mode based on the server's recording or transcribing state, enhancing user experience and responsiveness.
- Utilized the existing `callCoreRpc` function to fetch server status, improving reliability in state management during brief disconnects or reconnections.

* feat: refine prompt handling in LocalAiService

- Updated the prompt construction logic in `LocalAiService` to enhance clarity and functionality.
- When `no_think` is set, the system prompt now includes a directive for the model to respond with only the final answer, improving response accuracy.
- Refactored the prompt and system parameters to ensure they are correctly formatted and passed to the `OllamaGenerateRequest`, enhancing overall request handling.

* feat: enhance STT readiness checks in VoicePanel and useVoiceSkillStatus

- Updated the STT readiness logic in `VoicePanel` to account for both 'ready' and 'ondemand' states, improving the accuracy of readiness assessments.
- Refined the `useVoiceSkillStatus` hook to ensure it only blocks when the local AI's STT state is explicitly 'missing', enhancing overall system reliability and user experience.

* feat(composio): implement ComposeIO trigger history component and hook

- Added `ComposeioTriggerHistory` component to display a list of ComposeIO trigger events with formatted timestamps and payloads.
- Introduced `useComposeioTriggerHistory` hook to manage fetching and state of trigger history entries, including error handling and loading states.
- Updated `Webhooks` page to integrate the new component and hook, replacing previous webhook activity display with ComposeIO trigger history.
- Created utility functions for formatting timestamps and payloads for better readability in the UI.
- Established backend support for fetching trigger history through new Tauri commands, ensuring robust data handling and storage.

* style: apply repo formatting fixes

* feat: add fs2 dependency and enhance ComposeIO trigger history handling

- Introduced the `fs2` crate to manage file locking, improving the reliability of file operations in the ComposeIO trigger history.
- Updated `ComposioTriggerHistoryStore` to utilize exclusive file locks during archive writing, ensuring data integrity.
- Enhanced error handling for file operations, providing clearer logging for failures related to file access and locking.
- Refactored the initialization logic for global trigger history to prevent duplicate setups, improving overall stability.
2026-04-12 16:43:33 -07:00
Steven EnamakelandGitHub ef9c117e9e test: expand agent harness coverage (#513)
* feat(tests): add comprehensive unit tests for hooks and memory context

- Introduced a suite of tests for the `fire_hooks` function, ensuring that all hooks are dispatched even if one fails, enhancing reliability in the hook execution flow.
- Added tests for the `sanitize_tool_output` function to validate the correct mapping of success and failure messages for various tool outputs.
- Implemented a mock memory structure to facilitate testing of memory context building, ensuring that working memory is prioritized and deduplication occurs correctly.
- Enhanced the `build_memory_context` function tests to verify filtering and truncation of memory entries, improving the robustness of memory management in the system.
- Overall, these tests aim to strengthen the codebase by ensuring that critical functionalities related to hooks and memory context are thoroughly validated.

* feat(tests): enhance unit tests for provider alias resolution and prompt options

- Updated the `provider_alias_and_route_selection_round_trip` test to dynamically resolve the first provider from the registry, ensuring accurate alias resolution.
- Added new tests for `DumpPromptOptions` and `ComposioStubTools`, validating default settings and expected tool names.
- Introduced tests for rendering main agent dumps, ensuring tool instructions and skill counts are correctly included in the output.
- Enhanced prompt handling tests to cover cache boundary extraction and subagent render options, improving overall test coverage and reliability.

* feat(tests): enhance error handling and formatting in unit tests

- Added new tests for `AgentError` variants to validate string formatting and error recovery from `anyhow`.
- Improved formatting consistency in existing tests for better readability.
- Enhanced the `sanitize_tool_output` test to ensure accurate mapping of success and failure messages.
- Updated memory loader tests to enforce minimum limits and budget constraints, ensuring robust memory management.
- Overall, these changes aim to strengthen the test suite by improving coverage and clarity in error handling scenarios.

* feat(tests): add unit tests for tool filtering and subagent dump rendering

- Introduced new tests to validate the filtering of tools based on named scopes and disallowed tools, ensuring correct tool selection in debug dumps.
- Added tests for rendering subagent dumps, including handling file prompt fallbacks and missing files without panicking.
- Enhanced the workspace prompt handling to prefer custom prompt locations, improving the flexibility and reliability of agent prompt rendering.
- Overall, these additions strengthen the test suite by covering critical functionalities related to tool filtering and prompt rendering.

* feat(tests): add comprehensive unit tests for memory loader and multimodal helpers

- Introduced new tests for the memory loader to validate behavior when the header exceeds budget and when recall fails, ensuring robust memory management.
- Added tests for multimodal helpers, covering image marker counting, payload extraction, and MIME type normalization, enhancing the reliability of multimodal interactions.
- Overall, these additions strengthen the test suite by improving coverage and ensuring correct functionality in memory handling and multimodal processing.

* feat(tests): add unit tests for tool execution and agent behavior

- Introduced new tests for the `run_tool_call_loop` function, validating the rejection of vision markers for non-vision providers and ensuring correct streaming of final text chunks.
- Added tests to verify that CLI-only tools are blocked in prompt mode and that native tool results are persisted as tool messages.
- Enhanced the `Agent` class with tests for error handling and event publishing during single runs, ensuring robust agent behavior in various scenarios.
- Overall, these additions strengthen the test suite by improving coverage and reliability in tool execution and agent interactions.

* feat(tests): enhance tool execution and agent behavior tests

- Added new tests for the `run_tool_call_loop` function, including scenarios for auto-approving supervised tools on non-CLI channels and handling unknown tools with default max iterations.
- Introduced `ErrorResultTool` and `FailingTool` to simulate error conditions during tool execution, improving coverage of error handling in the agent.
- Updated the `ScriptedProvider` to return results wrapped in `anyhow::Result`, ensuring consistent error handling across test cases.
- Overall, these enhancements strengthen the test suite by validating tool execution paths and agent behavior under various conditions.

* refactor(tests): improve test readability and structure

- Enhanced formatting in various test cases for better clarity and consistency, including the use of line breaks and indentation.
- Updated assertions to improve readability by aligning them with Rust's idiomatic style.
- Overall, these changes aim to strengthen the test suite by making it more maintainable and easier to understand.

* docs(agent): enhance module documentation for agent domain

- Added comprehensive documentation to the `mod.rs` file, detailing the agent domain's purpose, key components, and their functionalities.
- Improved clarity on how LLMs interact with the system, manage conversation history, and handle autonomous behaviors.
- This update aims to enhance understanding and maintainability of the agent domain within the OpenHuman project.

* docs(agent): improve documentation and formatting across multiple files

- Enhanced comments and documentation in `dispatcher.rs`, `error.rs`, `hooks.rs`, and `harness/mod.rs` for better clarity and consistency.
- Adjusted formatting in the `TurnContext` and `ToolCallRecord` structs to improve readability and understanding of their purpose and functionality.
- Overall, these changes aim to strengthen the documentation and maintainability of the agent domain within the OpenHuman project.

* feat(tests): add comprehensive tests for memory loader and agent behavior

- Introduced new tests for the `DefaultMemoryLoader`, validating error propagation during primary recall failures and ensuring correct context emission when working memory is present.
- Added tests to verify behavior when the working memory section exceeds budget constraints, enhancing memory management robustness.
- Overall, these additions strengthen the test suite by improving coverage and reliability in memory handling and agent interactions.

* refactor(tests): improve formatting and readability in memory loader tests

- Reformatted the `load_context` calls in memory loader tests for better readability by chaining method calls.
- Enhanced documentation comments in the `pformat.rs` file to clarify the purpose and functionality of functions.
- Improved consistency in spacing and formatting across various sections of the codebase, including the `interrupt.rs` and `builder.rs` files.
- Overall, these changes aim to enhance code clarity and maintainability within the test suite and related modules.

* feat(tests): add new tests for self-healing interceptor and local AI provider

- Introduced tests to validate the detection of missing commands in the `SelfHealingInterceptor`, ensuring proper handling of recognized and unrecognized patterns.
- Added tests for the `ensure_polyfill_dir` method to confirm directory creation and path exposure.
- Enhanced local AI provider tests to verify correct behavior when the service is ready and the appropriate tier is set, as well as ensuring local metadata is utilized during provider resolution.
- Overall, these additions strengthen the test suite by improving coverage and reliability in self-healing and local AI functionalities.

* refactor(tests): enhance test structure and external ID handling in escalation tests

- Updated the `envelope` function to accept an `external_id` parameter, improving flexibility in test scenarios.
- Modified various test cases to utilize specific external IDs, enhancing clarity and ensuring accurate event assertions.
- Introduced a mutex lock in local AI tests to prevent race conditions, ensuring reliable test execution.
- Overall, these changes improve the robustness and maintainability of the test suite for escalation and local AI functionalities.

* refactor(tests): remove redundant test modules and improve test organization

- Eliminated unused test modules from `hooks.rs`, `memory_loader.rs`, `fork_context.rs`, `interrupt.rs`, and `parse.rs` to streamline the codebase.
- Enhanced overall test organization by consolidating relevant tests into appropriate files, improving maintainability and readability.
- These changes aim to simplify the test structure and focus on active test cases, ensuring a cleaner and more efficient testing environment.

* refactor(tests): improve test formatting and readability

- Reformatted assertions in multiple test cases for better readability by aligning them with Rust's idiomatic style.
- Enhanced the structure of test cases by using line breaks and consistent indentation, improving overall clarity.
- These changes aim to strengthen the test suite by making it more maintainable and easier to understand.

* refactor(api): improve string containment check and formatting in transcript handling

- Updated the `key_bytes_from_string` function to use a more concise containment check for special characters.
- Changed the message writing in the `write_transcript` function to utilize `writeln!` for better formatting.
- Enhanced the condition in `latest_in_dir` to use `is_none_or` for improved readability and clarity.
- These changes aim to streamline code and enhance maintainability across the API and transcript handling modules.

* refactor(code): streamline function implementations and improve readability

- Removed unnecessary whitespace in `run_voice_server_command` for cleaner code.
- Simplified directory search logic in `bundled_openclaw_prompts_dir` by using `find` instead of a loop.
- Updated `request_accessibility_access` to use direct references for keys and values, enhancing clarity.
- Improved documentation formatting in `mod.rs` and `types.rs` for better consistency.
- Refactored `Config` initialization in `load.rs` to use struct update syntax for clarity.
- Added `#[allow(clippy::too_many_arguments)]` annotations in multiple functions to address linter warnings.
- Enhanced type definitions and function signatures for better type safety and readability in various modules.
- Overall, these changes aim to improve code maintainability and readability across the project.

* chore(ci): update typecheck workflow and pre-push hooks to include clippy checks

- Modified the GitHub Actions workflow to run clippy with warnings treated as errors for the `openhuman` package.
- Enhanced the pre-push hook to include clippy checks, ensuring code quality before pushing changes.
- Updated package.json to define a new script for running clippy, integrating it into the format check process.
- These changes aim to improve code quality and maintainability by enforcing stricter linting rules.

* refactor(api): simplify condition in key_bytes_from_string function

- Streamlined the condition in the `key_bytes_from_string` function to improve readability by consolidating the if statement into a single line.
- This change enhances code clarity while maintaining the original functionality of the key validation process.

* chore(package): update format:check script to remove clippy integration

- Modified the `format:check` script in `package.json` to exclude the clippy check, streamlining the formatting process.
- This change simplifies the formatting workflow while maintaining the integrity of Rust formatting checks.

* refactor(core): enhance documentation and structure in core modules

- Improved documentation across various core functions, including `build_registered_controllers`, `run_from_cli_args`, and `dispatch`, to clarify their purpose and usage.
- Streamlined comments to provide clearer guidance on the flow of operations and error handling.
- Enhanced the structure of the `EventBus` and `NativeRegistry` to improve readability and maintainability.
- Overall, these changes aim to improve code clarity and facilitate easier navigation and understanding of the core components.

* refactor(core): reorganize imports in engine.rs for clarity

- Adjusted the import statements in `engine.rs` to improve organization and readability.
- Moved the macOS-specific import of `validate_focused_target` to a more appropriate location and ensured consistent ordering of imports.
- These changes aim to enhance code clarity and maintainability within the core module.

* refactor(core): enhance WebChannelEvent structure and documentation

- Introduced a new `WebChannelEvent` struct to standardize event payloads for chat-related activities, including fields for event name, client ID, thread ID, request ID, and optional response details.
- Improved documentation for the `attach_socketio` function, clarifying its role in setting up Socket.IO event handlers and the associated chat logic.
- Removed unused structs and streamlined the event handling process to improve code clarity and maintainability across the core module.

* refactor(core): streamline Socket.IO event handlers for clarity and consistency

- Refactored the Socket.IO event handlers in `attach_socketio` to improve readability by standardizing the formatting and structure of the code.
- Enhanced the organization of the event handling logic for `rpc:request`, `chat:start`, and `chat:cancel` events, making it easier to follow the flow of operations.
- These changes aim to improve code maintainability and facilitate easier navigation within the Socket.IO integration.

* feat(core): add new structs for Socket RPC and chat events

- Introduced `SocketRpcRequest`, `ChatStartPayload`, and `ChatCancelPayload` structs to facilitate handling of Socket.IO events related to chat functionality.
- These additions enhance the structure and clarity of the event payloads, improving the maintainability of the Socket.IO integration.

* refactor(core): remove unused json_type_name function from socketio.rs

- Eliminated the `json_type_name` function from `socketio.rs` as it was not utilized in the current codebase.
- This change helps to clean up the code and improve maintainability by removing unnecessary functions.

* chore(ci): update clippy command in typecheck workflow

- Modified the clippy command in the GitHub Actions workflow to remove the `-D warnings` flag for the `openhuman` package, allowing warnings to be displayed without failing the build.
- This change aims to improve the development experience by providing more flexibility during code analysis while still encouraging code quality.

* chore(husky): remove clippy check from pre-push hook

- Eliminated the clippy command from the pre-push hook to streamline the pre-push checks.
- Updated the failure message to reflect the removal of clippy, focusing on format, lint, TypeScript, and Rust errors only.
- This change simplifies the pre-push process while maintaining essential checks for code quality.

* refactor(tests): add macOS-specific imports for enhanced test coverage

- Introduced conditional imports for macOS in the tests module of `engine.rs` to support platform-specific functionality.
- This change improves the test setup for macOS environments, ensuring compatibility and enhancing overall test coverage.

* refactor(tests): update tool call execution in test cases

- Modified the `execute_tool_call` method calls in multiple test cases to include a second parameter, improving the accuracy of the tests.
- This change ensures that the tests reflect the latest method signature and enhances the reliability of the test outcomes.
2026-04-12 13:30:24 -07:00
Steven EnamakelandGitHub 8635ac16c5 feat: real-time inference progress events for web channel (#514)
* feat(conversations): implement real-time inference status tracking

- Added new event listeners for inference start, iteration start, subagent spawning, and completion to track the live state of chat interactions.
- Introduced an `InferenceStatus` interface to manage the current phase and active tools/subagents for each thread.
- Updated the UI to display inference status indicators, enhancing user experience during chat interactions.
- Created a new `progress` module in the Rust backend to emit real-time progress events, allowing for better integration with the web channel.
- Refactored the `subscribeChatEvents` function to include new event handlers for managing inference and subagent events, improving clarity and maintainability of the event handling logic.

* style: fix formatting from pre-push hook

* fix(test): read SSE events until chat_done instead of first event

The e2e test expected `chat_done` as the first SSE event, but now
real-time progress events (inference_start, iteration_start) are
emitted before it. Use `read_sse_event_by_type` to skip progress
events and wait for the terminal `chat_done` event.
2026-04-12 11:58:36 -07: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
Steven EnamakelandGitHub 759691e380 feat(composio): improve toolkit sync and connection handling (#507)
* Enhance release workflow with build target input and improved job structure

- Added a new input parameter `build_target` to specify the environment (production or staging) for the release process.
- Made `release_type` input optional with a default value of `patch`.
- Refactored job names and dependencies to reflect the new build target logic, including conditional steps for production and staging environments.
- Introduced a `resolve` step to determine build outputs based on the selected environment, enhancing the workflow's flexibility and clarity.
- Updated the `create-release` job to depend on the new `prepare-build` job, ensuring proper execution flow based on the build target.

* feat(composio): enhance Composio integration with toolkit management and testing

- Added `KNOWN_COMPOSIO_TOOLKITS` constant to facilitate access to available toolkits.
- Implemented unit tests for `useComposioIntegrations` to ensure correct behavior during toolkit and connection fetching, including error handling scenarios.
- Updated `Skills` page to utilize the new `KNOWN_COMPOSIO_TOOLKITS` for improved toolkit display logic.
- Refactored hooks to handle connection errors gracefully and maintain toolkit visibility.
- Enhanced backend integration by updating Composio client configuration to streamline toolkit management.

* refactor(dispatch): remove channel delivery instructions for Telegram

- Deleted the `channel_delivery_instructions` function, which provided response guidelines for Telegram messages. This change simplifies the message processing logic in the `process_channel_message` function by eliminating unnecessary instructions, enhancing clarity and maintainability.

* refactor(composio): simplify Composio client configuration and remove toggles

- Updated the `build_composio_client` function to remove unnecessary configuration checks, as Composio is always enabled when the user is signed in.
- Revised the `resolve_client` function to clarify error handling related to user authentication.
- Streamlined the `IntegrationsConfig` structure by removing toggles for Composio and related backend settings, ensuring a consistent configuration approach across integrations.
- Adjusted tests to reflect the removal of integration toggles and focus on core API key usage.

* refactor(composio): remove composio disabled state and improve error handling

- Eliminated the `disabled` state from the `useComposioIntegrations` hook, as Composio is always enabled when the user is authenticated.
- Updated error handling to surface backend connection issues directly, replacing previous checks for a disabled state.
- Revised tests to reflect the new error handling logic, ensuring clarity in toolkit fetch error reporting.

* refactor(integrations): update authentication handling for client configuration

- Revised the `build_client` function to prioritize app-session JWT for user authentication, enhancing clarity in the fallback mechanism to `config.api_key`.
- Improved error messages in `resolve_client` and `build_client` to provide clearer guidance on authentication issues related to session tokens.
- Streamlined comments and documentation to reflect the updated authentication flow, ensuring consistency across integration components.

* refactor(composio): unwrap CLI envelope for API responses

- Introduced a new `unwrapCliEnvelope` function to handle the response format from the Rust side, allowing for easier access to the flat shapes defined in `./types`.
- Updated `listToolkits`, `listConnections`, `listTools`, `authorize`, `deleteConnection`, and `execute` functions to utilize the new unwrapping logic, improving response handling consistency across the Composio API.
- Enhanced error handling by ensuring that responses without logs pass through unchanged, maintaining backward compatibility.

* refactor(skills_agent): update agent description and enhance Composio tool integration

- Revised the `when_to_use` description in `agent.toml` to clarify the role of the Skills Agent as a service integration specialist, emphasizing its capability to execute both Composio and QuickJS skill tools.
- Expanded the `prompt.md` documentation to detail available tool surfaces and typical Composio flow, improving clarity on how to interact with external services.
- Implemented category overrides for Composio tools in `tools.rs` to ensure they are recognized as part of the Skill category, allowing proper access through the skills sub-agent.
- Added tests to verify that Composio tools are correctly filtered and accessible by the skills sub-agent, ensuring robust integration and functionality.

* style: apply formatter output from pre-push checks

* refactor(tests): update Gmail and Notion integration tests for composio

- Refactored tests for the Skills page to integrate Gmail and Notion as composio tools, enhancing the testing framework.
- Removed mock data and streamlined the test setup to reflect the current state of available skills.
- Updated assertions to verify the rendering of connected and disconnected states for Gmail and Notion integrations, respectively.
- Improved clarity and maintainability of test cases by consolidating mock implementations and removing redundant code.

* refactor(skills): update toolkit categorization and enhance test assertions

- Modified the Skills component to assign categories dynamically based on toolkit metadata, improving organization of displayed tools.
- Updated test cases to reflect the new categorization, ensuring accurate rendering of tools under their respective categories instead of a generic 'Other' group.
- Enhanced assertions in tests to verify the presence of specific tools and their categories, improving test coverage and reliability.

* refactor(skills): streamline item creation in Skills component

- Simplified the item creation logic in the Skills component by removing unnecessary line breaks, enhancing code readability without altering functionality.
- This change contributes to cleaner code structure and maintainability in the Skills page.

* refactor(tests): enhance Gmail and Notion integration tests for improved clarity

- Updated the integration tests for Gmail and Notion on the Skills page to utilize the `within` function for more precise querying of elements within their respective sections.
- Improved test assertions to ensure that the connected and disconnected states are accurately verified, enhancing the reliability of the tests.
- Streamlined the test setup to better reflect the current structure of the Skills component, contributing to overall test maintainability.

* feat(skills): enhance Composio integration error handling and logging

- Added error handling for Composio integrations in the Skills component, displaying a user-friendly message when integration status is stale or an error occurs.
- Implemented logging in development mode to provide insights into the state of Composio toolkits and connections, aiding in debugging.
- Updated the item rendering logic to reflect the error state, ensuring users can retry fetching integrations when an error is detected.
- Enhanced tests to verify the display of error messages and the functionality of the retry mechanism, improving overall test coverage and reliability.
2026-04-11 12:15:45 -07:00
github-actions[bot] 69c4fa46cc chore(release): v0.52.5 2026-04-11 10:54:58 +00:00
Steven EnamakelandGitHub 462b4d2895 Move conversation persistence into workspace memory store (#503)
* Move conversation persistence into workspace memory store

* Apply formatter updates for conversation persistence

* Enhance conversation persistence by registering a new subscriber for channel events. Update domain subscriber registration to include workspace directory, ensuring proper message handling and persistence across channels. Refactor event structure to include message ID and reply target for improved tracking. Additionally, adjust module visibility for context management.
2026-04-10 23:04:59 -07: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
Steven EnamakelandGitHub 1c7318603e feat(composio): backend-proxied Composio integration end-to-end (#501)
* feat(composio): add Composio integration module with OAuth support

- Introduced a new Composio module for backend-proxied access to various OAuth integrations.
- Implemented ComposioClient for handling API requests related to toolkits, connections, and actions.
- Added RPC operations for listing toolkits, managing connections, and executing actions.
- Registered Composio controllers and schemas for integration with the existing system.
- Created a debug script for testing Composio OAuth flow against the live backend.
- Updated Cargo.lock to version 0.52.3 to reflect the new changes.

* feat(composio): implement Composio connection modal and API integration

- Added ComposioConnectModal for managing Composio toolkit connections, mirroring the user experience of existing modals.
- Introduced composioApi for backend communication, including functions for listing toolkits, managing connections, and handling OAuth authorization.
- Created toolkitMeta for displaying metadata of Composio toolkits in the Skills grid.
- Developed hooks for fetching and managing Composio integrations, ensuring real-time updates on connection status.
- Updated Skills page to integrate Composio toolkits, providing a seamless user experience for connecting and managing integrations.

* chore: update OpenHuman version to 0.52.3 and add debug-composio-trigger script

- Bumped OpenHuman package version in Cargo.lock to 0.52.3.
- Introduced a new script, debug-composio-trigger.mjs, for Socket.IO live listening of Composio trigger events, facilitating testing and debugging of webhook interactions.

* style(composio): apply Prettier + rustfmt from pre-push hook

* feat(composio): enhance ComposioConnectModal and improve polling logic

- Updated ComposioConnectModal to handle various connection phases more effectively, including 'waiting' for pending connections.
- Introduced new refs for managing polling state and in-flight requests to prevent overlapping executions.
- Improved error handling during polling, providing clearer feedback on OAuth timeouts.
- Added logic to resume polling if the modal opens while an OAuth handoff is in progress.
- Refactored connection handling in the modal for better clarity and maintainability.

* refactor(composio): improve JSON payload handling and connection verification

- Updated debug-composio-login.sh to build JSON payloads using jq for safer handling of toolkit data.
- Enhanced connection verification logic in debug-composio-trigger.mjs to prioritize newly created connections and provide warnings for missing toolkits.
- Refactored composio operations in ops.rs to return a more explicit error type, improving clarity in error handling across RPC operations.
2026-04-10 22:52:18 -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
Mega MindandGitHub 9118bfb5d6 Fix/skill start issue (#498)
* 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.

* feat(skill-setup): enhance OAuth handling and skill status synchronization

- Introduced a managed OAuth auto-advance mechanism to ensure it runs only once per login attempt, improving user experience during authentication.
- Updated the SkillSetupWizard to handle skill runtime checks more effectively, ensuring that the skill starts correctly and transitions to the setup phase seamlessly.
- Enhanced the useSkillSnapshot hook to provide a synthesized offline snapshot when the skill is not yet running, preventing UI stalls during loading.
- Implemented background synchronization after OAuth completion to ensure users see fresh data immediately without blocking the UI.
- Added tests to validate the new behavior for skills setup completion and status retrieval without requiring the skill to be started first.

* refactor(skills): streamline setup_complete retrieval in handle_skills_status function

- Simplified the retrieval of the `setup_complete` variable by removing unnecessary line breaks, enhancing code readability and maintainability.
- This change improves the clarity of the function's logic without altering its functionality.

* refactor(skills): simplify success message and remove initial sync from OAuth flow

- Updated the success message in the SkillSetupWizard to remove references to background syncing, streamlining user communication.
- Removed the initial sync trigger from the SkillManager after OAuth completion, shifting the responsibility for data synchronization to the user interface or cron jobs.
- Adjusted comments in the desktopDeepLinkListener to reflect the new sync behavior, clarifying that initial data sync is no longer automatic.

* fix(pr-498): address CodeRabbit review and CI failures

- SkillSetupWizard: only show complete after startSetup succeeds; error on failures
- hooks: merge prior snapshot into offline fallback; use const arrow for helper
- E2E: reset skills_set_setup_complete in finally for isolation
- json_rpc_e2e: assert oauth/complete returns start() result; add minimal start()
- Skills page tests: mock screen-intelligence/autocomplete/voice hooks (CoreStateProvider)

Made-with: Cursor

* fix: address follow-up CodeRabbit (readiness poll, shared test mocks)

- SkillSetupWizard: waitForSkillRunning after startSkill before startSetup/auth RPC
- json_rpc_e2e: poll skills_status until running instead of fixed 400ms sleep
- Consolidate Skills page vi.mocks in test/mockDefaultSkillStatusHooks.ts

Made-with: Cursor

* fix: CodeRabbit — legacy OAuth awaits setSetupComplete, const waitForSkillRunning, mock base

- Legacy OAuth: await persistence before complete; error on failure; guard ref + reset on skillId
- waitForSkillRunning: const arrow per TS style
- mockDefaultSkillStatusHooks: offlineStatusBase spread for shared literals

Made-with: Cursor
2026-04-11 04:16:15 +05:30
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
Cyrus GrayandGitHub e60b9f882d refactor(settings): restructure settings page for better UX (#494)
* refactor(settings): restructure settings page for better UX

Reorganize settings into 4 clean sections (Account & Billing, Features,
AI & Models, Developer Options) and extract developer-oriented options
from user-facing panels into dedicated debug panels.

- Merge Account & Security + Billing into Account & Billing section
- Rename Automation & Channels to Features; add Tools, Voice here
- Simplify AI & Skills to AI & Models (just Local AI Model)
- Expand Developer Options from 4 to 10 items
- Create 4 debug panels: ScreenAwarenessDebug, AutocompleteDebug,
  VoiceDebug, LocalModelDebug
- Simplify 4 user panels by stripping dev knobs (FPS, debounce timers,
  test harnesses, diagnostics, etc.)
- Delete AccessibilityPanel (merged into Screen Awareness)
- Add "Advanced settings" link in each simplified panel
- Update navigation breadcrumbs for new hierarchy

* fix(settings): address PR review feedback on debug panels

- Guard null result from openhumanAutocompleteDebugFocus()
- Block save/start until full config loaded in AutocompletePanel
- Separate poll errors from action errors in LocalModelDebugPanel
- Replace useEffect setState with render-time one-shot init in
  ScreenAwarenessDebugPanel to avoid set-state-in-effect lint rule
- Remove unused openhumanLocalAiAssetsStatus call from VoiceDebugPanel

* fix(settings): update tests for simplified panel structure

- Update ScreenIntelligencePanel test for renamed title, button text,
  and platform message
- Rewrite AutocompletePanel test for simplified panel (dev options moved
  to AutocompleteDebugPanel)
2026-04-10 21:51:00 +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
0cd0f7a670 feat(voice): sync overlay orb with chat voice button state (#487) (#490)
* feat(voice): sync overlay orb with chat voice button state (#487)

The overlay orb already reacts to hotkey-based dictation via Socket.IO
events, but the chat "Start Talking" button used local React state only.
Add a new RPC method `openhuman.overlay_stt_notify` that the chat button
calls at each voice state transition, which publishes to the existing
DICTATION_BUS / TRANSCRIPTION_BUS broadcast channels — so the overlay
reflects recording/transcribing/idle from both input paths with zero
changes to the Socket.IO bridge or overlay event handlers.

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

* fix(voice): address CI formatting and CodeRabbit review feedback

- Run cargo fmt and prettier to fix formatting violations
- Use typed enum OverlaySttState instead of raw String for state param
  (serde rejects invalid states at deserialization, eliminating the
  unknown state branch)
- Require `text` field for transcription_done state (return error if
  missing instead of silently ignoring)
- Replace raw transcript logging with metadata-only (has_text, text_len)
  to avoid logging sensitive user speech content
- Use "Voice input active" aria-label (covers recording + linger phases)
- Convert notifyOverlaySttState to arrow function with async/await per
  repo TS conventions

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 18:25:08 +05:30
Cyrus GrayandGitHub 3a2e026346 fix(billing): redesign subscription cards and polish billing page UI (#492)
* feat(skills): state-aware cards and setup modals for built-in skills

Replace static "Settings" buttons on Screen Intelligence, Text Auto-Complete,
and Voice Intelligence skill cards with live status dots, labels, and dynamic
CTA buttons (Enable/Setup/Manage/Retry) matching third-party skill UX.

Each built-in skill gets:
- A status hook deriving card state from core RPC snapshots
- A setup/enable modal with step-by-step flows (permissions, enable, success)
- Escape key + aria dialog attributes for accessibility

Screen Intelligence: permission grant flow → enable → success
Text Auto-Complete: one-click enable → success
Voice Intelligence: STT model check → enable voice server → success

* fix(billing): redesign subscription cards and polish full billing page UI

- Redesign plan cards with clear visual hierarchy: name/tagline left, prominent price right,
  vertical feature checklist with check/X icons, full-width CTA buttons
- Add "Popular" badge to Basic plan with accent border and shadow
- Add taglines and rewrite features to user-friendly language
- Remove confusing technical pills (monthly budget, 7-day cycle, 10-hour cap, discount %)
- Hide "Premium-usage discount: 0%" pill for free users
- Remove redundant "Why upgrade?" section
- Fix double padding (SubscriptionPlans px-4/mx-4 and AutoRecharge px-4 inside parent p-4)
- Fix "5-hour cap" label to "10-hour cap" and hide when both values are zero
- Fix progress bar background from dark stone-700/60 to light stone-200
- Shorten verbose copy across Current Plan header, divider, and Pay as You Go description

* style: apply prettier formatting
2026-04-10 18:22:19 +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
Cyrus GrayandGitHub f32c0d59f6 fix(billing): normalize TeamUsage API response to prevent crash on navigation (#488)
getTeamUsage() returned raw backend JSON without normalization, so
undefined/null numeric fields caused .toFixed() TypeErrors that crashed
the billing page. Add normalizeTeamUsage() (matching the existing
normalizeCreditBalance pattern), defensive ?? 0 guards on .toFixed()
call sites, and switch BillingPanel to Promise.allSettled for partial
rendering on API failure.

Closes #482
2026-04-10 14:23:44 +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 d5822ffcaf Integrate Rewards page with backend Discord roles and achievements (#475)
* Integrate rewards page with backend rewards data

* Refactor Rewards component to improve loading state and calculation logic

- Removed redundant loading state management in the Rewards component.
- Updated the calculation of unlocked and total rewards to derive values from the achievements array when necessary, enhancing accuracy.
- Adjusted the display logic to reflect the new calculation method for better clarity.

Enhancements in the rewards API include improved error handling for backend failures, ensuring robust user feedback during data retrieval. Added a utility function to validate numeric values, enhancing data normalization for achievements. Updated tests to cover new error handling scenarios and ensure consistent behavior across the rewards API.

* Refactor Rewards component for improved readability

- Adjusted the formatting of the unlocked rewards calculation for better clarity and maintainability.
- Ensured consistent code style in the Rewards component, enhancing overall readability.

These changes contribute to a cleaner codebase and facilitate future modifications.
2026-04-09 20:58:57 -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 38eb934242 Add coupon redemption to Rewards page (#471)
* Add coupon redemption to Rewards page

* Format Rewards coupon changes

* refactor: enhance coupon redemption logic and error handling in Rewards section

- Updated the coupon redemption process to utilize Promise.allSettled for improved error handling during state refresh.
- Adjusted the display logic for redeemed coupons to ensure clarity when no rewards are available.
- Refactored the normalization of coupon redeem results to streamline data extraction from the API response.

These changes improve the robustness and user experience of the Rewards feature.

* test: add unit tests for coupon redemption and balance display in Rewards section

- Introduced a new test case to validate the display of pending coupon messages and ensure the current balance remains unchanged until the reward is fulfilled.
- Enhanced existing tests for the `redeemCoupon` function to verify the unwrapping of nested success/data payloads.
- Updated the `RewardsCouponSection` component to improve the conditional rendering logic for better clarity.

These changes enhance test coverage and ensure the correctness of coupon handling in the Rewards feature.

* test: simplify data structure in redeemCoupon test case

- Refactored the `redeemCoupon` test case to streamline the data structure for the success response, enhancing readability and maintainability.
- This change improves the clarity of the test while ensuring it continues to validate the unwrapping of nested success/data payloads effectively.
2026-04-09 20:02:04 -07:00
Steven EnamakelandGitHub 63b17ca55c refactor: remove dead frontend modules and obsolete API layers (#469)
* refactor: remove unused socket, agent tool registry, daemon health, and API service files

- Deleted the `useSocket` hook, `AgentToolRegistry`, `DaemonHealthService`, and various API service files including `actionableItemsApi`, `apiKeysApi`, `feedbackApi`, `inferenceApi`, `managedDmApi`, and `settingsApi`.
- This cleanup reduces code complexity and improves maintainability by removing obsolete components that are no longer in use.

* feat: add knip configuration and commands to package.json

- Introduced new scripts for running knip in development and production modes in both package.json files.
- Added a knip.json configuration file to specify entry points and project files for dependency analysis.
- Updated yarn.lock to include new dependencies related to knip, enhancing the project's dependency management capabilities.

This commit improves the project's tooling for managing dependencies and ensures better code quality through automated checks.

* refactor: remove unused components and clean up dependencies

- Deleted several unused components related to intelligence features, including ActionPanel, InputGroup, SectionCard, and ValidatedField, to streamline the codebase.
- Removed mock data and country data files that are no longer in use, enhancing maintainability.
- Cleaned up the package.json by removing the @heroicons/react dependency, which is no longer required.
- This commit improves the overall project structure and reduces complexity by eliminating obsolete code.

* refactor: remove IntelligenceApiService and redefine ConnectedTool interface

- Deleted the `IntelligenceApiService` class and its associated backend API methods to streamline the codebase.
- Introduced a local definition of the `ConnectedTool` interface in `useIntelligenceApiFallback.ts` for better encapsulation and clarity.
- This refactor enhances maintainability by eliminating unused code and consolidating relevant types within the appropriate context.

* style: format knip config

* chore(dependencies): update OpenHuman to version 0.52.0 in Cargo.lock

* feat: implement Daemon Health Service for polling and state management

- Introduced the `DaemonHealthService` class to poll the Rust core health snapshot and synchronize the frontend daemon store.
- Added methods for setting up a health listener, parsing health snapshots, and updating the daemon store based on health data.
- Implemented a timeout mechanism to handle disconnection scenarios, enhancing the reliability of the daemon's health monitoring.
- This addition improves the application's ability to maintain an accurate representation of the daemon's health status in real-time.

* chore(knip): update entry points in knip configuration

- Modified the `entry` field in `knip.json` to include `src/main.tsx` alongside existing test specifications.
- This change ensures that the main application file is included in dependency analysis, improving project structure and tooling.

* refactor: streamline code and enhance readability across multiple modules

- Consolidated multiple `replace` calls into single calls using arrays for improved efficiency in text processing.
- Simplified default implementations for several structs, removing redundant code.
- Updated query mapping in database interactions to enhance clarity and maintainability.
- Improved logging and error handling by refining how state and error messages are processed.
- Enhanced the readability of various functions by restructuring conditional checks and simplifying logic.

These changes collectively improve code maintainability and performance across the application.

* Merge remote-tracking branch 'origin/fix/cleanup' into fix/cleanup

* fix: update error handling in bootstrap_after_login function

- Changed the error parameter in the inspect_err closure to an underscore to indicate it is unused.
- This minor adjustment improves code clarity and adheres to Rust conventions for unused variables.
2026-04-09 16:41:27 -07:00
Steven EnamakelandGitHub 30eec2ad88 docs: comprehensive documentation for core Rust modules (#470)
* feat(core): enhance RPC controller and dispatch logic

- Added comprehensive documentation for the core RPC controller and dispatch modules, detailing their purpose and functionality.
- Introduced new functions for managing registered controllers and schemas, including validation and invocation methods.
- Improved the structure of the `RpcOutcome` type to standardize response formats across domain-specific handlers.
- Enhanced the local AI operations module with additional functionalities for agent interactions, model management, and audio processing.
- Updated the dispatcher to better route RPC calls to their respective handlers, ensuring a more robust and maintainable architecture.

These changes improve the clarity and usability of the RPC system, facilitating easier integration and interaction with various components of the OpenHuman platform.

* docs: comprehensive documentation for core Rust modules

* chore(dependencies): update OpenHuman to version 0.52.0 in Cargo.lock and add knip dependency in package.json
2026-04-09 16:17:53 -07:00
Steven EnamakelandGitHub acc6246e59 Refactor core-polled app state and screen intelligence status (#464)
* refactor(accessibility): remove device control and predictive input features from accessibility settings

- Updated accessibility-related components and tests to eliminate device control and predictive input features.
- Adjusted AccessibilityPanel and ScreenIntelligencePanel to reflect the removal of these features.
- Modified related tests to ensure consistency with the updated accessibility status structure.
- Cleaned up accessibility session parameters and state management to focus solely on screen monitoring.

* refactor(accessibility): streamline featureOverrides state initialization

- Simplified the initialization of featureOverrides state in AccessibilityPanel and ScreenIntelligencePanel components for better readability.
- Consolidated parameter definitions in startAccessibilitySession to enhance clarity and maintainability.
- Removed unnecessary re-exports in the screen_intelligence engine module to clean up the codebase.

* chore(dependencies): update OpenHuman to version 0.51.19 in Cargo.lock

* chore(dependencies): update OpenHuman version to 0.51.19 in Cargo.lock

* feat(restart): implement core process restart functionality

- Added a new `SystemRestartRequested` event to the `DomainEvent` enum to handle restart requests.
- Introduced a `RestartSubscriber` that listens for restart events and manages the process respawn.
- Created a `service_restart` function to publish restart requests via the event bus.
- Updated service schemas to include a new `restart` controller with parameters for source and reason.
- Enhanced documentation to reflect changes in behavior and added necessary code comments.

* feat(accessibility): add last restart summary to Screen Intelligence Panel

- Introduced `lastRestartSummary` to the accessibility state and updated relevant components to display the last successful core restart information.
- Modified `PermissionsSection` and `ScreenIntelligencePanel` to include the new summary.
- Updated tests to validate the display of the last restart summary and ensure proper state management during core restarts.
- Refactored accessibility slice to handle the new restart summary in state updates.

* feat(core): enhance startup process with restart delay and subscriber registration

- Added a call to apply startup restart delay from environment variables in `run_core_from_args`.
- Updated the `bootstrap_skill_runtime` function to register a `RestartSubscriber` for handling restart requests, ensuring consistent respawn logic across triggers.
- Introduced a new `core_process` field in the `AccessibilityEngine` to track the core process status, including its PID and start time.
- Implemented a helper function to capture the core process start time using `OnceLock` for efficient initialization.

* feat(screen-intelligence): refactor accessibility state management and UI components

- Replaced direct Redux state access with a new `useScreenIntelligenceState` hook across multiple components, including `AccessibilityPanel`, `ScreenIntelligencePanel`, and their respective subcomponents.
- Streamlined permission and session handling by consolidating related functions and removing unnecessary dispatch calls.
- Updated tests to mock the new state management approach, ensuring consistent behavior and validation of UI elements.
- Removed the `SessionAndVisionSection` component to simplify the structure and improve maintainability.
- Introduced a new API file for screen intelligence to encapsulate related functionality and improve code organization.

* refactor(tests): clean up and optimize test files for accessibility and screen intelligence panels

- Removed redundant imports and streamlined the structure of test files for `AccessibilityPanel` and `ScreenIntelligencePanel`.
- Consolidated core process state initialization in test mocks for better readability.
- Updated dependency imports and ensured consistent mocking of state management hooks across tests.
- Enhanced the `ScreenPermissionsStep` component by improving the dependency array in the useEffect hook for better performance.

* refactor(store): remove unused authentication and user management code

- Deleted the `UserProvider`, `authSlice`, `authSelectors`, `userSlice`, `teamSlice`, and related test files to streamline the codebase.
- This cleanup enhances maintainability by removing legacy code that is no longer in use.
- Updated the store configuration to reflect the removal of these slices and ensure proper state management.

* refactor(webhooks): reorganize types and remove legacy state management

- Moved `TunnelRegistration` and `WebhookActivityEntry` types to a new `types.ts` file for better organization.
- Updated imports in `TunnelList` and `WebhookActivity` components to reference the new types location.
- Refactored `useWebhooks` hook to eliminate Redux state management in favor of local state, enhancing performance and reducing complexity.
- Removed unused `aiSlice`, `inviteSlice`, and `webhooksSlice` along with their associated tests to streamline the codebase.

* refactor(daemon): migrate state management from Redux to a custom store

- Introduced a new `store.ts` file to manage daemon state, replacing the previous Redux slice.
- Updated components and hooks to utilize the new state management approach, enhancing performance and reducing complexity.
- Removed the legacy `daemonSlice` and associated Redux logic, streamlining the codebase.
- Adjusted imports in various components and hooks to reference the new store structure.

* refactor(screen-intelligence): integrate core state management and enhance status handling

- Replaced direct state management in `useScreenIntelligenceState` with a new core state approach, utilizing `useCoreState` for improved performance and consistency.
- Updated status fetching and permission handling to leverage the core state snapshot, streamlining the logic and reducing redundant API calls.
- Introduced a new `CoreRuntimeSnapshot` interface to encapsulate runtime statuses, including screen intelligence, local AI, autocomplete, and service states.
- Adjusted related components and hooks to align with the new state management structure, enhancing maintainability and readability.
- Updated tests to validate the new runtime state structure and ensure proper functionality across the application.

* refactor(components): reorganize imports and streamline function formatting

- Moved the import of `Tunnel` and `tunnelsApi` in `TunnelList.tsx` for better organization.
- Reformatted function definitions in `store.ts`, `useDaemonHealth.ts`, `useDaemonLifecycle.ts`, `useWebhooks.ts` for improved readability.
- Cleaned up the structure of test files in `coreRpcClient.test.ts` by consolidating object properties for clarity.
- These changes enhance code maintainability and readability across the application.

* test(screen-intelligence): fix duplicate hook imports

* fix(tests): update ScreenIntelligenceDebugPanel test to use baseState for refresh status and vision calls

* refactor(invites): simplify error message rendering in Invites component

- Consolidated the conditional rendering of the load error message in the Invites component for improved readability.
- This change enhances the clarity of the code without altering functionality.

* refactor(daemon): streamline state management and function definitions

- Removed the `healthTimeoutId` from the `DaemonUserState` interface and related functions to simplify state management.
- Converted several functions in `store.ts` to arrow function syntax for consistency and improved readability.
- Updated the `Invites` component to handle asynchronous loading and error states more effectively, ensuring that in-flight requests are properly managed.
- Refactored the `CoreStateProvider` to enhance the refresh logic and prevent multiple simultaneous refreshes.
- Introduced a new `register_domain_subscribers` function in `jsonrpc.rs` to centralize event bus subscriber registration, improving code organization and maintainability.

* fix: add debug logging, atomic restart guard, and idempotent subscriber registration

- CoreStateProvider: add namespaced debug logger for polling failure diagnostics
- service/bus.rs: add AtomicBool gate to prevent duplicate restart spawns
- service/bus.rs: use OnceLock for idempotent RestartSubscriber registration
- Invites.tsx: add debug log in loadInviteCodes catch block

* style: apply prettier formatting to CoreStateProvider

* fix: sanitize error logging, serialize refresh, and demote restart logs

- CoreStateProvider: sanitize error objects in poll failure logs to avoid
  leaking tokens/headers
- CoreStateProvider: move in-flight guard into refresh() via shared promise
  so all callers (poll, updateLocalState, storeSessionToken) are serialized
- CoreStateProvider: log refreshTeams errors instead of swallowing them
- service/bus.rs: demote duplicate-restart log to debug, omit reason from
  log output to avoid free-form text emission

* style: apply cargo fmt to service/bus.rs
2026-04-09 15:51:27 -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
Steven EnamakelandGitHub 5d1d7ac8e3 fix(billing): align TeamUsage fields with backend PR #616 (#465)
Backend simplified billing model: fiveHourSpendUsd → cycleLimit5hr,
bypassRateLimit → bypassCycleLimit, removed dailyUsage and token
count fields. Updates all frontend consumers and mock API.
2026-04-09 13:08:06 -07: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
9764a875e8 fix(subconscious): seed defaults into per-user workspace + fix Intelligence page stale log (#462)
* fix(subconscious): seed defaults and spawn heartbeat on startup

The subconscious engine was only constructed lazily on the first
engine-routed RPC (trigger, tasks_add, status). Because
handle_tasks_list bypasses the engine and reads the store directly,
a fresh install showed an empty Subconscious panel until the user
clicked "Run now", even though SubconsciousEngine::new() seeds the
3 default system tasks on construction.

Separately, HeartbeatEngine::run() — the periodic tick loop — was
never spawned in production code. The only callers of HeartbeatEngine
were tests, so ticks never fired automatically; users had to trigger
each evaluation manually.

Both issues are fixed together in run_server_inner, following the
existing start_if_enabled pattern used by voice, screen_intelligence,
and autocomplete:

1. Call get_or_init_engine() at startup to construct the
   SubconsciousEngine eagerly, which runs seed_default_tasks via
   from_heartbeat_config. Construction is idempotent via OnceLock;
   seeding is idempotent by title match, so repeat startups do not
   duplicate the defaults.

2. Construct HeartbeatEngine with the heartbeat config and
   workspace_dir, then tokio::spawn heartbeat.run() so the periodic
   tick loop runs for the process lifetime. The loop re-acquires
   the shared engine via get_or_init_engine() on each tick.

Guarded by config.heartbeat.enabled so users who disable the
heartbeat get neither startup seeding nor the background loop.

Add engine_construction_seeds_default_tasks integration test that
locks in the invariant: constructing SubconsciousEngine on a fresh
workspace_dir must leave the 3 default system tasks in the store,
with no tick, trigger, or explicit seed call. Also asserts that
reconstructing the engine on the same workspace does not duplicate
the defaults.

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

* fix(subconscious): defer engine bootstrap until after login

Default system tasks seeded at sidecar startup into the pre-login global
workspace (`~/.openhuman/workspace/`) instead of the per-user workspace
(`~/.openhuman/users/<id>/workspace/`) the UI reads from after login.

The engine singleton is built lazily via `get_or_init_engine()` and
cached in a `OnceLock`. `Config::load_or_init` resolves `workspace_dir`
from `active_user.toml` — which does not exist until after login. When
the engine was constructed on startup it therefore seeded into the
global default, then the frozen singleton kept pointing at that path
for the rest of the session while RPC handlers like `tasks_list`
re-loaded config per call and read from the correct per-user path,
silently returning an empty list.

Fix:

- `subconscious/global.rs`: add `bootstrap_after_login()` (idempotent
  via `BOOTSTRAPPED: AtomicBool`) which builds the engine against the
  now-correct per-user workspace and spawns the heartbeat loop. Track
  the heartbeat `JoinHandle` in a static so it can be aborted cleanly.
  Add `reset_engine_for_user_switch()` that aborts the heartbeat,
  clears the engine option, and resets the bootstrap flag.
- `core/jsonrpc.rs`: replace the unconditional eager init on startup
  with a conditional one that only bootstraps if `active_user.toml`
  already exists (so a user logged in from a previous session still
  gets the engine up immediately after restart).
- `credentials/ops.rs`: call `bootstrap_after_login()` at the end of
  `verify_and_store_session` so a fresh login triggers seeding against
  the per-user workspace. Call `reset_engine_for_user_switch()` in
  `clear_session` so logout tears down the engine + heartbeat loop and
  a subsequent login rebuilds them against the new user.

Verified locally: sidecar restart with no `active_user.toml` logs
"bootstrap deferred — waiting for login"; post-login logs "seeded 3
tasks on init" + "heartbeat periodic loop spawned"; and
`subconscious.tasks_list` returns the 3 system defaults from the
per-user DB.

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

* fix(subconscious): bound config load + guard frontend poll

Two related fixes for the Intelligence page freezing on a stale
subconscious activity-log snapshot while ticks kept progressing in the
sidecar.

Root cause (backend): the subconscious RPC handlers were the only
outlier in the entire JSON-RPC surface that called the raw
`Config::load_or_init()` instead of the shared
`load_config_with_timeout()` wrapper that every other domain schemas.rs
uses (cron, webhooks, voice, team, skills, service, referral, doctor,
…). `load_or_init` constructs a fresh `SecretStore` and runs a chain
of `decrypt_optional_secret` calls on every invocation, which may IPC
to the OS keychain — slow, unbounded, no caching. Under the Intelligence
page's 3-second poll (4 parallel RPCs × ~7 keychain round-trips each =
~28 keychain calls every 3s), this pileup was enough to pin the
frontend's `Promise.all` past the poll interval.

Root cause (frontend): `useSubconscious.refresh()` uses `fetchingRef`
as an in-flight guard. The ref is only cleared inside the `finally`
block that runs after `Promise.all` settles. With no per-RPC timeout
on the client side either, a single slow backend call would leave the
ref stuck `true`, and every subsequent 3s `setInterval` tick would
silently early-return at the top of `refresh`. The poller kept firing,
but every call was a no-op — so the UI froze on whatever snapshot it
last successfully fetched, even though the backend was still ticking
through new decisions.

Backend fix (`src/openhuman/subconscious/schemas.rs`):

  - Replace the local `load_config()` helper body to delegate to
    `crate::openhuman::config::load_config_with_timeout()`. Matches the
    28 other domain schemas.rs files and brings subconscious handlers
    under the same 30s bound used everywhere else.

Frontend fix (`app/src/hooks/useSubconscious.ts`):

  - Add a `withTimeout` helper (2.5s per-RPC, strictly less than the
    3s poll interval) that races each of the 4 parallel RPCs against
    a timeout and resolves `null` on timeout — matching the existing
    `.catch(() => null)` contract so downstream setState logic is
    unchanged.
  - Clear `fetchingRef.current = false` in the useEffect cleanup so a
    late-returning request or a React Strict Mode double-mount in dev
    can't leave the ref stuck `true` for the next mount.

Defense in depth: the backend bound prevents a permanent hang and
matches repo conventions, while the frontend bound guarantees the 3s
poll loop can never be pinned beyond one tick regardless of
server-side latency. Verified locally — `cargo check` clean,
`tsc --noEmit` clean, all 18 pre-existing warnings in unrelated modules.

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

* style(jsonrpc): cargo fmt the startup bootstrap block

CI ran `cargo fmt --all -- --check` and flagged the conditional
bootstrap block in `run_server_inner` — `let already_logged_in`
should fold onto one line, the `.and_then` closure body should
inline, the `match ... .await` chain should fold, and the short
log!() calls should not break across lines. No behavior change.

Fixes three jobs on PR #462 that were all failing at the same
`cargo fmt --all -- --check` step (Rust Quality, Rust Tests,
Type Check TypeScript — the last one chains cargo fmt after
its prettier check).

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-09 22:10:55 +05:30
Cyrus GrayandGitHub 3a2e4b1db6 fix(onboarding): inline permission buttons and tighten layout (#458)
Place "Restart & Refresh" and "Request Permissions" side by side,
move "Continue" directly below them, and push hint/error text to
the bottom so the button group is visually cohesive.
2026-04-09 18:43:24 +05:30
Cyrus GrayandGitHub 4c90de4b61 fix(onboarding): clean up referral step UI and error display (#457)
* fix(onboarding): clean up referral step UI and error display

Remove progress bar from onboarding overlay, remove back button from
referral step, place Skip/Apply buttons inline, and parse API errors
into user-friendly messages instead of showing raw response bodies.

* fix: remove unused onBack prop from ReferralApplyStep destructuring
2026-04-09 18:26:38 +05:30