Commit Graph
1065 Commits
Author SHA1 Message Date
7b457aa27d feat(agent): pure orchestrator pattern with per-skill delegation tools (#496)
* feat(agent): pure orchestrator pattern with per-skill delegation tools (#478)

Refactors the main agent from a direct tool-calling model to a pure
orchestrator that delegates all work through dynamically generated tools.

Architecture changes:
- Orchestrator only sees generated tools (notion, gmail, research,
  run_code, review_code, plan, spawn_subagent) — skill tools are
  architecturally unreachable from the main agent
- Each installed skill auto-generates a delegation tool at build time
  (SkillDelegationTool) that routes to skills_agent with the correct
  skill_filter
- Static archetype tools (research, run_code, etc.) delegate to their
  respective sub-agents
- visible_tool_specs filters the function-calling schema sent to the
  provider, enforcing the orchestrator boundary at the API level

Prompt changes:
- Rewrote AGENTS.md as a lean orchestrator prompt — no more routing
  tables or agent_id instructions
- Orchestrator skips TOOLS.md, MEMORY.md, HEARTBEAT.md (~6k tokens
  saved per turn) — subagents get tool specs from the registry
- Workspace .md files auto-sync via builtin-hash mechanism so prompt
  updates ship automatically to existing installs

Bug fixes:
- ModelSpec::Hint now resolves to {hint}-v1 (e.g. agentic-v1) instead
  of hint:agentic which the backend rejected
- validate_skill_filter now uses skill_id from the engine tuple instead
  of splitting on __ in the raw tool name (which always failed)
- Memory context forwarded to subagents via ParentExecutionContext

Observability:
- Added [agent] tagged logs for tool responses, agent state transitions,
  and delegation decisions throughout turn.rs

See docs/agent-prompt-architecture.excalidraw for the visual diagram.

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

* style: rustfmt orchestrator_tools.rs

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

* style: cargo fmt

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

* fix: address CodeRabbit review — dispatch guard, fork specs, decouple sync

- Enforce visible-tool allowlist at dispatch time (not just schema)
- Fork mode uses visible_tool_specs (not full registry)
- De-duplicate spawn_subagent when extending orchestrator tools
- Raw tool output moved to debug level, info level logs metadata only
- Decouple workspace file sync from prompt rendering so skipped files
  still get synced to disk

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-10 12:47:41 -07:00
b8ded44fbf fix(core): send SIGTERM before SIGKILL on sidecar shutdown (#460) (#495)
The Tauri shell's CoreProcessHandle::shutdown() was calling child.kill()
which sends SIGKILL on Unix, instantly terminating the core process
without giving it a chance to run graceful shutdown hooks. This left the
autocomplete Swift overlay helper (unified_helper_bin) orphaned, causing
persistent error notifications even after the app was closed.

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

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 21:51:28 +05:30
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
Steven EnamakelandGitHub a2fb1119ea refactor(skills): unify auth/oauth handshake on start({validate}) and drop enabled flag (#484)
* refactor(preferences): streamline skill preference management by removing the enabled toggle

- Removed the `enabled` field from `SkillPreference`, simplifying the preference model to focus solely on `setup_complete`.
- Updated related methods and RPC handlers to reflect this change, ensuring that skills are automatically started based on the completion of their setup process.
- Adjusted tests to validate the new behavior, ensuring consistent functionality without the `enabled` toggle.
- Enhanced documentation to clarify the new preference management approach.

* refactor(auth): simplify authentication flow by removing onAuthComplete hook

- Updated the `handle_auth_complete` function to eliminate the separate `onAuthComplete` JavaScript hook, streamlining the authentication process.
- Revised the flow to directly inject new credentials and validate them using the `start` function, which now handles both validation and activation.
- Enhanced rollback logic to ensure temporary credentials are cleared if validation fails, preventing persistence on disk.
- Improved documentation to clarify the new authentication steps and their implications for credential management.

* refactor(oauth): streamline OAuth credential handling in `handle_oauth_complete`

- Removed the `build_start_credentials_arg` function and integrated its logic directly into `handle_oauth_complete`, simplifying the flow.
- Updated the OAuth handling to validate credentials before persisting them, ensuring that only successful validations are saved.
- Enhanced rollback logic to clear temporary credentials if validation fails, preventing incorrect state persistence.
- Improved documentation to clarify the new steps in the OAuth process and their implications for credential management.
2026-04-10 18:25:40 +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 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 6465f3d314 feat(agent): sub-agents, reasoning→agentic routing, layered context pipeline (#474)
* Enhance agent architecture with sub-agent support and memory optimizations

- Refactored the `Agent` struct to use `Arc` for shared ownership of the provider, tools, and tool specifications, enabling efficient memory management and concurrent access.
- Introduced a `NullMemoryLoader` to optimize memory usage for sub-agents, allowing them to operate without incurring the cost of memory recall.
- Added new methods in the `Agent` implementation to facilitate sharing of the provider, tools, and tool specifications with sub-agents, enhancing their operational efficiency.
- Implemented a new `SystemPromptBuilder` method for constructing prompts specifically for sub-agents, ensuring they receive tailored context while minimizing unnecessary information.
- Established a framework for loading custom agent definitions from TOML files, allowing for dynamic agent configuration and specialization.
- Introduced a `ForkContext` to support efficient sub-agent execution in fork mode, leveraging shared resources for improved performance and reduced token usage.

* Enhance agent definition management and sub-agent functionality

- Introduced a global `AgentDefinitionRegistry` to manage built-in and custom agent definitions from TOML files, ensuring idempotent initialization.
- Added new RPC handlers for listing, fetching, and reloading agent definitions, improving the flexibility of agent management.
- Refactored the `Agent` struct to streamline sub-agent execution, including enhancements to the task execution flow and context handling.
- Updated the orchestrator configuration to support fork mode for sub-agents, optimizing resource usage and performance.
- Improved error handling and logging for agent definition loading and initialization processes, enhancing system reliability.

* Add end-to-end test for sub-agent spawning and response integration

- Implemented a new asynchronous test to validate the full path of a parent agent issuing a `spawn_subagent` tool call.
- The test ensures that the sub-agent's output is correctly folded into the parent's response, verifying the interaction between the parent agent and the sub-agent.
- Enhanced the `AgentDefinitionRegistry` to support global initialization of built-in agents, ensuring consistent behavior across tests.
- Updated the handling of tool calls and memory configuration to facilitate the new test scenario, improving overall test coverage for agent interactions.

* Enhance agent tool filtering with category support

- Introduced a new `category_filter` in `AgentDefinition` to restrict tool visibility based on their category (System or Skill).
- Updated the `from_archetype` function to apply the category filter for the `SkillsAgent` archetype.
- Modified `SubagentRunOptions` to include a `category_filter_override` for dynamic filtering during sub-agent execution.
- Enhanced the `filter_tool_indices` function to incorporate category filtering logic, ensuring tools are correctly filtered based on their defined categories.
- Updated relevant tests to validate the new category filtering functionality, improving overall test coverage for agent interactions.

* Implement layered context reduction pipeline for agent

- Introduced a new `context_pipeline` module to manage a layered context reduction strategy, enhancing memory efficiency during agent interactions.
- Added stages for tool-result budgeting, history trimming, microcompaction, autocompaction, and session memory extraction, each with specific triggers and cache implications.
- Updated the `Agent` struct to include a `context_pipeline` field, ensuring state persistence across turns.
- Enhanced the `AgentBuilder` to initialize the context pipeline by default.
- Implemented tests to validate the functionality and stability of the context pipeline, ensuring consistent behavior across agent sessions.
- Refactored relevant components to integrate the new context management features, improving overall agent performance and memory handling.

* Enhance agent context pipeline with tool result budgeting and microcompaction

- Renamed variable for clarity in tool execution result handling.
- Implemented a new stage in the context pipeline to apply a byte budget to tool results, ensuring efficient memory usage.
- Added logging for budget application, including details on original and final byte sizes.
- Integrated microcompaction stages before tool calls to manage history and reduce memory footprint, with appropriate logging for outcomes.
- Updated the agent's session memory management to track turn counts, facilitating better resource handling across iterations.

* Refactor agent context pipeline for session memory extraction and tool call management

- Simplified method calls in the `Agent` struct for clarity and efficiency.
- Enhanced session memory extraction logic to spawn a background archivist sub-agent when thresholds are met.
- Improved context pipeline handling for tool call recording and usage tracking.
- Updated documentation and comments for better understanding of session memory extraction process.
- Refactored microcompact function for cleaner code structure and readability.

* refactor(agent): split agent.rs into focused submodules

- Convert agent.rs (1988 lines) into agent/ folder with six files:
  * types.rs — Agent + AgentBuilder struct defs
  * builder.rs — AgentBuilder fluent API + Agent::from_config factory
  * turn.rs — turn lifecycle, tool dispatch, context pipeline wiring
  * runtime.rs — public accessors, run_single/run_interactive, helpers
  * tests.rs — integration tests with shared fakes
  * mod.rs — glue + top-level `run` convenience function

- Drop misc external inspiration references from doc comments in the
  context_pipeline module and fork_context — the files now stand on
  their own design language.

* fix(agent): address review comments on sub-agent + context pipeline PR

Inline comment fixes:
- definition.rs: YAML/TOML inconsistency — module doc, PromptSource, source
  bookkeeping, and load() all now uniformly document the TOML format.
- subagent_runner.rs: render_subagent_system_prompt previously only appended
  PromptSource::Inline bodies, silently dropping PromptSource::File content.
  Thread the preloaded archetype_body through as an explicit &str parameter
  so both source variants render. Drops the unused SystemPromptBuilder +
  tools_for_prompt wiring while we're here.
- prompt.rs: remove DateTimeSection from SystemPromptBuilder::for_subagent.
  Local::now() would make the sub-agent system prompt change per call and
  break KV-prefix cache stability. Document the invariant.

Nitpick fixes:
- agent/turn.rs: drop the no-op mark_extraction_started() call — the
  immediately-following mark_extraction_complete() clears the in-flight
  flag anyway.
- context_pipeline/pipeline.rs: call guard.record_compaction_success() on
  microcompact success so a prior streak of autocompaction failures
  doesn't leave the circuit breaker tripped after a successful reduction.
- context_pipeline/tool_result_budget.rs: remove the unnecessary out.clone()
  in the truncation return — capture final_bytes first, then move out.
- definition_loader.rs: replace brittle reg.len() == 10 with
  assert!(reg.len() > 1) plus the existing targeted .get() checks.
- executor.rs: tracing::warn! on unknown sandbox override values so typos
  surface during development; explicitly accept "none" and empty string
  as valid defaults.
- fork_context.rs: add parent_context_visible_inside_scope test mirroring
  fork_context_visible_inside_scope, with minimal stub Provider/Memory
  impls so the test stays self-contained.
- schemas.rs: drop redundant serde_json::to_value(serde_json::json!(...))
  wrapping in handle_list_definitions + handle_get_definition.
- event_bus/events.rs: add SubagentSpawned/SubagentCompleted/SubagentFailed
  cases to all_variants_have_correct_domain.
- tools/ops.rs: add all_tools_includes_spawn_subagent regression test.
- tools/spawn_subagent.rs: sort/dedup the known skill list in place
  instead of cloning into a second vec.

Tests: 2316 passed / 0 failed (up from 2314; two new tests added).
fmt + clippy clean on all touched files.

* udpate prompts

* Enhance AgentBuilder and runtime with event context and interactive CLI improvements

- Added `event_context` method to `AgentBuilder` for setting `session_id` and `channel` for `DomainEvent`s, improving event tagging and correlation.
- Updated `run_interactive` method in `Agent` to dispatch messages through `run_single`, ensuring consistent lifecycle event handling and error sanitization for interactive turns.

* Optimize configuration handling in AgentBuilder by lazily creating Arc for full config in reflection hook. This change reduces unnecessary cloning when learning is enabled, improving performance.

* Add fork-mode test for sub-agent spawning in agent

- Introduced a new test, `turn_dispatches_spawn_subagent_in_fork_mode`, to validate the behavior of the agent when spawning a sub-agent in fork mode.
- The test ensures that the parent agent correctly processes the sub-agent's output and maintains the expected response sequence.
- Enhanced the test setup with a mock provider and memory configuration to simulate the agent's environment effectively.

* Refactor sync RPC handling in skills to treat missing onSync as no-op

- Updated the `handle_sync` function to log a debug message and return a no-op response when a skill does not implement the `onSync` handler, preventing unnecessary RPC errors for skills that do not require periodic syncs.
- This change improves logging clarity and reduces error noise in logs and dashboards for skills that are not designed to handle sync operations.
2026-04-09 21:09:34 -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 3d17bfb23d Refactor core cross-domain flows onto event bus (#468)
* Refactor core cross-domain flows onto event bus

* feat(agent): enhance error handling and message processing

- Introduced a new constant for maximum error message length in the Agent.
- Added methods for comparing conversation messages and determining new entries for turns.
- Implemented a function to sanitize error messages, improving clarity and consistency in error reporting.
- Updated the `run_single` method to utilize the new error handling and message processing logic, ensuring better tracking of conversation history and error states.

* feat(supervision): initialize global event bus and register health subscriber

- Added initialization of the global event bus with default capacity to ensure channel health events have a live bus and subscriber target.
- Registered a health subscriber to enhance monitoring capabilities within the supervised listener context.
2026-04-09 16:44:53 -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 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
f0118ab674 fix(autocomplete): graceful shutdown on app exit (#460)
* fix(autocomplete): graceful shutdown on app exit

Stop the autocomplete engine and quit the Swift overlay helper process
when the core receives a shutdown signal, preventing orphan processes.

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

* refactor(core): extract shutdown logic into generic facility

Move domain-specific autocomplete cleanup out of the jsonrpc adapter
into a new `core::shutdown` module with a hook registry. Adds SIGTERM
handling alongside SIGINT via `tokio::select!` on Unix platforms.

Addresses CodeRabbit review feedback on PR #460:
- jsonrpc.rs stays transport-only (no domain logic)
- Process responds to both SIGINT and SIGTERM gracefully

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

* fix(autocomplete): suppress duplicate error notifications and auto-stop after repeated failures

The autocomplete polling loop was showing an error notification badge on
every single refresh cycle when a dependency was unavailable (e.g. Ollama
not running, macOS Automation permission denied). This caused floods of
identical macOS notifications.

Changes:
- Track last notified error message; skip badge if identical to previous
- Count consecutive errors; auto-stop engine after 5 failures with a
  clear log message, preventing endless notification spam
- Reset counters on successful refresh or engine restart

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 11:59:33 -07:00
4639913ddf fix(release): sync root Cargo version in release pipeline (#449) (#461)
* fix(release): sync root Cargo version in bump flow (#449)

Add root Cargo.toml to release version bumping and introduce a
version-sync verifier for all four release version sources.

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

* ci(release): enforce version sync before tagging (#449)

Run release version consistency verification and include root
Cargo.toml in the release commit staging list.

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

* chore(release): add local dmg preflight version dry-run (#449)

Add a local release dry-run script that builds frontend + release
sidecar, bundles app/dmg, and validates packaged core.version.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 10:44:46 -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
Cyrus GrayandGitHub 5dbf9d4661 fix(auth): unify OAuth button styles and disable email login (#456)
All three OAuth CTAs (Google, GitHub, Twitter) now share a consistent
white pill-button style with light border instead of individual brand
colors. Email login section commented out as the backend flow is not
yet implemented.
2026-04-09 18:14:51 +05:30
Cyrus GrayandGitHub 4f0513b23a fix(skills): per-card loading state on skill enable (#454)
* feat(settings,skills): reorganize settings and skills pages for consistency and usability

- Remove dead code: TauriCommandsPanel, useSettingsAnimation, SettingsPanelLayout,
  SettingsBackButton, ProfilePanel, AdvancedPanel, SkillsPanel, SkillsGrid (~1900 lines)
- Standardize settings panel padding to p-4 space-y-4 across all panels
- Add breadcrumb navigation to SettingsHeader with route-derived breadcrumbs
- Decompose oversized panels: LocalModelPanel, AutocompletePanel, CronJobsPanel,
  ScreenIntelligencePanel into sub-components in dedicated subdirectories
- Deduplicate skills management: move browser access toggle to Skills page,
  remove redundant /settings/skills route
- Unify skill card layout: UnifiedSkillCard component with overflow menu for
  secondary actions, consistent status/CTA patterns across all skill types
- Add skill search bar and category filter with grouped results

Closes #396

* fix(settings,skills): address CodeRabbit review feedback

- Use semantic nav/ol/li for breadcrumbs with aria-hidden separators
- Fix duplicate text-xs class in CompletionStyleSection
- Use interface instead of type for CronSkillConfig
- Disable cron option inputs when parent skill is disabled
- Deduplicate preset error rendering in DeviceCapabilitySection
- Fix low-contrast labels: text-stone-300 → text-stone-700, text-stone-200 → text-stone-600
- Disable "Set Path" button when input is empty
- Add aria-pressed to category filter buttons
- Convert SkillCategoryFilter to arrow function
- Use void operator for async onClick handler
- Simplify redundant conditional in ThirdPartySkillCard
- Use async/await instead of .then() in BrowserAccessToggle

* fix(tests): update Skills page tests for unified card layout

- Mock openhumanGetRuntimeFlags/openhumanSetBrowserAllowAll for BrowserAccessToggle
- Open overflow menu before clicking sync/debug buttons (now in secondary actions)
- Remove assertion for deleted "3rd Party Skills" heading

* fix(skills): show per-card loading state instead of hiding entire skill list on enable

When clicking Enable on a third-party skill (e.g. Gmail, Notion), the
entire skill list was replaced with a loading message. Now only the
clicked card's button shows "Enabling..." with a disabled state while
the install RPC runs, keeping all other cards visible and interactive.
2026-04-09 17:56:37 +05:30
Cyrus GrayandGitHub 886bbea368 feat(settings,skills): reorganize settings and skills pages (#453)
* feat(settings,skills): reorganize settings and skills pages for consistency and usability

- Remove dead code: TauriCommandsPanel, useSettingsAnimation, SettingsPanelLayout,
  SettingsBackButton, ProfilePanel, AdvancedPanel, SkillsPanel, SkillsGrid (~1900 lines)
- Standardize settings panel padding to p-4 space-y-4 across all panels
- Add breadcrumb navigation to SettingsHeader with route-derived breadcrumbs
- Decompose oversized panels: LocalModelPanel, AutocompletePanel, CronJobsPanel,
  ScreenIntelligencePanel into sub-components in dedicated subdirectories
- Deduplicate skills management: move browser access toggle to Skills page,
  remove redundant /settings/skills route
- Unify skill card layout: UnifiedSkillCard component with overflow menu for
  secondary actions, consistent status/CTA patterns across all skill types
- Add skill search bar and category filter with grouped results

Closes #396

* fix(settings,skills): address CodeRabbit review feedback

- Use semantic nav/ol/li for breadcrumbs with aria-hidden separators
- Fix duplicate text-xs class in CompletionStyleSection
- Use interface instead of type for CronSkillConfig
- Disable cron option inputs when parent skill is disabled
- Deduplicate preset error rendering in DeviceCapabilitySection
- Fix low-contrast labels: text-stone-300 → text-stone-700, text-stone-200 → text-stone-600
- Disable "Set Path" button when input is empty
- Add aria-pressed to category filter buttons
- Convert SkillCategoryFilter to arrow function
- Use void operator for async onClick handler
- Simplify redundant conditional in ThirdPartySkillCard
- Use async/await instead of .then() in BrowserAccessToggle

* fix(tests): update Skills page tests for unified card layout

- Mock openhumanGetRuntimeFlags/openhumanSetBrowserAllowAll for BrowserAccessToggle
- Open overflow menu before clicking sync/debug buttons (now in secondary actions)
- Remove assertion for deleted "3rd Party Skills" heading
2026-04-09 17:09:41 +05:30
github-actions[bot] c10f087d51 chore(release): v0.51.19 v0.51.19 2026-04-08 22:57:41 +00:00
fa5f822f95 feat(subconscious): stabilize heartbeat + subconscious loop (#392) (#437)
* feat(subconscious): stabilize heartbeat + subconscious loop (#392)

- Enable heartbeat by default (enabled=true, inference_enabled=true, 5min interval)
- Seed system tasks on engine init, not first tick
- SQLite-backed task/log/escalation persistence
- Overlap guard with generation counter — stale ticks are cancelled
- Single log entry per task per tick, updated in place (in_progress → act/noop/escalate/failed/cancelled)
- Rate-limit retry (429 only) for agentic-v1 cloud model calls
- Approval gate: unsolicited write actions on read-only tasks require user approval
- Analysis-only mode for agentic-v1 on read-only escalations
- Non-blocking status RPC — reads from DB, never blocks on engine mutex
- Frontend: system vs user task distinction, toggle switches, expandable activity log
- Frontend: 3s auto-poll on Subconscious tab, skill-related escalation navigation
- Consecutive failure counter in status (resets on success)
- last_tick_at only advances on successful evaluation
- Missing LLM evaluation fallback — unevaluated tasks default to noop
- Docs: subconscious.md architecture guide, memory-sync-functions.md reference

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

* style: fix Prettier formatting for subconscious frontend files

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

* ci: retrigger checks

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

* fix(heartbeat): use disabled config in run_returns_immediately_when_disabled test

HeartbeatConfig::default() has enabled: true, so run() entered the infinite
loop and never returned — hanging the test (and CI) indefinitely.

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

* fix(subconscious): remove HEARTBEAT.md task import, use SQLite as sole task source

Tasks are now managed exclusively in SQLite via the Subconscious UI.
HEARTBEAT.md is retained for instructions/context only, not as a task list.
Situation report now reads pending tasks from SQLite instead of HEARTBEAT.md.

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

* style: cargo fmt on subconscious engine

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-08 15:03:05 -07:00
1ca4ea044a fix(chat): deduplicate assistant messages by subscribing to canonical events only (#432) (#439)
* fix(chat): deduplicate assistant messages by subscribing to canonical events only (#432)

The Rust core emits socket events with both snake_case and colon:case
aliases via emit_with_aliases(). The frontend was subscribing to both,
causing every chat event to fire twice and producing duplicate assistant
messages.

- Subscribe only to canonical snake_case events (tool_call, chat_segment,
  chat_done, chat_error) instead of both naming conventions
- Add safety-net dedup layer in Conversations.tsx using a seen-events map
  with TTL to guard against any remaining edge cases
- Add unit tests verifying only canonical events are processed

Closes #432

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

* style: apply prettier formatting to chatService test

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 02:57:25 +05:30
0f578382d1 fix(autocomplete): auto-start engine when config enabled (#412) (#442)
* fix(autocomplete): add start_if_enabled for engine auto-start at boot (#412)

The autocomplete engine was never started automatically when
config had autocomplete.enabled = true. Add start_if_enabled()
that checks config and starts the global engine singleton during
core process startup.

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

* fix(autocomplete): wire engine startup into core server init (#412)

Call start_if_enabled() after config load in the JSON-RPC server
so the autocomplete engine runs automatically when the core process
boots with autocomplete enabled. Remove stale E2E test assertions
that conflicted with the new startup path.

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

* fix(autocomplete): auto-start engine when enabled via set_style RPC (#412)

When the frontend enables autocomplete through set_style(enabled=true),
automatically start the engine so suggestions begin immediately without
requiring a separate start call or app restart.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 02:56:58 +05:30
Mega MindandGitHub 371bcd34ea Feat/chat issue (#441)
* feat: display app version in settings panel

* fix(onboarding): auto-refresh accessibility state after grant (#351)

* style(onboarding): apply formatter for issue #351 fix

* fix(onboarding): ESLint + typed mock for ScreenPermissionsStep; clear flag in handler

Consolidate tauriCommands imports and drop redundant mock cast.

Handle granted accessibility in focus/visibility callback instead of a follow-up effect.

Made-with: Cursor

* feat(env): add support for custom dotenv path and update dependencies

- Introduced an optional environment variable `OPENHUMAN_DOTENV_PATH` to specify a custom path for dotenv files, enhancing configuration flexibility.
- Updated `Cargo.toml` to include the `dotenvy` dependency for improved dotenv file handling.
- Enhanced the `.env.example` file with a new comment for the custom dotenv path.
- Added data-testid attributes and button types in `SkillDebugModal` and `Skills` components for better testability.
- Created new tests for Gmail and Notion third-party skills to ensure proper functionality of sync and debug tools.
- Added documentation for memory sync functions to clarify usage patterns and function details.

* fix: address CodeRabbit review on PR #441

- Dotenv: treat empty OPENHUMAN_DOTENV_PATH as unset; propagate from_path errors
- Document OPENHUMAN_DOTENV_PATH parent-env requirement in .env.example
- Memory docs: MD040 fence language; clarify skill namespace vs integration id
- QuickJS bootstrap: modern helpers, generic platform.notify log, template URLs
- Skills UI: type=button on close/settings; async waitFor in sync tests
- Gmail OAuth e2e: workspace env matches MemoryClient; env/engine drop guards;
  redact secrets from logs
- Add replace_global_engine for test teardown

Made-with: Cursor
2026-04-09 01:51:30 +05:30
Cyrus GrayandGitHub 320e31f4b3 feat(upsell): add usage-aware banners, rate-limit modal, and shared usage hook (#403) (#440)
Phase 1 of the upsell flow for free users:
- Shared `useUsageState` hook with module-level cache (60s TTL)
- Reusable `UpsellBanner` component (info/warning/upgrade variants)
- `UsageLimitModal` shown when user tries to send at hard limit
- `GlobalUpsellBanner` for app-level usage warnings
- Pre-limit warning banner in Conversations at 80%+ usage
- localStorage-based dismiss persistence with cooldown

Closes #403
2026-04-09 00:47:59 +05:30
YellowSnnowmannandGitHub 90fac95d7a Fix: telegram replies (#436)
* 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
2026-04-08 11:52:38 -07:00
YellowSnnowmannandGitHub afa6ea96c7 feat(conversations): add bypassRateLimit flag to team usage and update UI logic (#438)
- Introduced a new optional `bypassRateLimit` field in the TeamUsage interface to manage rate limit enforcement for specific users.
- Updated Conversations component to conditionally render limit indicators and messages based on the `bypassRateLimit` status, enhancing user experience by providing clearer feedback on usage limits.
2026-04-08 22:43:33 +05:30
YellowSnnowmannandGitHub 45a821645a feat(refer) : Implement referral system with UI components and API integration (#430)
* Implement referral system with UI components and API integration

- Added  to document the referral system, including reward structure, rules, data model, migration, core services, and API endpoints.
- Created  component to display referral stats and allow users to apply referral codes.
- Integrated referral functionality into the onboarding process with  for applying referral codes.
- Updated  page to include the new .
- Implemented API calls in  for fetching referral stats and applying referral codes.
- Added tests for the referral API to ensure proper functionality and data normalization.
- Introduced device fingerprinting for referral code application to prevent abuse.

This commit establishes a comprehensive referral system, enhancing user engagement and incentivizing referrals.

* Update OLLAMA_BASE_URL to local development address

* Enhance referral system and onboarding process

- Added a new function to format reward rates from basis points to percentage for better display in the ReferralRewardsSection.
- Improved loading state management in the referral stats loading process to prevent race conditions.
- Updated the Onboarding component to handle referral step skipping more effectively, ensuring a smoother user experience.
- Fixed a typo in the WelcomeStep component's button label for clarity.
- Enhanced error handling in the referral API to provide clearer feedback on failures.

These changes improve the usability and reliability of the referral system and onboarding experience.
2026-04-08 20:16:46 +05:30
2e7d1946b0 fix(ui): state-aware bootstrap buttons with user feedback (#353) (#426)
* fix(ui): state-aware bootstrap buttons with user feedback (#353)

When local AI state is "ready", replace the Bootstrap button with a
"Running" badge so clicking it no longer appears to do nothing.
Show "Retry" label when state is degraded.  Add transient success/error
messages after manual bootstrap/re-bootstrap actions so the user always
gets clear feedback.

Closes #353

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

* test(ui): add unit tests for state-aware bootstrap buttons (#353)

Cover the four key rendering states of the Home local-AI card:
- "Running" badge when state is ready (Bootstrap button hidden)
- "Retry" label when state is degraded
- "Bootstrap" label when state is idle
- Transient "Re-bootstrap complete" message after successful re-bootstrap

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 20:03:48 +05:30
Cyrus GrayandGitHub e8d27a006f fix(settings): resolve blank state on first open (#429)
* fix(settings): resolve blank state on first open

Keep CoreStateProvider bootstrapping alive on initial RPC failure instead
of immediately giving up — lets the 3s poll retry until the sidecar
responds (up to 5 attempts). Add catch-all route in Settings to redirect
unmatched sub-paths, and show RouteLoadingScreen during PersistGate
rehydration instead of rendering nothing.

Closes #413

* refactor: use async/await in poll handler for consistency

Address CodeRabbit nitpick — replace .then()/.catch() chain with
async/await in the setInterval poll callback to match the rest of the
codebase style.
2026-04-08 20:02:22 +05:30
YellowSnnowmannandGitHub 8c52236737 refactor(billing): update terminology from "5-hour" to "10-hour" for consistency across billing components (#431)
- Updated comments and variable names in the billingHelpers, InferenceBudget, SubscriptionPlans, and Conversations components to reflect the new 10-hour rolling inference window.
- Adjusted UI labels and descriptions to ensure clarity regarding the 10-hour cap and its implications for users.
- Enhanced the TeamUsage interface documentation to accurately describe the rolling inference window and its associated limits.
2026-04-08 20:01:26 +05:30
Cyrus GrayandGitHub a8b9304098 feat(onboarding): redesign WelcomeStep as auto-advancing carousel (#427)
* feat(onboarding): redesign WelcomeStep as auto-advancing carousel

Replace the static welcome screen with a 3-slide auto-rotating carousel
(Welcome, Integrations, Automation) that cycles every 5 seconds. The
"Let Start" button advances to the next onboarding step as before.

- WelcomeStep now contains internal carousel with dot pagination
- ProgressIndicator changed from bar segments to dot indicators
- Removed top-level ProgressIndicator from Onboarding.tsx
- Slides 2 and 3 have image placeholders for future visuals

* style: fix prettier formatting in Onboarding.tsx

* feat(onboarding): add visuals for integration and automation slides

Replace placeholder divs with actual images for onboarding carousel
slides 2 (manage work / integrations) and 3 (automate it all / tasks).

* feat(onboarding): navigate to conversations page after completion

Redirect user to /conversations after onboarding completes or is
skipped, so they land directly on the chat page.

* fix(test): wrap OnboardingOverlay tests in MemoryRouter

The useNavigate hook added in the previous commit requires a Router
context. Wrap all test renders in MemoryRouter to fix the failures.

* style: fix prettier formatting in OnboardingOverlay test
2026-04-08 15:52:55 +05:30
Steven EnamakelandGitHub 4ee518cf31 feat(tree-summarizer): hierarchical summary tree module with CLI (#423)
* feat(tree-summarizer): implement hierarchical summarization engine and event handling

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

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

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

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

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

* style: apply cargo fmt to tree_summarizer module

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

These changes aim to improve the robustness of markdown parsing and the reliability of test outcomes in the tree summarization module.
2026-04-08 01:56:25 -07:00
Steven EnamakelandGitHub 0609493e1a Add RAM-tiered local AI presets (#425) 2026-04-08 01:35:35 -07:00
Steven EnamakelandGitHub cd2a4a9a87 feat(screen-intelligence): OCR-only mode without vision model (#424)
* feat(settings): add 'Use Vision Model' option to Screen Intelligence Panel

- Introduced a new checkbox in the Screen Intelligence Panel to toggle the use of a vision model for richer context extraction from screenshots.
- Updated state management to handle the new option and integrated it into the configuration and processing logic.
- Adjusted related tests and configurations to support the new feature, ensuring compatibility across the application.

* feat(cli): add --no-vision-model option for screen intelligence

- Introduced a new command-line option `--no-vision-model` to allow users to skip the vision model and use OCR and text LLM only.
- Updated the CLI options parsing to handle the new flag and modified the bootstrap logic to respect this setting.
- Enhanced usage documentation to reflect the new option and its alias `--ocr-only` for clarity.

* fix(screen-intelligence): read use_vision_model from engine runtime config

The processing worker was reading use_vision_model from the persisted
config file (Config::load_or_init), so the CLI --no-vision-model flag
had no effect. Now reads from the engine's in-memory runtime config
which the CLI correctly overrides via apply_config(). Also moves image
compression before OCR pass.

* fix: add use_vision_model to test fixtures and fix rustfmt

Add the new use_vision_model field to all AccessibilityConfig test
fixtures so TypeScript compilation passes. Also includes rustfmt
auto-fix for screen_intelligence_cli.rs.
2026-04-08 01:27:59 -07:00