Commit Graph
275 Commits
Author SHA1 Message Date
Steven Enamakel e446c8d334 Merge remote-tracking branch 'refs/remotes/upstream/main' 2026-04-18 10:36:57 -07:00
Steven Enamakel 8bdecf6100 chore: update OpenHuman version to 0.52.24 and enhance CSP in tauri.conf.json
- Bumped the OpenHuman package version to 0.52.24 in both Cargo.lock files.
- Updated the Content Security Policy (CSP) in tauri.conf.json to allow connections from localhost and 127.0.0.1, improving development flexibility.

These changes ensure compatibility with the latest OpenHuman features and enhance security settings for local development.
2026-04-18 10:36:53 -07:00
github-actions[bot] 8728bc75d4 chore(release): v0.52.25 2026-04-18 16:47:15 +00:00
github-actions[bot] 28354bb33c chore(release): v0.52.24 2026-04-18 13:40:16 +00:00
Steven Enamakel f0e98ef655 fix: update Tauri updater public key in configuration
- Replaced the existing public key in the Tauri configuration file with a new one to ensure proper functionality of the updater plugin.
- This change is necessary for maintaining the integrity and security of the update process within the application.
2026-04-18 06:11:26 -07:00
github-actions[bot] 0f3a967642 chore(release): v0.52.23 2026-04-18 13:00:57 +00:00
github-actions[bot] 5719379798 chore(release): v0.52.22 2026-04-18 08:59:52 +00:00
github-actions[bot] 1da4832748 chore(release): v0.52.21 2026-04-18 08:31:36 +00:00
Steven EnamakelandGitHub ee3f6472ca feat: improve sub-agent tooling, conversation timeline UX, and Tauri setup (#646)
* refactor(tauri): update development scripts and configuration for CEF integration

- Modified `package.json` scripts to consistently export `CEF_PATH` for all `cargo tauri` commands, ensuring a unified CEF binary distribution location.
- Removed the overlay window configuration from `tauri.conf.json` and updated related Rust functions to reflect this change, while retaining helper functions for potential future use.
- Updated documentation in `install.md` to clarify the importance of setting `CEF_PATH` for consistent CEF integration across builds.
- Enhanced the `ensure-tauri-cli.sh` script to set `CEF_PATH` and ensure proper installation of the vendored CEF-aware `tauri-cli`.

These changes streamline the development workflow and improve the reliability of CEF integration in the application.

* refactor(release): enhance macOS signing script for nested frameworks and helper apps

- Introduced a new `codesign_hardened` function to streamline the signing process with consistent options.
- Improved the signing logic for nested frameworks and helper applications, ensuring all binaries are signed correctly.
- Updated output messages for better clarity during the signing process, including detailed listings of bundle contents.
- Disabled the summarizer payload threshold in the configuration to prevent recursive invocations until the issue is resolved.

These changes improve the reliability and maintainability of the macOS signing and notarization workflow.

* feat(orchestrator): add current_time tool and enhance agent capabilities

- Introduced the `current_time` tool to provide the current date and time in UTC and local time zones, facilitating scheduling and reminders.
- Updated `agent.toml` to include new tools: `current_time`, `cron_add`, `cron_list`, `cron_remove`, and `schedule`, enhancing the orchestrator's functionality.
- Expanded documentation in `prompt.md` to guide users on utilizing the new direct tools effectively.

These changes improve the orchestrator's ability to handle time-related queries and scheduling tasks directly, enhancing user experience.

* feat(gmail): implement post-processing for Gmail responses to convert HTML to markdown

- Added a new `post_process` module specifically for Gmail, which modifies action responses to convert HTML content into markdown format, improving usability and reducing context token usage.
- Enhanced the `ComposioProvider` trait with a `post_process_action_result` method to allow providers to handle response modifications.
- Introduced a `post_process` function that checks for a `raw_html` flag in the arguments to determine whether to apply the conversion.
- Implemented tests to validate the HTML detection and conversion logic, ensuring the integrity of the post-processing functionality.

These changes enhance the handling of Gmail responses, making them more suitable for further processing and display in the application.

* refactor(gmail): improve HTML to markdown conversion and tool result budget

- Enhanced the `post_process` module for Gmail to handle large HTML payloads more efficiently, implementing a fallback mechanism for oversized content.
- Updated the `DEFAULT_TOOL_RESULT_BUDGET_BYTES` to `0`, disabling the budget temporarily while reworking the oversized-output path.
- Refined the `extract_markdown_body` function to better manage HTML content, ensuring cleaner markdown output and improved performance.
- Added utility functions for stripping HTML noise and handling large email bodies, enhancing the overall robustness of the email processing logic.

These changes optimize the handling of Gmail responses, improving usability and performance in processing large HTML content.

* feat(thread): implement thread title generation from user and assistant messages

- Added a new `generateTitleIfNeeded` function in the `threadApi` to create a thread title based on the first user message and the assistant's reply.
- Introduced a new `GenerateConversationThreadTitleRequest` struct to handle requests for title generation.
- Updated the `ChatRuntimeProvider` to dispatch the title generation action after processing inference responses.
- Enhanced the `threadSlice` with a new async thunk for generating thread titles, ensuring proper error handling and thread loading.
- Added tests for the new title generation functionality to validate the integration with the threads RPC.

These changes improve the user experience by automatically generating relevant thread titles, enhancing the organization of conversations.

* feat(conversations): add thread title update functionality

- Implemented `update_thread_title` method in `ConversationStore` to allow updating the title of existing conversation threads.
- Added a corresponding public function `update_thread_title` for external access.
- Enhanced tests to verify that thread titles are correctly updated and persisted in the store.

These changes improve the management of conversation threads by enabling dynamic title updates, enhancing user experience and organization.

* feat(docs): add comprehensive agent and subagent tool flow documentation

- Introduced a new document detailing the runtime flow of the agent harness, including execution paths for main agents and tools.
- Explained the differences between typed and fork subagents, and provided guidance for debugging harness and delegation issues.
- Included a file map outlining key components and their roles within the Rust implementation.
- Added a flow diagram to visually represent the interaction between agents, tools, and subagents.

These changes enhance the understanding of the agent architecture and improve the documentation for developers working with the system.

* feat(subagent): implement extraction tool and handoff cache for oversized results

- Introduced `extract_from_result` tool to allow targeted queries against oversized tool outputs, improving efficiency by directly interacting with the extraction model.
- Added `ResultHandoffCache` to manage oversized payloads, enabling progressive disclosure and reducing context length issues in sub-agent history.
- Implemented hygiene helpers for cleaning tool outputs before caching, ensuring only relevant data is stored.
- Enhanced the sub-agent runner with new modules for tool preparation and execution, streamlining the overall agent workflow.

These changes enhance the sub-agent's ability to handle large tool results effectively, improving performance and user experience.

* feat(conversations): enhance message bubble rendering and timeline entry formatting

- Introduced new utility functions for parsing and rendering agent messages, including `splitAgentMessageIntoBubbles` and `parseMarkdownTable`, to improve the display of messages in conversation threads.
- Implemented `BubbleMarkdown` and `TableCellMarkdown` components for better formatting of user and agent messages, ensuring consistent styling and interaction.
- Enhanced the `formatTimelineEntry` function to provide clearer titles and details for tool timeline entries, improving the user experience during interactions with subagents.
- Updated the `ChatRuntimeProvider` to utilize the new formatting functions, ensuring that tool timeline entries are displayed with relevant context and detail.

These changes improve the overall presentation and usability of conversation messages and tool interactions, enhancing user engagement and clarity.

* feat(subagent): enforce restrictions on sub-agent spawning tools

- Introduced a filter to prevent sub-agents from invoking their own spawning tools, specifically `spawn_subagent` and `delegate_*`, to avoid recursion issues and ensure proper delegation by the top-level orchestrator.
- Updated the `is_subagent_spawn_tool` function to identify these tools and integrated checks in both `run_typed_mode` and `run_fork_mode` to maintain the integrity of the sub-agent execution environment.
- Enhanced logging to track the removal of restricted tools from the sub-agent's tool surface, improving observability and debugging capabilities.

These changes strengthen the sub-agent architecture by enforcing strict boundaries on tool invocation, enhancing stability and performance.

* feat(conversations): add ToolTimelineBlock component and enhance timeline entry formatting

- Introduced the `ToolTimelineBlock` component to display tool timeline entries with improved formatting and user interaction, including auto-expansion for running entries.
- Enhanced the `formatTimelineEntry` function to include user-friendly titles for specific tool actions, such as 'Viewing your Integrations'.
- Updated the rendering logic in the `Conversations` component to filter and display visible messages more effectively, improving user experience during conversations.

These changes enhance the clarity and usability of tool interactions within conversation threads, providing users with better context and engagement.

* refactor(conversations): streamline component imports and enhance formatting consistency

- Consolidated import statements in `Conversations.tsx` and `ChatRuntimeProvider.tsx` for improved readability.
- Refactored the `ToolTimelineBlock` component to simplify its props structure.
- Enhanced formatting consistency in the rendering logic of agent message bubbles and timeline entries, ensuring cleaner code and better maintainability.
- Updated test cases for `splitAgentMessageIntoBubbles` and `formatTimelineEntry` to reflect formatting changes and ensure accuracy.

These changes improve code clarity and maintainability while enhancing the overall user experience in conversation threads.

* fix: satisfy pre-push lint on fix/tauri

* fix(chat): refresh usage counters after responses

* refactor(ChatRuntimeProvider): remove redundant import of requestUsageRefresh

- Eliminated the duplicate import statement for `requestUsageRefresh` in `ChatRuntimeProvider.tsx`, streamlining the code for better readability and maintainability.

* fix(chat): satisfy pre-push checks

* refactor(conversations): improve error handling and remove unused title generation logic

- Removed the unused `generateThreadTitleIfNeeded` function call from the `Conversations` component, simplifying the message dispatch logic.
- Enhanced error handling during message dispatch by using `unwrap()` to catch and log errors, providing clearer feedback on send failures.
- Updated the `ChatRuntimeProvider` to ensure proper error logging when generating thread titles, improving observability of issues related to title generation.

These changes streamline the conversation handling process and improve the robustness of error management in the chat system.

* refactor(conversations): improve formatting of title redaction and streamline test assertions

- Reformatted the `redact_title_for_log` function for better readability by adjusting the formatting of the output string.
- Simplified the assertion in the timezone test to enhance clarity and maintainability.

These changes contribute to cleaner code and improved test structure in the conversations module.

* refactor(tokenjuice): sort fact parts for improved formatting in inline summary

- Modified the `format_inline` function to sort the fact parts before generating the summary string. This change enhances the readability and consistency of the output by ensuring that facts are presented in a stable order.

These changes contribute to better formatted summaries in the token juice module.

* fix: address remaining CodeRabbit review comments

* refactor: streamline error handling and improve code readability

- Updated error handling in prompt loading to use `std::io::Error::other` for better clarity.
- Simplified conditional checks using `is_none_or` and `is_some_and` for improved readability.
- Refactored string trimming logic to utilize array syntax for better clarity.
- Enhanced default implementations for several structs to reduce boilerplate code.

These changes contribute to cleaner code and improved maintainability across various modules.

* refactor: improve code formatting and structure

- Adjusted formatting in `post_process.rs` for better readability by aligning the conditional block.
- Combined derive attributes in `tools.rs` for the `ComputerControlConfig` struct to reduce redundancy.
- Streamlined entry retrieval in `compatible.rs` by condensing multiple lines into a single line for clarity.

These changes enhance code readability and maintainability across the affected modules.
2026-04-18 00:44:31 -07:00
Steven Enamakel ff684f22e8 feat(tauri): integrate vendored CEF-aware tauri-cli and update development scripts
- Added a new script `ensure-tauri-cli.sh` to ensure the vendored CEF-aware `tauri-cli` is installed, preventing runtime errors related to missing Chromium Embedded Framework files.
- Updated `package.json` scripts to call `yarn tauri:ensure` before other commands, ensuring the correct CLI is used for building and running the application.
- Enhanced documentation in `CLAUDE.md` and `install.md` to clarify the requirement for the vendored `tauri-cli` and the installation process.
- Improved the `dev:app` and `dev:wry` scripts to streamline the development workflow with the new CLI setup.

These changes enhance the development experience by ensuring the correct tooling is in place for building and running the application with CEF support.
2026-04-17 21:36:22 -07:00
Steven EnamakelandGitHub 8f4696bdfb feat(composio): per-toolkit tool curation, user scopes, and Gmail HTML→markdown (#643)
* feat(composio): add user scope management for toolkits

- Introduced `get_user_scopes` and `set_user_scopes` functions to manage per-toolkit user scope preferences, allowing for read, write, and admin classifications.
- Updated `all_controller_schemas` and `all_registered_controllers` to include new schemas for user scope management.
- Implemented `evaluate_tool_visibility` to determine tool visibility based on user-defined scopes, enhancing security and control over tool actions.
- Added `UserScopePref` struct to store user preferences and integrated it with memory storage for persistence.
- Enhanced existing tools to respect user scope preferences during execution, ensuring actions align with user-defined permissions.

These changes improve the flexibility and security of toolkit interactions, allowing users to customize their access levels for different actions.

* feat(gmail): expand GMAIL_CURATED tools for enhanced email management

- Updated the GMAIL_CURATED constant to include additional tools for reading and writing emails, such as GMAIL_LIST_MESSAGES, GMAIL_LIST_THREADS, GMAIL_GET_ATTACHMENT, and GMAIL_FORWARD_MESSAGE.
- Improved organization of tools by categorizing them under distinct sections for reading messages, managing drafts, and handling labels.
- Enhanced admin tools with new functionalities like GMAIL_BATCH_DELETE_MESSAGES and GMAIL_UNTRASH_THREAD, improving overall email management capabilities.

These changes provide a more comprehensive toolkit for interacting with Gmail, enhancing user experience and functionality.

* refactor(tool_scope, gmail): improve code formatting and organization

- Reformatted the `ADMIN` and `GMAIL_CURATED` constants for better readability by aligning the entries vertically.
- Enhanced the clarity of the `classify_unknown` function by improving the structure of the constants, making it easier to maintain and understand.
- Updated test assertions in `toolkit_from_slug` for consistency in formatting, ensuring clearer test outputs.

These changes improve the overall readability and maintainability of the codebase, aligning with ongoing refactoring efforts.

* feat(github): add GitHub toolkit and curated tools for enhanced integration

- Introduced a new GitHub provider module, including a curated catalog of GitHub actions tailored for common tasks such as repository management, issue tracking, and pull request handling.
- Implemented the `catalog_for_toolkit` function to allow fallback to a static curated list for toolkits without a native provider, ensuring consistent tool visibility and access.
- Updated the `evaluate_tool_visibility` function to prioritize curated tools from registered providers, enhancing the overall user experience and security by enforcing whitelist checks.

These changes expand the capabilities of the Composio toolkit, providing users with a comprehensive set of tools for interacting with GitHub, while maintaining a focus on user-defined permissions and visibility.

* refactor(tools): improve formatting and organization of curated tools

- Reformatted the `GITHUB_CURATED`, `NOTION_CURATED`, and other tool constants for better readability by aligning entries vertically.
- Enhanced the clarity of the code structure, making it easier to maintain and understand.
- Updated related documentation to reflect the changes in formatting and organization.

These changes improve the overall readability and maintainability of the codebase, aligning with ongoing refactoring efforts.

* feat(catalogs): introduce curated catalogs for various toolkits

- Added a new module `catalogs.rs` containing curated tool lists for Slack, Discord, Google Calendar, Google Drive, Google Docs, and more, enhancing the Composio toolkit's integration capabilities.
- Updated the `mod.rs` file to include the new `catalogs` module and modified the `catalog_for_toolkit` function to support these curated lists, allowing for better organization and access to toolkit actions.
- This addition improves the overall functionality and user experience by providing a comprehensive set of tools for interacting with popular platforms.

* feat(post-process): implement HTML to markdown conversion for Gmail responses

- Introduced a new `post_process` module to handle per-toolkit response modifications, specifically for converting HTML content to markdown format.
- Enhanced the `ComposioExecuteTool` to apply post-processing on successful responses, improving the clarity and usability of data returned from Gmail.
- Added tests to ensure the correct functionality of HTML detection and conversion, validating the integrity of the post-processing logic.

These changes enhance the user experience by streamlining the handling of HTML content in responses, making it more suitable for further processing and display.

* refactor(post_process): reorganize HTML detection constants for improved readability

- Moved HTML detection markers in the `looks_like_html` function to a more structured format, enhancing clarity and maintainability.
- This change aligns with ongoing efforts to improve code organization and readability within the post-processing module.

* refactor(catalogs): enhance formatting and organization of curated tool constants

- Reformatted the `SLACK_CURATED`, `DISCORD_CURATED`, and `GOOGLECALENDAR_CURATED` constants for improved readability by aligning entries vertically.
- This change enhances the clarity and maintainability of the code, aligning with ongoing refactoring efforts to improve code organization.

* feat(connect-modal): wire read/write/admin scope toggles to composio prefs

Adds the three scope toggles to the connected-state of the
ComposioConnectModal so users can gate which Composio actions the
agent may invoke per integration. Loads the stored pref via
`composio_get_user_scopes` once the modal lands in the connected
phase and persists changes through `composio_set_user_scopes` with
optimistic updates and rollback on error.

- Adds `getUserScopes` / `setUserScopes` to composioApi.
- Adds `ComposioUserScopePref` type mirror.
- Renders accessible role="switch" toggles with hint text per row.

* refactor(ComposioConnectModal): simplify SCOPE_ROWS definition

- Streamlined the definition of SCOPE_ROWS in ComposioConnectModal by removing unnecessary line breaks, enhancing code readability and maintainability.
- Updated the agent.toml configuration to include "composio_execute" in the tools list, expanding the capabilities of the integrations agent.

* fix(composio): apply curated whitelist + scope pref to integrations_agent prompt

The agent prompt for integrations_agent was rendering every action
returned by the backend's `composio_list_tools` for each connected
toolkit, bypassing the curation/scope filter that the meta-tool layer
applies. Concretely the GitHub integrations_agent prompt was showing
~500 actions including non-curated entries like
GITHUB_ADD_OR_UPDATE_TEAM_REPOSITORY_PERMISSIONS.

Adds `is_action_visible_with_pref(slug, pref)` — a sync helper that
mirrors the meta-tool layer's decision logic — and applies it in:
- `fetch_connected_integrations_uncached` (bulk session-cached path)
- `fetch_toolkit_actions` (per-toolkit spawn-time path)

One pref load per toolkit (not per action) keeps the cost minimal.

* refactor(fetch_connected_integrations): streamline action visibility filter

Simplified the action visibility filter in `fetch_connected_integrations_uncached` by consolidating the filter logic into a single line. This change enhances code readability while maintaining the existing functionality of applying user preferences to the displayed actions.

* fix(prompt): drop duplicate `### Available Tools` listing in text-mode preamble

Text-mode subagent prompts were rendering the tool catalog twice: once
in the prompt template's `## Tools` section (with the richer
`Call as: NAME[arg|arg]` signatures from `prompts::ToolsSection::build`)
and once in `### Available Tools` under `## Tool Use Protocol`
(`Parameters: name:type, ...` format).

For an integrations_agent toolkit spawn (~50 actions) this doubled the
tool listing bytes for no informational gain. Keep only the protocol
preamble (essential for text mode); the catalog stays in `## Tools`.

Removes `summarise_parameters` and `first_line_truncated` which were
the sole consumers, plus the now-unused `std::fmt::Write` import.

* review: address PR feedback (UTF-8 boundary, structured logs, doc, debug)

Real fixes:
- post_process: walk back to UTF-8 char boundary before truncating to
  4096 bytes; previous `&s[..4096]` could panic mid-codepoint. Adds
  regression test that places a 3-byte char straddling the cutoff.
- composioApi: move misplaced `execute` docstring back above `execute`
  (it had drifted above the new `getUserScopes`).
- schemas: include `get_user_scopes` / `set_user_scopes` in the
  `every_known_schema_key_resolves` test.

Diagnosability:
- schemas: structured `[composio:scopes]` debug/error logs at entry,
  exit, and every early-return in `handle_get_user_scopes` /
  `handle_set_user_scopes` (method + toolkit + pref fields). The
  memory-not-ready branch now logs an error before returning.
- composioApi + ConnectModal: grep-friendly `[composio][scopes]` debug
  logs around getUserScopes / setUserScopes RPC round-trips and the
  toggle handler (old → new state, persisted result, errors).
- user_scopes: load_or_default now logs the same normalized `key` that
  `load()` does, so traces correlate across both code paths.

Cleanups:
- tools: replace external `idx` + `Vec::retain` in
  `filter_list_tools_response` with a drain + zip + filter_map pattern.
- tool_scope: document the no-underscore-in-toolkit-name assumption of
  `toolkit_from_slug`, and call out the `microsoft_teams` alias.
- Cargo.toml: comment on the html2md vs htmd choice.

Pushback (no change):
- Reviewer asked to split the type-only import in ConnectModal into a
  separate `import type` line; ESLint's `no-duplicate-imports` rejects
  that, so the inline `type` form (functionally identical) stays.
2026-04-17 21:12:17 -07:00
Steven Enamakel 2150944cb6 chore(tauri-cef): update submodule pointer to latest commit c64bea69
This commit updates the tauri-cef submodule to the latest commit, ensuring that the project is using the most recent changes and improvements from the upstream repository. This change is part of ongoing maintenance to keep dependencies up to date.
2026-04-17 21:01:21 -07:00
Steven Enamakel a5bb3ec32a fix(ci): bump tauri-cef submodule to pick up cef-helper build fix
Move the vendored tauri-cef submodule pointer from d278ff5d1 (which sits
on `feat/cef-custom` — the wrong branch; .gitmodules tracks
`feat/cef-notification-intercept`) to 1b58f715f, the current tip of the
tracked branch.

Fixes macOS release builds, which were failing in the `cargo install
--locked --path vendor/tauri-cef/crates/tauri-cli` step with:

  error[E0583]: file not found for module `notification`
     --> src/main.rs:3:1
    |
  3 | mod notification;
    | ^^^^^^^^^^^^^^^^^

tauri-bundler/build.rs previously copied only cef-helper/Cargo.toml and
src/main.rs into OUT_DIR before invoking a nested cargo build, but
cef-helper's main.rs contains `mod notification;` and the sibling
notification.rs was never copied. The fix on the fork (1b58f715f —
"fix(bundler): copy entire cef-helper/src/ tree, not just main.rs")
copies the whole src/ directory, which resolves the module.

Linux and the CI Docker image are unaffected because the bundler build
script short-circuits on non-apple-darwin targets; this only bites the
macOS release matrix.
2026-04-17 20:57:31 -07:00
Steven EnamakelandGitHub 93e85c2df3 feat(build): make CEF the default webview runtime across builds, tests, and releases (#641)
- Flip `app/src-tauri/Cargo.toml` `default = ["cef"]` (wry is now opt-in via
  `--no-default-features --features wry`). `cef-dll-sys` auto-downloads the
  Chromium runtime per-target at compile time.
- Update dev scripts: `dev:app` now uses CEF + keychain safe-storage setup;
  `dev:cef` aliased to it; new `dev:wry` for opt-out; `macos:build:*` and
  `tauri:build:ui` switched to `cargo tauri` so the CEF-aware bundler runs.
- Replace `tauri-apps/tauri-action@v0.6.2` / `yarn tauri build` with
  `cargo tauri build` in `build.yml`, `build-windows.yml`, and `release.yml`.
  The upstream `@tauri-apps/cli` binary does not bundle CEF framework files
  into the produced installer — only the fork at `vendor/tauri-cef` does, so
  workflows must use the fork's CLI or the shipped apps fail to launch.
- Bake the CEF-aware `cargo-tauri` into `ghcr.io/tinyhumansai/openhuman_ci`
  by compiling it from the submodule during Docker image build, plus CEF
  runtime libs (libnss3, libgbm1, libxshmfence1, …). Skips the per-run
  cargo-install in the container-based `build.yml`.
- Cache CEF downloads per-OS in matrix jobs (~400MB/platform) and cache the
  compiled `cargo-tauri` binary on raw GH runners (build-windows, release).
- Explicit `gh release upload` step for Linux + Windows installers since the
  tauri-action upload path was removed; macOS keeps its existing re-sign +
  notarize + re-upload flow.
2026-04-17 19:59:12 -07:00
Steven EnamakelandGitHub fff24a6c6f fix(prompts): v2 prompt pipeline, integrations_agent, and subagent session plumbing (#642)
* refactor(transcript): update session transcript paths and enhance directory structure

- Changed the source of truth path for session transcripts from `sessions/{DDMMYYYY}/{agent}_{index}.jsonl` to `session_raw/{DDMMYYYY}/{agent}_{index}.jsonl` to better reflect the organization of files.
- Updated the logic for creating and resolving transcript paths to accommodate the new directory structure, ensuring compatibility with legacy `.md` files.
- Improved documentation to clarify the changes in file organization and their implications for transcript management.

This refactor enhances the clarity and maintainability of session transcript handling by establishing a more logical file structure.

* refactor(prompts): update tool handling in prompt builders

- Replaced `Vec<String>` with `Vec<ToolSummary<'_>>` for available tools in multiple agent prompt builders, enhancing type safety and clarity.
- Introduced `render_tool_catalog` and `render_connected_integrations` functions to dynamically generate sections in prompts based on available tools and connected integrations.
- Updated the `build` function in various agent prompts to utilize the new rendering functions, ensuring that prompts accurately reflect the current context and available resources.

These changes improve the maintainability and functionality of the prompt generation process across different agents.

* refactor(prompts): streamline prompt builders for agent templates

- Updated the prompt builders for various agents to utilize the sibling `prompt.md` template directly, enhancing clarity and maintainability.
- Replaced `Vec<ToolSummary<'_>>` with `Vec<ToolSummary>` and `Vec<ConnectedIntegration>` for improved type safety in test cases.
- Adjusted the `build` function to ensure consistent formatting and handling of tool catalogs across different agents.

These changes simplify the prompt generation process and prepare the codebase for future enhancements.

* refactor(harness): unify tool filtering and prompt loading for debug consistency

- Exposed `filter_tool_indices` and `load_prompt_source` as `pub(crate)` to ensure that both the live runner and debug dump share the same filtering and loading logic, eliminating discrepancies.
- Enhanced documentation for both functions to clarify their purpose and usage, improving maintainability and understanding of the codebase.

These changes streamline the tool management process and enhance the reliability of debug outputs, ensuring consistency across different contexts.

* refactor(prompts): enhance prompt builders for agent templates

- Updated the prompt builders for various agents to return fully-assembled system prompts, incorporating section helpers from `crate::openhuman::context::prompt`.
- Replaced `Vec<ToolSummary<'_>>` with `Vec<ToolSummary>` and `Vec<ConnectedIntegration>` for improved type safety in test cases.
- Adjusted the `build` function to ensure consistent formatting and handling of user files, tools, and workspace sections across different agents.

These changes streamline the prompt generation process, improve maintainability, and prepare the codebase for future enhancements.

* refactor(prompts): enhance prompt context handling for dynamic sources

- Updated the prompt builders to support fully-assembled prompts from dynamic sources, allowing for more flexible prompt generation.
- Introduced `PromptTool` and `PromptContext` structures to replace `ToolSummary`, improving type safety and clarity in prompt construction.
- Refactored the handling of prompt sources in both the subagent runner and session builder to streamline the integration of dynamic prompts and legacy sources.

These changes improve the maintainability and functionality of the prompt generation process, ensuring accurate representation of available tools and context in agent interactions.

* refactor(prompts): improve prompt context and tool handling

- Enhanced the `PromptContext` structure to include additional fields for better context management, such as `skills`, `dispatcher_instructions`, and `tool_call_format`.
- Replaced `ToolSummary` with `PromptTool` for improved type safety and clarity in prompt generation.
- Updated the handling of dynamic prompt sources in both the subagent runner and debug dump, ensuring consistent integration and rendering of prompts.
- Introduced a mechanism to handle empty visible tool names, enhancing the robustness of prompt generation.

These changes streamline the prompt construction process and improve the overall maintainability of the codebase.

* refactor(prompts): reorganize prompt handling and introduce SystemPromptBuilder

- Moved prompt-related types and builders from `openhuman::context::prompt` to `openhuman::agent::prompts` for better modularity.
- Introduced `SystemPromptBuilder` to streamline the construction of system prompts, allowing for flexible section management.
- Updated module exports to maintain compatibility while enhancing the organization of prompt-related code.

These changes improve the clarity and maintainability of the prompt generation process, aligning it more closely with the agents that utilize these prompts.

* refactor(prompts): unify agent prompt handling and update CLI references

- Removed the "main" alias for the orchestrator in the prompt dumping process, treating it as just another registered agent.
- Updated the `debug-agent-prompts.sh` script to reflect this change, ensuring all agents are included uniformly.
- Revised documentation and error messages in `agent_cli.rs` to replace references to "main" with "orchestrator" for clarity.
- Enhanced the debug dump functionality to maintain consistency across agent prompts, improving overall maintainability and usability.

These changes streamline the prompt handling process and clarify the usage of agent identifiers in the CLI, aligning with the new architecture.

* refactor(prompts): remove CACHE_BOUNDARY references from agent prompts

- Eliminated the CACHE_BOUNDARY marker from various agent prompt files, streamlining the prompt generation process.
- Updated the build functions in multiple agents to ensure consistent handling of workspace rendering without the cache boundary.
- Refactored related prompt handling logic to enhance clarity and maintainability, aligning with the new architecture.

These changes simplify the prompt structure and improve the overall efficiency of prompt generation across agents.

* refactor(prompts): remove cache boundary references from tests and prompts

- Eliminated all instances of cache boundary references from the subagent runner and related tests, simplifying the prompt handling logic.
- Updated test assertions to reflect the removal of cache boundary checks, ensuring consistency across the testing framework.
- Refactored the session manager to streamline the system prompt assembly process without relying on cache boundaries.

These changes enhance the clarity and maintainability of the prompt generation process, aligning with the recent architectural updates.

* refactor(harness): clean up unused imports and streamline code

- Removed unnecessary imports from multiple files, including `RandomState`, `Hasher`, and `SerializeMap`, to enhance code clarity and maintainability.
- Simplified the structure of several modules by eliminating redundant use statements, ensuring a cleaner and more efficient codebase.

These changes contribute to a more organized and readable code structure, aligning with ongoing refactoring efforts.

* refactor(prompts): enhance agent prompt structures and integration handling

- Updated the `orchestrator`, `skills_agent`, and `welcome` prompts to streamline the rendering of connected integrations and delegation guides.
- Introduced dedicated functions for rendering integration information, ensuring clarity in the agent's voice and responsibilities.
- Removed redundant sections from the shared prompt builder, allowing each agent to manage its own prompt content more effectively.
- Improved test coverage for prompt generation, ensuring accurate representation of connected integrations and skills.

These changes enhance the maintainability and clarity of the prompt generation process, aligning with the recent architectural updates.

* refactor(session): update integration handling and clean up prompt parameters

- Revised documentation for `connected_integrations` in the `Agent` struct to clarify its role in the agent's prompt rendering.
- Updated the parameter name in `render_subagent_system_prompt_with_format` to `_connected_integrations` to indicate it is unused, enhancing code clarity.
- Cleaned up import statements in the context module for better organization and maintainability.

These changes improve the clarity of integration handling and streamline the code structure, aligning with ongoing refactoring efforts.

* refactor(agent_cli): simplify command options and improve documentation

- Removed the `--skill` option from the `dump-prompt` command, streamlining the command usage and focusing on essential parameters.
- Updated documentation to clarify the usage of the `dump-prompt` command and its parameters, enhancing user understanding.
- Cleaned up the `DumpFlags` structure by removing unused fields, contributing to a more maintainable codebase.

These changes improve the clarity and usability of the agent CLI, aligning with ongoing refactoring efforts.

* refactor(cli): streamline dotenv loading and clean up prompt rendering

- Introduced `load_dotenv_for_cli` to load environment variables for all CLI entrypoints, ensuring consistent configuration across commands.
- Updated documentation to clarify the purpose of the dotenv loading mechanism.
- Removed unnecessary blank lines in prompt rendering functions across multiple agents, enhancing code readability.

These changes improve the maintainability and clarity of the CLI and prompt handling, aligning with ongoing refactoring efforts.

* refactor(debug-agent-prompts): enhance environment loading and streamline workspace resolution

- Updated the script to load environment variables from a `.env` file, ensuring consistent configuration for prompt generation.
- Simplified workspace resolution by delegating to the binary's internal logic, improving reliability and reducing code duplication.
- Revised documentation to clarify the usage of command options and the impact of environment variables on prompt rendering.

These changes improve the maintainability and clarity of the debug agent prompts script, aligning with ongoing refactoring efforts.

* refactor(agent): remove category filter and simplify agent definitions

- Eliminated the `category_filter` from various agent definitions and related tests, streamlining the agent configuration.
- Updated the `run_list` function in `agent_cli.rs` to reflect the removal of category filtering, enhancing output clarity.
- Revised documentation and comments to remove references to the now-removed category filter, improving overall code maintainability.

These changes contribute to a cleaner and more efficient agent architecture, aligning with ongoing refactoring efforts.

* feat(agents): introduce integrations_agent and tools_agent for enhanced service handling

- Added the `integrations_agent` to manage service integrations via Composio, including a new TOML configuration and prompt structure.
- Introduced the `tools_agent` for general ad-hoc tasks using built-in OpenHuman tools, with its own configuration and prompt.
- Updated the loader to include both agents in the built-in agent list, increasing the total number of agents from 13 to 14.
- Revised orchestrator and welcome prompts to delegate integration tasks to the new `integrations_agent`, ensuring clarity in agent responsibilities.
- Enhanced tests to verify the registration and functionality of the new agents, improving overall test coverage.

These changes expand the capabilities of the agent architecture, allowing for more specialized handling of integrations and tool usage.

* refactor(agents): update references from skills_agent to integrations_agent

- Changed all instances of `skills_agent` to `integrations_agent` across various files, including prompts, CLI commands, and tool registrations.
- Updated documentation and comments to reflect the new agent name, ensuring clarity in agent responsibilities and usage.
- Revised debug scripts to align with the new prompt structure for the integrations agent.

These changes enhance consistency in the codebase and improve the clarity of agent interactions.

* refactor(agents): rename skills_agent to integrations_agent throughout the codebase

- Updated all instances of `skills_agent` to `integrations_agent` in various files, including tests, documentation, and comments.
- Ensured consistency in agent references to improve clarity in agent responsibilities and interactions.
- Revised related code structures to align with the new naming convention, enhancing overall maintainability.

These changes support the transition to the new agent architecture and improve code readability.

* refactor(prompts): implement dynamic prompt rendering for enhanced context handling

- Introduced `DynamicPromptSection` to allow prompts to be built dynamically using a function pointer, enabling real-time access to the `PromptContext`.
- Updated `SystemPromptBuilder` to support dynamic prompts, ensuring that late-arriving state like `connected_integrations` is accurately reflected in the rendered output.
- Revised the prompt handling logic in the agent builder to streamline the integration of dynamic prompts, improving overall flexibility and responsiveness.

These changes enhance the prompt generation process, aligning with the ongoing improvements in agent architecture and context management.

* refactor(prompts): refine delegation guide to display only connected integrations

- Updated the `render_delegation_guide` function to list only the toolkits that are actively connected, omitting unauthorized toolkits to prevent hallucinations during delegation.
- Revised related tests to ensure the prompt correctly reflects the current state of integrations, including scenarios where no integrations are connected.
- Introduced a new utility function to filter out welcome-only tools from non-welcome agents, enhancing the clarity and safety of tool visibility.

These changes improve the accuracy and focus of the delegation guide, aligning with the ongoing enhancements in agent prompt handling.

* refactor(planner): update tool usage and prompt guidelines for read-only operations

- Modified the `agent.toml` configuration to clarify that the planner operates in a read-only mode, specifying that it does not mutate the workspace or memory.
- Revised the prompt guidelines to reflect the read-only nature of the planner, emphasizing the need for explicit nodes for any required writes to be handled by downstream agents.

These changes enhance the clarity of the planner's operational constraints and improve the overall structure of the planning process.

* refactor(config): remove web search enable flag and update related configurations

- Eliminated the `OPENHUMAN_WEB_SEARCH_ENABLED` environment variable and associated logic, as web search is now always enabled by default.
- Updated the configuration schema to reflect the removal of the enable flag from `WebSearchConfig`.
- Adjusted tool registration to ensure web search is always available, simplifying the configuration process.

These changes streamline the web search functionality, ensuring it is consistently available across all sessions.

* refactor(config): update http_request flag to always enabled

- Changed the `http_request` configuration to always be enabled, removing the dependency on the `config.http_request.enabled` flag.
- This adjustment simplifies the configuration process and ensures consistent behavior across the application.

These changes contribute to a more streamlined configuration and enhance the overall reliability of the onboarding process.

* refactor(debug-agent-prompts): transition to dump-all command for agent prompts

- Replaced the previous method of listing agent IDs and dumping prompts with a new `dump-all` command that consolidates the functionality into a single call.
- Updated the script to handle output directory and workspace options more efficiently, leveraging Rust's `dump_all_agent_prompts` for processing.
- Enhanced the handling of the `integrations_agent` to generate separate dumps for each connected toolkit, improving the clarity and organization of output files.
- Revised related logging and summary generation to reflect the new structure, ensuring a more streamlined user experience.

These changes modernize the prompt dumping process, aligning it with the latest architectural improvements and enhancing usability.

* feat(composio): implement dynamic fetching of toolkit actions for integrations

- Added a new `fetch_toolkit_actions` function to retrieve the current action catalogue for a specified Composio toolkit, enhancing the responsiveness of the integrations agent.
- Updated the `subagent_runner` to utilize the fresh action list at spawn time, ensuring that the toolkit's actions reflect the latest backend state.
- Modified the `render_integrations_agent` function to refresh the action catalogue during prompt generation, improving the accuracy of the displayed tools.

These changes enhance the integration experience by providing up-to-date action information, aligning with the ongoing improvements in agent functionality.

* refactor(integrations-agent): update tool visibility and configuration handling

- Modified the `agent.toml` to replace `wildcard` with `named` tools, enhancing control over tool visibility for the integrations agent.
- Updated the `subagent_runner` to ensure that tool visibility aligns with the new TOML configuration, preventing unnecessary stripping of tools.
- Revised the `render_integrations_agent` function to respect the updated tool scope, improving the accuracy of the tool list generated for subagents.

These changes streamline the tool management process, ensuring that only explicitly defined tools are available during agent execution.

* feat(composio): add composio_list_connections tool for dynamic integration detection

- Introduced the `composio_list_connections` tool in the orchestrator's configuration, allowing the agent to detect newly-authorized Composio integrations mid-session.
- Enhanced the `ComposioListConnectionsTool` to filter and return only currently-connected integrations with ACTIVE or CONNECTED status, improving the accuracy of integration management.
- Updated the tool's description to clarify its functionality and usage context.

These changes enhance the agent's ability to manage integrations dynamically, aligning with ongoing improvements in the integration experience.

* fix(prompt): update delegation guide to reference Skills page

- Modified the `render_delegation_guide` function to change the reference from **Settings → Integrations** to the **Skills** page for connecting integrations. This update clarifies the user instructions for integration management.

* feat(session): introduce session key management for sub-agents

- Added `session_key` and `session_parent_prefix` fields to `ParentExecutionContext` to facilitate hierarchical transcript naming for sub-agents.
- Updated `persist_subagent_transcript` to generate transcript filenames based on the parent's session key, ensuring a flat file structure that reflects the parent-child relationship.
- Enhanced `AgentBuilder` and `Agent` to support the new session key management, allowing for better organization of session transcripts.
- Adjusted related functions to ensure proper handling of session keys during agent execution and transcript persistence.

These changes improve the clarity and organization of session transcripts, aligning with the ongoing enhancements in agent functionality.

* refactor(tests): update integrations agent tests for tool scope and transcript handling

- Renamed the `integrations_agent_is_wildcard` test to `integrations_agent_tool_scope_honours_toml` to better reflect its purpose of validating tool scope based on TOML configuration.
- Enhanced the test to assert that the `integrations_agent` correctly recognizes named tools instead of a wildcard.
- Removed the `integrations_agent_has_extra_tools_for_export` test as it is no longer relevant to the current tool management strategy.
- Improved the `latest_in_dir` function to clarify the handling of transcript naming schemes, ensuring proper differentiation between legacy and keyed formats.

These changes streamline the testing process and improve the accuracy of tool scope validation, aligning with recent updates in agent functionality.

* refactor(subagent_runner): improve transcript persistence and streamline inner loop

- Removed the `persist_subagent_transcript` function, transitioning transcript persistence to occur per-iteration within the `run_inner_loop`, enhancing reliability by ensuring transcripts are written immediately after each provider response.
- Updated the handling of session keys to maintain consistent naming for transcripts, reflecting the parent-child relationship in the file structure.
- Simplified the code by eliminating redundant post-loop transcript writes, aligning with recent changes in agent functionality and improving overall clarity in transcript management.

* refactor(agent_cli, subagent_runner, session): improve code readability and formatting

- Enhanced formatting in `agent_cli.rs` for better readability by adjusting the structure of string formatting.
- Streamlined conditional checks in `subagent_runner.rs` to improve clarity and maintainability.
- Simplified the handling of agent IDs in `builder.rs` to reduce line length and improve code flow.
- Updated test cases in `tests.rs` for better alignment and readability of expected values.
- Improved formatting in `debug_dump.rs` to enhance the clarity of toolkit action fetching and logging.

These changes collectively enhance the overall readability and maintainability of the codebase, aligning with ongoing refactoring efforts.

* fix(tests): add missing session_key fields to ParentExecutionContext stub

* fix: address PR review feedback

* fix(prompts-v2): round 2 PR review — dispatcher instructions, workspace-file preservation, cached-tool fallback, transcript persistence

- subagent_runner: populate PromptContext.dispatcher_instructions for Dynamic prompts (was empty string, dropping the ## Tool Use Protocol block in render_tools for PFormat/Json/Native sub-agents)
- subagent_runner: add post-tool persist_transcript after tool results are appended so a mid-round crash doesn't lose tool outputs
- prompts::sync_workspace_file: preserve user-edited workspace files — only overwrite when the file doesn't exist OR its current hash matches the stored builtin hash
- context::debug_dump: mirror runner's cached-tool fallback — keep cached action catalogue on empty/error from fetch_toolkit_actions instead of blanking it
- core::agent_cli: add entry/exit debug logs around dump_all / dump_prompt calls and a trace log around each prompt file write; update module banner to note --toolkit is required when --agent is integrations_agent
2026-04-17 19:47:31 -07:00
Steven EnamakelandGitHub 99d61f93a7 feat(webui-messaging): multi-provider webview accounts, scanners, and chat runtime (#629)
* feat(accounts): implement accounts management with webview integration

- Added a new Accounts page for managing user accounts, including the ability to add and remove accounts.
- Introduced AddAccountModal for selecting account providers and initiating account setup.
- Implemented WebviewHost to display third-party web applications (e.g., WhatsApp Web) within the app.
- Enhanced routing to include a protected route for the Accounts page.
- Updated the BottomTabBar to include an Accounts tab for easy navigation.
- Integrated Redux for state management of accounts, messages, and logs, ensuring a seamless user experience.
- Updated dependencies in Cargo.lock to version 0.52.9 for compatibility.

This commit significantly enhances the application's functionality by allowing users to manage accounts directly within the app, improving overall user engagement and experience.

* refactor(accounts): clean up Accounts component layout and improve readability

- Removed unnecessary comments and simplified the structure of the Accounts component for better clarity.
- Adjusted the rendering logic to enhance the layout of the active account section, improving user experience.
- Reformatted text in the no accounts message for better readability.
- Streamlined the import statements by consolidating related imports, enhancing code organization.

* feat(accounts): enhance account management with new providers and routing updates

- Introduced support for additional account providers: Telegram, LinkedIn, Gmail, and Slack, expanding user options for account management.
- Updated routing to replace the old /conversations path with /chat, streamlining navigation and improving user experience.
- Refactored the App component to include an AppShell for better layout management, ensuring the bottom tab bar visibility aligns with the selected account.
- Enhanced the BottomTabBar component to reflect the new routing and account options, improving accessibility and usability.
- Implemented fullscreen logic for accounts, allowing for a more immersive experience when interacting with selected accounts.
- Added utility functions for managing fullscreen states and account provider icons, enhancing code organization and maintainability.

This commit significantly improves the application's account management capabilities, providing users with a more flexible and engaging experience.

* feat(cef): integrate Chromium Embedded Framework support and enhance webview functionality

- Added support for the Chromium Embedded Framework (CEF) as an alternative runtime, allowing for improved webview capabilities.
- Updated Cargo.toml to include new dependencies and features for CEF integration, ensuring compatibility with existing Tauri plugins.
- Enhanced the WhatsApp recipe to include ghost-text autocomplete functionality, improving user experience during message composition.
- Implemented WebSocket observation in the WhatsApp recipe to capture and forward relevant message frames, enhancing real-time interaction.
- Introduced user agent spoofing for specific providers to bypass fingerprinting checks, ensuring better compatibility with services like Slack and LinkedIn.
- Refactored various components to accommodate the new runtime and improve overall code organization and maintainability.

This commit significantly enhances the application's webview capabilities and user interaction with messaging services, providing a more robust and flexible experience.

* feat(cef): add development command for CEF and update configuration

- Introduced a new development command `dev:cef` in both package.json files to streamline the development process for the Chromium Embedded Framework (CEF).
- Updated Cargo.toml to include the `tauri/devtools` feature alongside `tauri/cef`, enhancing debugging capabilities.
- Modified tauri.conf.json to adjust visibility settings for the application window and refined the Content Security Policy (CSP) for improved security.
- Enhanced resource paths in tauri.conf.json to support recursive file inclusion for better resource management.
- Updated the Rust code to bypass macOS Keychain prompts when using CEF, improving user experience during development.

This commit enhances the development workflow for CEF integration, providing better tools and configurations for developers.

* fix(cef): update development command for CEF to include signing identity

- Modified the `dev:cef` command in package.json to include the `APPLE_SIGNING_IDENTITY` environment variable, enhancing the development process for CEF on macOS.
- This change improves the build process by ensuring proper code signing during development, streamlining the workflow for developers working with CEF integration.

* feat(cef): enhance development command for CEF with safe storage setup

- Updated the `dev:cef` command in package.json to include a call to a new script, `setup-chromium-safe-storage.sh`, which pre-seeds the "Chromium Safe Storage" keychain entry with a permissive ACL.
- Added the `setup-chromium-safe-storage.sh` script to ensure that CEF/Chromium can read the keychain entry without prompting, improving the development experience on macOS.
- This change streamlines the setup process for developers working with CEF integration, ensuring a smoother workflow.

* feat(whatsapp): enhance message ingestion and IndexedDB integration

- Introduced a new `IngestMessage` interface to standardize message structure for WhatsApp.
- Updated `IngestPayload` to include additional fields for better message handling, including `provider`, `chatId`, and `day`.
- Implemented a new function `persistWhatsappChatDay` to handle the ingestion of chat messages by day, improving data organization and retrieval.
- Enhanced the WhatsApp recipe to utilize IndexedDB for direct data access, eliminating the need for DOM scraping and improving performance.
- Updated the Tauri configuration to enable development tools for easier debugging of webview accounts.

This commit significantly improves the application's ability to manage and ingest WhatsApp messages, providing a more robust and efficient user experience.

* feat(cdp): integrate IndexedDB scanner for WhatsApp via Chrome DevTools Protocol

- Added a new module for scanning IndexedDB using the Chrome DevTools Protocol (CDP), enabling direct access to WhatsApp data without DOM scraping.
- Implemented a scanner that communicates with the embedded CEF instance to read and decrypt messages stored in IndexedDB.
- Updated the Tauri application to manage the new scanner, ensuring it operates seamlessly with existing webview accounts.
- Enhanced the Cargo.toml and Cargo.lock files to include necessary dependencies such as `tokio-tungstenite` and `futures-util` for asynchronous operations.
- Refactored the WhatsApp recipe to utilize the new scanning capabilities, improving performance and data handling.

This commit significantly enhances the application's ability to interact with WhatsApp's IndexedDB, providing a more efficient and robust user experience.

* feat(cdp): enhance message diagnostics in IndexedDB scanner

- Updated the ScanSnapshot struct to include new fields for message diagnostics: `messageKeyUnion`, `messageTypeBreakdown`, and `sampleByType`, providing a comprehensive overview of message structures and types.
- Modified the scanner logic to capture and log detailed information about message types and their shapes, improving debugging capabilities.
- Refactored the JavaScript scanner to aggregate message key signatures and counts, enhancing the analysis of message records.

This commit significantly improves the application's ability to analyze and log message data from WhatsApp's IndexedDB, facilitating better debugging and data handling.

* feat(cdp): implement fast DOM scraping and crypto key extraction for WhatsApp

- Introduced a new fast-tick DOM scraping mechanism to extract rendered WhatsApp message bodies, enabling near real-time message updates without relying on IndexedDB.
- Added scripts for capturing and logging CryptoKey operations within WhatsApp's workers, allowing for better analysis of key derivations and decryptions.
- Enhanced the CDP scanner to interleave fast DOM scans with full IndexedDB scans, optimizing data retrieval and reducing UI spamming during idle periods.
- Updated the ScanSnapshot struct to include new fields for DOM-scraped messages and crypto operation statistics, improving the overall diagnostic capabilities of the application.

This commit significantly enhances the application's ability to interact with WhatsApp's messaging system, providing a more efficient and responsive user experience.

* feat(whatsapp): replace cdp_indexeddb with whatsapp_scanner for enhanced message handling

- Replaced the `cdp_indexeddb` module with `whatsapp_scanner` to streamline the scanning process for WhatsApp messages.
- Updated the application to manage the new `ScannerRegistry` for WhatsApp, improving the integration with the Chrome DevTools Protocol.
- Introduced new scripts for fast DOM scraping and full IndexedDB scanning, optimizing data retrieval and enhancing real-time message updates.
- Added a new `dom_scan.js` for efficient extraction of rendered message bodies directly from the DOM, reducing reliance on IndexedDB.
- Enhanced the `ScanSnapshot` struct to accommodate new fields for DOM-scraped messages, improving diagnostic capabilities.

This commit significantly improves the application's ability to interact with WhatsApp, providing a more efficient and responsive user experience.

* refactor(whatsapp): replace JavaScript DOM scanning with Rust-based DOM snapshot

- Removed the `dom_scan.js` script and replaced it with a new Rust module `dom_snapshot.rs` that captures DOM snapshots directly via the Chrome DevTools Protocol, enhancing performance and reliability.
- Introduced a new `idb.rs` module for scanning WhatsApp's IndexedDB, streamlining data retrieval and improving integration with the Rust backend.
- Updated the `ScanSnapshot` struct to accommodate changes in data handling, ensuring compatibility with the new scanning methods.
- Enhanced overall message handling capabilities, providing a more efficient and responsive user experience.

This commit significantly improves the application's ability to interact with WhatsApp, leveraging Rust for better performance and reducing reliance on JavaScript for DOM operations.

* feat(docs): add webview integration playbook for third-party messaging

- Introduced a comprehensive playbook detailing the process for integrating third-party webviews (e.g., Instagram, Messenger) into the application.
- Documented architecture, workflow, and best practices for building and debugging new integrations, leveraging Rust and Chrome DevTools Protocol.
- Included step-by-step instructions for setting up scanners, monitoring logs, and optimizing message handling, ensuring a streamlined development experience for future integrations.

This addition enhances the documentation, providing developers with a clear guide to implement and maintain webview integrations effectively.

* docs(webview): improve table formatting for clarity

- Enhanced the formatting of tables in the webview integration playbook to improve readability and consistency.
- Adjusted column headers and alignment for better presentation of job intervals and costs, ensuring clearer communication of scanning processes and common pitfalls.

This update aims to provide a more user-friendly documentation experience for developers integrating third-party webviews.

* feat(slack): integrate Slack scanner for message extraction and management

- Updated the OpenHuman package version to 0.52.15 in both Cargo.lock files.
- Introduced a new Slack scanner module to extract messages, users, and channels from Slack's IndexedDB using the Chrome DevTools Protocol.
- Added functionality to manage Slack accounts within the application, allowing for automatic opening of Slack webviews based on environment variables.
- Enhanced the existing webview account management to support Slack integration, ensuring seamless interaction with the Slack API.

This commit significantly improves the application's ability to interact with Slack, providing a robust framework for message handling and account management.

* fix(slack): one-doc-per-channel + omit CDP indexName param

CEF 146's IndexedDB.requestData rejects `indexName: ""` with "Could not
get index"; the CDP spec says empty string means the primary-key index
but this backend only accepts the field unset. Omit it entirely so the
Slack Redux-persist dump actually comes back.

Also switch memory grouping from (channel, day) → channel. Each Slack
channel is now one long-running memory doc keyed by channel name
(e.g. `general`, `team-product`, `elvin516`), falling back to channel
id for non-slug names. Every transcript line carries its own
`YYYY-MM-DD HH:MM` stamp and the header records the full date range.

`infer_team_id` updated to Slack's real DB naming pattern
`objectStore-<TEAM>-<USER>` (not `ReduxPersistIDB:` as initially
assumed).

* fix(onboarding): update navigation and test descriptions in OnboardingOverlay tests

- Changed the navigation path from '/conversations' to '/chat' in the OnboardingOverlay tests to reflect the updated routing logic.
- Updated test descriptions for clarity, ensuring they accurately describe the functionality being tested.

These changes enhance the accuracy and readability of the onboarding tests, aligning them with the current application flow.

* fix(conversations): add return statement to Conversations component

- Introduced a return statement in the Conversations component to ensure proper rendering of the sidebar or page variant.
- This change enhances the component's functionality by ensuring it returns the expected JSX structure.

These modifications improve the overall structure and behavior of the Conversations component.

* feat(accounts): add Discord integration and enhance AddAccountModal

- Introduced Discord as a new account provider, including its icon and service details.
- Updated the AddAccountModal to filter out already connected providers, improving user experience.
- Enhanced the UI to display a message when all providers are connected, ensuring clarity for users.
- Implemented context menu functionality for account management, allowing users to log out directly from the accounts list.

These changes expand the application's capabilities by integrating Discord and refining account management features.

* feat(discord): integrate Discord scanner for HTTP and WebSocket monitoring

- Added a new `discord_scanner` module to capture Discord API calls and WebSocket frames using the Chrome DevTools Protocol (CDP).
- Updated the `lib.rs` to manage the new Discord scanner alongside existing WhatsApp and Slack scanners.
- Enhanced the `webview_accounts` module to support Discord account management, including scanner registration and cleanup.

These changes expand the application's capabilities by enabling real-time monitoring of Discord interactions, enhancing user experience and functionality.

* feat(google-meet): integrate Google Meet as a new account provider

- Added Google Meet as a supported account provider, including its icon and service details.
- Updated the account management logic to handle Google Meet interactions, including recipe integration for call monitoring and notifications.
- Enhanced the UI to accommodate the new provider, ensuring a seamless user experience when managing accounts.

These changes expand the application's capabilities by integrating Google Meet, allowing users to join calls and receive notifications directly within the app.

* refactor(runtime): remove notification handling and composer autocomplete

- Eliminated the notification interception logic and associated functions, streamlining the runtime code.
- Removed composer autocomplete features, transferring responsibility for ghost-text overlays to the UI host.
- Updated comments to reflect the changes and clarify the remaining functionality.

These modifications simplify the runtime script, focusing on core features while delegating UI responsibilities.

* feat(google-meet): enhance Google Meet integration with lifecycle event handling

- Implemented lifecycle event handling for Google Meet, including events for call start, captions, and call end.
- Introduced in-memory storage for caption snapshots during meetings, allowing for the generation of markdown transcripts upon call completion.
- Added interfaces for payload structures related to Google Meet events, improving type safety and clarity in the codebase.
- Updated the webview account service to manage active meetings and flush transcripts to memory, ensuring a seamless user experience.

These changes significantly enhance the Google Meet integration, enabling real-time caption handling and transcript generation, thereby improving the overall functionality of the application.

* feat(cef): integrate CEF-based notification handling and update dependencies

- Added support for native OS notifications through the `tauri-runtime-cef` crate, enabling interception of browser notifications in embedded webviews.
- Introduced a new submodule for `tauri-cef` to manage CEF dependencies and facilitate notification handling.
- Updated the `.gitignore` to exclude CEF-related build artifacts and lock files.
- Removed the deprecated `notification_scanner` module, streamlining the codebase and focusing on the new CEF integration.
- Enhanced the `webview_accounts` module to register and manage CEF browser notifications, improving user experience with real-time alerts.

These changes significantly enhance the application's notification capabilities, leveraging CEF for a more integrated and responsive user experience.

* feat(cef): update CEF integration and dependency management

- Added `cef` and `tauri-runtime-cef` as dependencies to enhance CEF support.
- Updated `Cargo.toml` to reference `tauri-runtime-cef` from a local path, ensuring proper integration with the vendored CEF submodule.
- Removed direct Git references for Tauri packages, streamlining dependency management by using local paths.

These changes improve the application's CEF capabilities and simplify the dependency structure, facilitating better integration and maintenance.

* feat(browserscan): add BrowserScan as a new account provider with associated resources

- Introduced BrowserScan as a development-only account provider, including its icon and service details.
- Updated the account provider types and management logic to accommodate BrowserScan, enhancing the application's capabilities.
- Added a new recipe and manifest for BrowserScan, ensuring it integrates seamlessly into the existing webview account lifecycle.
- Enhanced the UI to display BrowserScan, providing users with a bot-detection sandbox for testing purposes.

These changes expand the application's functionality by integrating BrowserScan, allowing for improved testing and development workflows.

* feat(google-meet): enhance Google Meet integration with new transcript handling and session recovery

- Introduced a new service to handle Google Meet transcripts, enabling structured note extraction and proactive follow-up actions.
- Implemented session recovery logic to manage in-progress meetings when navigating away from the call.
- Updated the webview account service to log call events and captions, improving monitoring and debugging capabilities.
- Enhanced the Google Meet recipe to persist meeting state across navigations, ensuring seamless user experience.

These changes significantly improve the Google Meet integration, allowing for better management of meeting transcripts and user interactions.

* refactor(App): reorganize imports and clean up code structure

- Removed unused imports from App.tsx to streamline the code.
- Adjusted the import order for better readability and consistency.
- Enhanced the BottomTabBar component by simplifying the button rendering logic.
- Cleaned up the AddAccountModal component by consolidating prop destructuring.
- Improved formatting in various components for better code clarity.

These changes enhance code maintainability and readability across the application.

* update tauri

* feat(google-meet): improve caption handling and speaker identification logic

- Enhanced the logic for extracting speaker names from Google Meet rows, adding checks to filter out icon ligatures and irrelevant text.
- Updated the caption processing to better identify and score caption regions, ensuring more accurate transcript generation.
- Introduced new utility functions to differentiate between real captions and icon names, improving the overall reliability of the captioning feature.

These changes significantly enhance the accuracy and usability of the Google Meet integration, providing users with clearer and more relevant caption data.

* chore(dependencies): update Cargo.lock with new package versions and remove obsolete entries

- Bump OpenHuman version to 0.52.20.
- Add new dependencies: cef, futures-util, tauri-plugin-notification, tauri-runtime-cef, tokio-tungstenite, bzip2, clap, console, cookie_store, data-encoding, dioxus-debug-cell, document-features, download-cef, encode_unicode, filetime.
- Remove obsolete packages: alloc-no-stdlib, alloc-stdlib, brotli, brotli-decompressor, gdkx11, gdkx11-sys.
- Update existing dependencies to their latest versions where applicable.

* chore(dependencies): update submodule URLs and pin plugin versions

- Changed the tauri-cef submodule URL from SSH to HTTPS for consistency.
- Updated Cargo.toml to pin tauri plugins to a specific commit for reproducibility.
- Adjusted Cargo.lock to reflect the new plugin source format with pinned revisions.
- Modified the builder configuration in lib.rs to conditionally enable devtools in debug builds only, enhancing security in release builds.
- Updated webview_accounts to restrict devtools access based on build type, ensuring better control over webview inspection.

* feat(ui): enhance BottomTabBar and AddAccountModal interactions

- Added focus and blur event handlers to BottomTabBar for improved visibility management.
- Implemented keyboard accessibility in AddAccountModal by closing the modal on Escape key press and focusing the close button when opened.
- Updated Content Security Policy in tauri.conf.json for enhanced security.
- Improved Gmail recipe to use stable message IDs for better message tracking.
- Introduced account ID sanitization in webview_accounts to prevent path traversal vulnerabilities.

* fix(AddAccountModal): add missing import for improved functionality

* chore(dependencies): bump OpenHuman version to 0.52.20 in Cargo.lock
2026-04-17 15:55:50 -07:00
8d4934e634 feat(agent): progressive-disclosure handoff + token-based summarizer threshold (#574) (#586)
* feat(agent): summarizer sub-agent compresses oversized tool results

Issue #574.

Before this change, tool results larger than a few KB landed verbatim
in orchestrator history, burning context budget on raw JSON/HTML/file
dumps. The only guardrail was tool_result_budget_bytes which
hard-truncated mid-payload, dropping everything past the cut.

This PR introduces a dedicated `summarizer` sub-agent
(model.hint = "summarization") that the runtime automatically
dispatches whenever a tool result exceeds
summarizer_payload_threshold_bytes (default 100 KB). The summarizer
compresses the payload per an extraction contract that preserves
identifiers and key facts, and the compressed summary replaces the
raw payload before it enters agent history. Payloads above
summarizer_max_payload_bytes (default 5 MB) skip summarization and
fall through to the existing truncation path — paying for an LLM
call on a 5 MB blob is counterproductive.

Scoped to the orchestrator session only. Welcome, skills_agent,
researcher, planner, and every other typed sub-agent get None and
their tool results are untouched. Gated in
build_session_agent_inner by checking agent_id == "orchestrator".

Instrumented at both tool-loop paths:
  - run_tool_call_loop in tool_loop.rs (event-bus/channels path)
  - Agent::execute_tool_call in session/turn.rs (web channel path
    via run_single)

Both paths call into the same `PayloadSummarizer::maybe_summarize`
trait so the threshold check, circuit breaker (3 consecutive
failures disables for the session), and sub-agent dispatch policy
live in exactly one place (agent/harness/payload_summarizer.rs).

The summarizer sub-agent is runtime-dispatched only — it is NOT
exposed as a delegation tool to the orchestrator's LLM. It is listed
in the orchestrator's `subagents = [...]` for explicit registration,
but `collect_orchestrator_tools` filters out the `summarizer` id and
never synthesises a `delegate_summarizer` tool.

Files:
  * NEW: src/openhuman/agent/agents/summarizer/{agent.toml,prompt.md}
  * NEW: src/openhuman/agent/harness/payload_summarizer.rs (trait +
    SubagentPayloadSummarizer impl + circuit breaker + tests)
  * src/openhuman/agent/agents/mod.rs — register summarizer in
    BUILTINS
  * src/openhuman/agent/agents/orchestrator/agent.toml — list
    summarizer in subagents (runtime-only, no LLM delegation tool)
  * src/openhuman/agent/harness/mod.rs — declare module
  * src/openhuman/agent/harness/builtin_definitions.rs — expect
    summarizer in `expected_builtin_ids_are_present`
  * src/openhuman/agent/harness/tool_loop.rs — thread Option<&dyn
    PayloadSummarizer> into run_tool_call_loop + agent_turn,
    intercept at the tool-execution success site, plus a new
    integration test using a MockSummarizer
  * src/openhuman/agent/harness/tests.rs — thread None through the
    existing run_tool_call_loop callsites
  * src/openhuman/agent/harness/session/turn.rs — same interception
    in Agent::execute_tool_call
  * src/openhuman/agent/harness/session/types.rs — payload_summarizer
    field on Agent and AgentBuilder
  * src/openhuman/agent/harness/session/builder.rs —
    .payload_summarizer() setter + orchestrator-only construction in
    build_session_agent_inner
  * src/openhuman/agent/bus.rs — pass None for the bus path
  * src/openhuman/config/schema/context.rs —
    summarizer_payload_threshold_bytes + summarizer_max_payload_bytes
    on ContextConfig
  * src/openhuman/tools/orchestrator_tools.rs — filter out the
    summarizer id from delegation-tool synthesis

Tests: unit tests in payload_summarizer pin the pass-through rules
(below threshold, above max cap, breaker tripped) and the prompt
construction. Integration test in tool_loop::tests uses a
MockSummarizer to verify the interception wires through end-to-end.

Closes tinyhumansai/openhuman#574.

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

* feat(tools): csv_export tool + skills_agent oversized output handling

When a Composio tool returns a large payload inside skills_agent,
the agent now has two prompt-driven paths:

  Path A — user wants an answer derived from the data:
    skills_agent extracts the answer in its next iteration
    and returns a targeted response (no file I/O needed).

  Path B — user wants the actual raw dataset:
    skills_agent calls csv_export (tabular data) or file_write
    (non-tabular) to persist the output to workspace/exports/,
    then returns a summary + file path.

Changes:
  * NEW: src/openhuman/tools/impl/filesystem/csv_export.rs
    — CsvExportTool: parses JSON array, formats as CSV, writes
    to workspace/exports/{filename}. Handles missing keys
    (empty cells), nested values (JSON-serialised), and optional
    column ordering. Sandboxed via SecurityPolicy.
  * src/openhuman/tools/impl/filesystem/mod.rs — wire module
  * src/openhuman/tools/ops.rs — register CsvExportTool
  * src/openhuman/agent/harness/definition.rs — new extra_tools
    field on AgentDefinition, allowing named system tools to
    bypass category_filter
  * src/openhuman/agent/harness/subagent_runner.rs — inject
    extra_tools into allowed_indices after category filtering
  * src/openhuman/agent/agents/skills_agent/agent.toml
    — add file_write + csv_export via extra_tools
  * src/openhuman/agent/agents/skills_agent/prompt.md
    — new "Handling Oversized Tool Results" section with
    Path A (extract answer) vs Path B (export file) decision
    tree, intent-detection heuristics, and examples

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

* feat(agent): progressive-disclosure handoff for skills_agent + token-based summarizer threshold (#574)

Two layered fixes for #574 plus supporting changes.

## Summarizer thresholds in tokens, not bytes

Renamed `ContextConfig::summarizer_payload_threshold_bytes` ->
`summarizer_payload_threshold_tokens` (default 500 000, was 100 KB in
bytes) and `summarizer_max_payload_bytes` -> `summarizer_max_payload_tokens`
(default 2 000 000). Token count is estimated at ~4 chars/token via a
local helper that mirrors `tree_summarizer::types::estimate_tokens`.
Serde aliases on both fields keep existing config.toml files parsing.
`payload_summarizer.rs` now compares token estimates for the threshold
and cap, with both `tokens=` and `bytes=` surfaced in log events.

## Progressive-disclosure handoff for skills_agent

`skills_agent` typed subagents (when spawned with a Composio toolkit)
now receive a per-spawn `ResultHandoffCache` and a new built-in
`extract_from_result` tool. When a per-action tool returns more than
`HANDOFF_OVERSIZE_THRESHOLD_TOKENS` (20 000 tokens), the raw payload
is stashed in the cache and a compact placeholder replaces it in
history:

    [oversized tool output: 187432 bytes - stashed as result_id="res_1"]
    Preview (first 1500 chars):
    ...
    If the preview does not answer your task, call:
    extract_from_result(result_id="res_1", query="<specific question>")

The subagent can answer from the preview, call `extract_from_result`
with a targeted query, or re-call the original tool with tighter
filters. `extract_from_result` dispatches the `summarizer` subagent
against the cached payload with the query as the extraction contract.

For payloads over `SUMMARIZER_CHUNK_CHAR_BUDGET` (60 000 chars) the
extractor runs a chunked map-reduce:
- split at blank-line / newline boundaries
- map each chunk to a per-chunk partial via bounded concurrency
  (`buffer_unordered(3)`) to avoid storming the provider gateway
- reduce partials in one more summarizer turn, or fall back to the
  concatenation if the reduce stage fails

Falls back gracefully when the summarizer definition is missing from
the registry (placeholder + preview still work; just no extractor).

## Text-mode dispatcher for skills_agent + tighter tool filter

Provider-side grammar decoders (Fireworks etc.) cap tool-schema rules
at 65 535 (uint16_t). Large Composio toolkits - Gmail, Notion, GitHub,
Salesforce, HubSpot, Google Workspace - ship per-action JSON schemas
dense enough that even a handful of them exceed the cap.

- `subagent_runner::run_inner_loop` now detects `skills_agent` and
  omits `tools: [...]` from the API request, instead appending an
  `<tool_call>{...}</tool_call>` XML protocol block (with compact
  per-tool parameter summaries) into the system prompt. Tool calls
  are parsed out of the model's free-form response via the shared
  `parse_tool_calls` helper. Mirrors XmlToolDispatcher behaviour.
- `top_k_for_toolkit()` picks 12 for HEAVY_SCHEMA_TOOLKITS (the six
  listed above plus googledocs, googlesheets, microsoftteams) vs the
  default 25 for lighter toolkits.

## Skills_agent agent.toml / prompt changes

- Dropped `csv_export` from `skills_agent.extra_tools` (kept
  `file_write`) - the export tool was triggering superfluous file
  writes after extraction had already answered the query.
- `builtin_definitions::skills_agent_has_extra_tools_for_export` test
  inverted to assert `csv_export` is NOT present.
- `prompt.md` re-aligned: Path B now references only `file_write`.

## Wiring

- `session/builder.rs`: threshold rename wiring (`_tokens`).
- `subagent_runner.rs::run_inner_loop`: new `handoff_cache` parameter
  (threaded through both call sites; fork-mode passes `None`).

## Tests

All green:
- `payload_summarizer::tests`: 6/6 (thresholds in tokens)
- `tool_loop::tests`: 10/10 (MockSummarizer integration)
- `subagent_runner::tests`: 19/19
- `builtin_definitions::tests`: 5/5 (csv_export removal)
- `csv_export::tests`: 7/7 (implementation kept, wiring removed)

Closes #574.

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

* perf(agent): drop reduce LLM call and pre-clean tool outputs in chunked extraction

Two optimisations to the oversize-handoff / extract_from_result pipeline:

1. Concat chunk summaries in order; drop reduce stage.
   The reduce-stage summarizer call was the slowest single turn of the
   pipeline and a single point of failure when the upstream provider
   hung — a hung reduce burned minutes before timing out. Map summaries
   are now sorted by original chunk index and concatenated with a
   plain-separator join. For listing/extraction queries this is
   equivalent; for top-N / global-ordering queries the caller can
   post-process. Observed: 8m24s → ~70s on a Notion SEARCH run.

2. Generic cleaner before the oversize check.
   Strips <script>/<style>/<svg> blocks, HTML comments, data:...;base64,...
   inline URIs, remaining HTML tags, and collapses whitespace. Applied
   on every tool output so results that are mostly markup drop below
   the 20k-token threshold and skip the extract pipeline entirely; the
   ones that remain oversized get chunked on clean bytes. Debug log
   emits before/after bytes + saved_pct per call.

No changes to the extract_from_result tool surface or placeholder format.

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

* fix(chat): rearm 2-min silence timer on inference progress events

The client-side safety timer in Conversations.tsx was a flat 120s
deadline from the send, not a silence window. Long agent turns
(chained tool calls, chunked extraction fan-outs, subagent spawns)
would trip the timeout even though the backend was actively making
progress — showing "No response from the assistant after 2 minutes"
while the server was still working.

The effect now watches inferenceStatusByThread and rearms the timer
on every status change for the sending thread. Any tool_call /
tool_result / iteration_start / subagent_{spawned,done} event resets
the 120s window. When status is cleared (chat_done / chat_error),
the timer is dropped. A truly silent server still fails after 120s
as before.

Tracks the sending thread id in a ref (sendingThreadIdRef) so
switching threads mid-turn doesn't move the timer's reference point.

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 14:09:00 -07:00
github-actions[bot] 2d9f2f7aaa chore(release): v0.52.20 2026-04-17 20:05:37 +00:00
da5fe9260b fix(local_ai): hard-override to disabled until explicit opt-in (#573) (#637)
* refactor(local_ai): default to opt-in on all devices (#573)

Local AI now defaults to disabled whenever the user has not explicitly
picked a tier, regardless of device RAM. The onboarding flow and
Settings panel remain the only ways to turn it on. Previously the
bootstrap only disabled local AI on <8 GB devices and auto-applied a
recommended preset on larger hosts; this flip completes the MVP goal
of cloud-first defaults with a single, opt-in local model.

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

* style(local_ai): apply cargo fmt to bootstrap tests (#573)

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

* feat(onboarding): present cloud AI as default on sufficient-RAM path (#573)

Flips the LocalAIStep sufficient-RAM screen so the primary button is
"Continue with Cloud" and local AI appears as an explicit opt-in
("Use local AI instead"). This aligns onboarding with the new opt-in
bootstrap: every device now starts on cloud unless the user chooses
local AI. The low-RAM cloud-fallback screen is unchanged.

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

* test(onboarding): cover opt-in local AI semantics in LocalAIStep (#573)

Updates the sufficient-RAM path tests to match the cloud-primary UI:
the default "Continue with Cloud" click advances without triggering
local AI bootstrap, and the secondary "Use local AI instead" opt-in
still starts the recommended-preset bootstrap and propagates errors.
Low-RAM cloud-fallback tests are unchanged.

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

* feat(local_ai): add opt_in_confirmed marker to local AI config (#573)

Bootstrap will hard-override `enabled=false` unless this marker is true,
ensuring existing installs with a stale `selected_tier` from the pre-MVP
default-on era fall back to cloud until the user explicitly re-opts in.

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

* fix(local_ai): hard-override local AI to disabled until explicit opt-in (#573)

Every bootstrap path now returns `enabled=false` unless `opt_in_confirmed`
is true, regardless of device RAM or `selected_tier`. This closes the
regression where upgrading users with a persisted `selected_tier` bypassed
the onboarding opt-in and started local AI without consent.

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

* refactor(local_ai): set opt_in_confirmed on apply_preset and surface MVP tier only (#573)

`apply_preset` is the single source of truth for the opt-in marker: any
non-disabled tier flips it true, `disabled` clears it. The preset RPC now
returns `mvp_presets()` so the Settings UI exposes only the allowlisted
`ram_2_4gb` tier, matching the MVP scope already enforced on the
onboarding path.

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

* revert(local_ai): keep full preset catalog in presets RPC (#573)

Revert the `mvp_presets()` swap in `handle_local_ai_presets`. PR #588
already renders all 5 tier cards in Settings with non-MVP tiers shown
as "Coming soon" / non-selectable, and that roadmap visibility is the
intended UX. Returning only the MVP tier from the RPC hid the other 4
cards entirely and broke that signal.

The opt-in gate still holds: `apply_preset` remains the single writer
of `opt_in_confirmed`, the RPC guard continues to reject non-MVP
apply_preset calls, and the bootstrap hard-override still clamps
stale configs. This commit only rolls back the UI catalog surface.

Fixes failing `json_rpc_local_ai_device_profile_and_presets` integration
test which expects 5 presets.

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 13:03:34 -07:00
5082f3e741 feat(overlay): activate main window on orb click (#605) (#611)
* feat(tauri): add activate_main_window command for overlay (#605)

Exposes the existing show_main_window helper as a Tauri command so the
overlay webview can bring the main window to front. The command is
whitelisted in allow-core-process.toml so the overlay window capability
can invoke it.

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

* feat(overlay): activate main window on orb click (#605)

The overlay orb had no click behavior. Now clicking it in idle mode
invokes activate_main_window, bringing the main app window to the front
(mirrors the tray icon flow).

Since the overlay is an NSPanel NonactivatingPanel on macOS, React's
synthesized onClick does not fire. Instead we record the press position
on mousedown and emulate click on mouseup when the pointer stayed within
a 4px slop. Dragging is deferred to mousemove past the slop so startDragging
doesn't swallow the mouseup event.

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

* fix(window): propagate show_main_window errors instead of swallowing them (#605)

`show_main_window` silently logged failures and returned `()`, so the
`activate_main_window` Tauri command could report success on a no-op. Thread
`Result<(), String>` through so JS `invoke().catch()` sees real failures, and
preserve the previous log-on-error behavior at the tray/Reopen call sites
where no caller consumes the result.

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

* fix(overlay): stabilize orb click vs drag vs double-click (#605)

Two follow-ups to the deferred-drag pattern:

1. Drop stale pressRef when the primary button is no longer held during
   mousemove. Window-drag / focus changes can steal the mouseup, leaving
   the ref populated so the next idle hover would start a spurious drag.

2. Debounce the synthetic click by 250 ms so a follow-up dblclick can
   cancel it — the double-click-to-reset gesture was firing activate +
   reset together. Clear the timer on dblclick and on unmount.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 10:10:13 -07:00
Mega MindandGitHub 43d44acc1a fix: wire proactive welcome into conversations (#635) 2026-04-17 09:07:07 -07:00
github-actions[bot] 583a4d689c chore(release): v0.52.19 2026-04-17 04:03:11 +00:00
8ab2c6b540 fix(overlay): restore status bubble visibility during voice dictation (#604) (#614)
Reverts to CSS-transition-based visibility so the bubble wrapper
stays mounted in the DOM. The prior conditional mount (`status === 'active' && bubble`)
raced with the async Tauri window resize — the bubble component mounted
before the overlay webview had grown from 50x50 to 224x208, and
`overflow: hidden` on the webview clipped the bubble above the visible
area.

With the wrapper always mounted and toggled via `max-w-0 opacity-0` ↔
`max-w-[184px] opacity-100`, the typewriter status text ("Listening…",
"Transcribing…") reappears reliably when the hotkey is held.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-16 20:43:13 -07:00
f098cfda40 test(coverage): batches 13–18 — Rust unit tests for 40+ modules (#530) (#618)
* test(coverage): batch 13–14 — core/all registry, proxy_config tool (#530)

Add 36 new tests:
- core/all: registry integrity (no duplicates, schema-controller parity),
  rpc_method_name, namespace_description, validate_params, schema lookup
- proxy_config: parse_scope, parse_string_list (CSV, array, errors),
  parse_optional_string_update, env_snapshot, proxy_json, security gates

All 4096 tests pass.

* test(coverage): batch 15 — memory/store/unified/helpers pure functions (#530)

Add 31 new tests for helpers module:
- vec_to_bytes/bytes_to_vec roundtrip, cosine_similarity (identical,
  orthogonal, mismatched, zero), collapse_whitespace, normalize_search_text,
  tokenize_search_terms, normalize_graph_entity/predicate, json_string_array,
  merge_unique_string_arrays, json_i64 (int/float/missing/string),
  recency_score (current/old/future), chunk_document_content

All 4127 tests pass.

* test(coverage): batch 16 — terminal, supervision, security detect, trigger history (#530)

Add 27 new tests across 4 modules:
- accessibility/terminal: is_text_role, is_terminal_app, looks_like_terminal_buffer,
  extract_terminal_input_context, noise line detection
- channels/runtime/supervision: compute_max_in_flight_messages clamping
- security/detect: all sandbox backend fallback paths (landlock, firejail,
  bubblewrap, docker on non-linux), disabled-via-enabled-false
- composio/trigger_history: list_recent with limit, empty store, field validation

All 4154 tests pass.

* test(coverage): batch 17 — learning, update, encryption, doctor, service schemas + skills/types (#530)

Add 49 new tests across 6 modules:
- learning/schemas: catalog, schema validation, unknown fallback
- update/schemas: check/apply schemas, optional staging_dir, controller parity
- encryption/schemas: encrypt/decrypt schemas, read_required helper
- doctor/schemas: report/models schemas, read_optional helper (none/null/value/error)
- service/schemas: 8 lifecycle functions, restart optional params, daemon_host
- skills/types: ToolResult success/error/json/mixed, serde roundtrip, ToolContent

All 4203 tests pass.

* test(coverage): batch 18 — accessibility/keys key-state probes (#530)

Add tests for is_tab_key_down/is_escape_key_down (platform-safe),
macOS-specific constant validation.

All 4216 tests pass.

* test(coverage): batch 19 — service/restart, memory/store/factories (#530)

Add 7 new tests:
- service/restart: default source/reason, whitespace trimming, empty-string
  defaults, RestartStatus serde, startup delay noop
- memory/store/factories: effective_memory_backend_name, migration-disabled error

All 4223 tests pass.

* test(coverage): batch 20 — tree_summarizer schemas, subconscious schemas (#530)

Add 38 new tests across 2 modules:
- tree_summarizer/schemas: catalog parity, all 5 functions, param helpers
  (read_required, read_optional, read_optional_timestamp), type_name,
  namespace_input
- subconscious/schemas: catalog parity, all 10 functions, required input
  validation, field/field_req/field_opt helpers

All 4261 tests pass.

---------

Co-authored-by: Steven Enamakel <31011319+senamakel@users.noreply.github.com>
2026-04-16 20:42:50 -07:00
github-actions[bot] dced586a18 chore(release): v0.52.18 2026-04-16 19:46:22 +00:00
Steven EnamakelandGitHub 7db71408bd feat(local_ai): default to cloud fallback on <8GB RAM devices (#589)
* Enhance draft message handling in streaming edits

- Introduced a new `draft_sent` field in the `StreamingState` struct to track when a draft message has been posted, decoupling the existence of a draft from the ability to edit it.
- Updated the `flush_streaming_edit` function to set `draft_sent` upon posting a draft, ensuring that duplicate messages are not sent if the backend fails to return an ID.
- Modified the `finalize_channel_reply` function to prevent sending a fresh message if a draft was already posted without an ID, improving user experience by avoiding duplicate bubbles.

These changes enhance the robustness of message handling during streaming edits, ensuring a smoother interaction for users.

* feat(onboarding): enhance LocalAIStep for low-RAM device handling

- Added logic to determine if the device is below the RAM threshold, defaulting to a cloud AI fallback if necessary.
- Introduced a new UI for low-RAM devices, informing users about the cloud mode and providing options to continue with cloud AI or force-enable local AI.
- Updated the `ensureRecommendedLocalAiPresetIfNeeded` function to return a `recommend_disabled` flag based on device RAM.
- Enhanced tests to cover new cloud fallback UI and local AI consent handling.

These changes improve the onboarding experience by providing clearer options based on device capabilities.

* style: apply prettier formatting to LocalAIStep

* feat(local_ai): unlock model selection + add Disabled/cloud fallback option

- Remove MVP ceiling that clamped selection to the 2-4 GB tier, in bootstrap
  and in the apply_preset RPC — users can now pick any tier.
- Add special "disabled" tier string to apply_preset that toggles
  config.local_ai.enabled = false so the app uses the cloud summarizer.
- Presets RPC now returns local_ai_enabled so the UI can render the
  currently-active state correctly.
- Rewrite DeviceCapabilitySection: tiers are now clickable buttons that
  call apply_preset; adds a "Disabled — Cloud fallback" card at the top
  marked "Recommended" on low-RAM devices and "Active" when enabled=false.
- Remove the MVP message copy from the model tier panel.
- Remove unread-count badge from the bottom tab bar.

* refactor(onboarding): streamline LocalAIStep and update local AI preset handling

- Removed the `ensureRecommendedLocalAiPresetIfNeeded` function call from `LocalAIStep`, replacing it with `openhumanLocalAiPresets` to directly fetch preset information.
- Updated the logic in `ensureRecommendedLocalAiPresetIfNeeded` to ensure the recommended tier is applied correctly based on user consent, improving clarity in the local AI setup process.
- Enhanced tests to mock the new `openhumanLocalAiPresets` function, ensuring coverage for low-RAM device scenarios and local AI consent handling.
- Updated documentation in the `schemas.rs` file to reflect changes in the data structure returned by the presets RPC.

These changes improve the onboarding experience by providing a more direct and efficient method for managing local AI presets based on device capabilities.

* test(LocalAIStep): improve mock implementation for local AI presets

- Refactored the mock for `openhumanLocalAiPresets` to enhance readability and maintainability.
- Ensured the mock returns consistent device information and preset details for testing scenarios.
- This change supports better test coverage and clarity in the LocalAIStep component's behavior during onboarding.

* fix(local_ai): preserve hadSelectedTier semantics in bootstrap return

hadSelectedTier / selectedTier represent the incoming state ("was a tier
already selected before this call"), not the post-apply state. Setting
both to the just-applied tier broke the existing localAiBootstrap
contract and the unit test that encodes it.

The Rust-side persistence fix is independent: removing the
recommend_disabled short-circuit ensures openhumanLocalAiApplyPreset
actually writes the selected tier to disk on the opt-in path, so
config_with_recommended_tier_if_unselected() honors the user's choice.
2026-04-16 10:20:28 -07:00
923c920ad5 fix(tauri): hide main window on close instead of destroying it (#601) (#610)
* fix(tauri): hide main window on close instead of destroying it (#601)

On macOS, clicking the close button destroyed the main window. Since a
tray icon keeps the process alive, subsequent dock-icon clicks fired
RunEvent::Reopen but get_webview_window("main") returned None — the
window was gone. Now CloseRequested is intercepted: the close is
prevented and the window is hidden instead, so Reopen and tray clicks
can show it again.

Closes #601

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

* style(tauri): cargo fmt line wrap

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 10:18:46 -07:00
Steven EnamakelandGitHub 2bb20faa55 feat(threads): dedicated threads controller with per-thread session scoping (#590)
* feat(conversations): implement thread management features including creation and deletion

- Added functionality to create new conversation threads with unique IDs and titles based on the current date and time.
- Introduced a deleteThread action to remove existing threads, updating the selected thread accordingly.
- Enhanced the UI to display threads in a sidebar, allowing users to select and delete threads easily.
- Updated the Conversations component to handle thread loading and selection more efficiently, ensuring a smoother user experience.

Also updated the OpenHuman package version to 0.52.15 in Cargo.lock files.

* refactor(conversations): rename createThreadLocal to createNewThread and streamline thread creation logic

- Updated the function name from `createThreadLocal` to `createNewThread` for clarity and consistency.
- Simplified the thread creation process by removing the manual ID and title generation, leveraging the new API method for automatic thread creation.
- Adjusted the Conversations component to utilize the new `handleCreateNewThread` function, enhancing readability and maintainability.
- Removed unused thread ID and title generation functions to clean up the codebase.

This refactor improves the overall structure and clarity of the thread management functionality.

* refactor(memory): remove deprecated conversation thread management functions

- Eliminated unused functions related to listing, creating, updating, appending, and deleting conversation threads in memory operations.
- This cleanup enhances code maintainability and reduces complexity in the memory module.
- The refactor focuses on streamlining the conversation management logic, aligning with recent changes in the thread handling API.

* refactor(api): update thread API method names and remove deprecated functions

- Renamed thread-related API methods to align with the new naming convention, improving clarity and consistency.
- Removed deprecated functions related to thread creation, streamlining the API and enhancing maintainability.
- Adjusted the implementation of existing methods to reflect the updated API structure, ensuring proper functionality.

* refactor(thread): simplify thread state management and remove unused properties

- Streamlined the thread state by removing the lastViewedAt property and related logic, enhancing clarity in unread message counting.
- Updated the BottomTabBar component to reflect the new unread count logic, which now simply returns the length of threads.
- Removed the setLastViewed action from the Conversations component, further simplifying the thread management logic.
- Introduced a new deleteThread action to handle thread deletion, ensuring proper state updates and selection handling.
- Overall, these changes improve maintainability and reduce complexity in the thread management system.

* style(threads): apply cargo fmt

* refactor(tabbar): remove conversations unread badge

* update(Cargo.lock): bump OpenHuman package version to 0.52.15

* test(threadApi): update RPC method names to threads namespace

* refactor(conversations): update model ID for chat functionality

- Changed the model ID used in the chatSend function from `agentic-v1` to `reasoning-v1`, clarifying the purpose of each model.
- Added comments to explain the distinction between the reasoning model and the agentic model, enhancing code readability and maintainability.
2026-04-16 10:16:04 -07:00
YellowSnnowmannandGitHub ead0862d50 fix(onboarding): prevent home page flash after onboarding completion (#609)
* fix(onboarding): prevent home page flash after onboarding completion

Navigate to /conversations before persisting onboarding_completed so
the overlay stays rendered during the route transition. A local
isDismissing flag keeps the overlay visible until the flag is persisted
and the conversations screen is active, eliminating the brief home page
flash.

Closes #598

* fix(onboarding): enhance onboarding overlay with location tracking and improved dismissal logic
2026-04-16 10:14:04 -07:00
github-actions[bot] cf35f27cd6 chore(release): v0.52.17 2026-04-16 14:28:49 +00:00
YellowSnnowmannandGitHub e8639adae0 fix: Improve deep link authentication state management and improve logout (#608)
* feat(deepLink): implement deep link authentication state management

- Added a new module for managing deep link authentication state, including processing states and error handling.
- Integrated deep link authentication state management into the desktop deep link listener, enhancing the handling of authentication flows.
- Introduced functions to begin, complete, and fail deep link authentication processing, improving user feedback during the authentication process.

* refactor(settings): simplify logout process and enhance error handling

- Removed onboarding completion flag from the logout process to streamline functionality.
- Improved error handling during logout to provide user feedback if the logout fails.
- Updated comments to clarify the behavior of session clearing and routing after logout.
- Integrated deep link authentication state management into the settings component for better user experience.

* refactor(settings, deepLink): enhance logout and session management

- Simplified the logout process by removing unnecessary flags and improving error handling.
- Introduced a new function to manage signed-out state in the core state provider.
- Streamlined session token application in the deep link listener for better authentication flow.
- Updated comments for clarity on session clearing and routing behavior post-logout.

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

* refactor(format): format the code
2026-04-16 19:07:14 +05:30
github-actions[bot] fd213d40a2 chore(release): v0.52.16 2026-04-16 04:35:49 +00:00
c26ca795ca fix: keep chat processing alive across tab switches (#587)
* fix(chat): keep in-flight responses alive across tab switches

Made-with: Cursor

* chore: satisfy lint and format push gates

Made-with: Cursor

* fix: address CodeRabbit review on chat runtime PR

Made-with: Cursor

* feat(chat): add explicit inference turn lifecycle in chat runtime slice

Made-with: Cursor

* feat(chat): implement thinking summary feature in chat responses

Added a new mechanism to accumulate and send model reasoning text as a separate message during chat interactions. This includes handling "thinking_delta" events to gather reasoning content, formatting it for clarity, and ensuring it is sent before the main response. Updated the StreamingState struct to include a thinking accumulator for this purpose. This enhancement improves user experience by providing insight into the model's reasoning process.

* feat(telegram): update bot username handling for staging and production environments

Refactored the Telegram bot username resolution logic to differentiate between staging and production environments. Introduced constants for default usernames based on the application environment and updated the GitHub Actions workflow to set the appropriate environment variables. This change enhances the flexibility and clarity of bot username management in the application.

* fix: resolve CodeRabbit review issues on feat/thinking-telegram-summary

- bus.rs: fix UTF-8 char boundary panic in format_thinking_summary truncation
- threadSlice.ts: remove premature activeThreadId clear from addInferenceResponse.rejected
- Conversations.tsx: add composerBlocked global lock, clear tool timeline in safety timeout
- ChatRuntimeProvider.tsx: replace stale toolTimelineRef/inferenceStatusRef reads with live store.getState() calls in all event handlers
- LocalAIDownloadSnackbar.tsx: reset dismissed/collapsed on not-downloading → downloading transition edge
- MemoryGraphMap.tsx: derive activeSelectedNode to guard stale selectedNode after relations refresh; add debug logs to useMemo graph recompute

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

* fix: use render-phase update for download dismiss reset in LocalAIDownloadSnackbar

Replace effect-based setState with the React render-phase update pattern so
the not-downloading → downloading transition resets dismissed/collapsed without
triggering the react-hooks/set-state-in-effect lint warning.

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

* chore: apply prettier and cargo fmt auto-formatting

Formatting changes applied by the pre-push hook during the previous commit.

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

* refactor: replace endInferenceTurn with clearRuntimeForThread in Conversations component

Updated the Conversations component to replace the endInferenceTurn dispatch with clearRuntimeForThread. This change simplifies the handling of thread runtime state during error scenarios and timeout conditions, ensuring a cleaner state management approach.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 06:27:48 +05:30
d4f5b9a357 fix(overlay): fullscreen visibility, voice server reliability, and resize (#528) (#585)
* fix(overlay): shrink initial overlay window to match idle orb dimensions (#528)

The Tauri overlay window was 248×228 px while the idle orb renders at
50×50. The excess transparent area wasted compositing resources and
created an invisible click-absorbing region. Reduce to 60×60 to tightly
frame the idle orb with minimal padding.

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

* feat(overlay): add native drag support with position persistence (#528)

- Mouse-down on the orb initiates Tauri startDragging() for native
  window drag
- Dragged position is saved to localStorage and survives mode changes
  (idle ↔ active) so the orb stays where the user placed it
- Double-click resets to the default bottom-right corner
- Cursor changes to grab/grabbing for affordance
- Skip default repositioning when a saved position exists

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

* fix(overlay): reclass NSWindow to NSPanel for fullscreen visibility (#528)

macOS fullscreen apps run in separate Spaces where standard NSWindow
cannot follow. Use object_setClass() to reclass the Tauri overlay
window from NSWindow to NSPanel at runtime, then configure it with
NonactivatingPanel style mask and Transient collection behavior —
matching the working Swift accessibility helper pattern.

Key configuration that makes this work:
- object_setClass(NSWindow → NSPanel) — in-place reclass, no reparenting
- NSWindowStyleMask::NonactivatingPanel — critical for panel behavior
- NSWindowCollectionBehavior::Transient (not Stationary) — follows Spaces
- Window level 25 (NSStatusWindowLevel) — floats above fullscreen apps
- setFloatingPanel(true), setHidesOnDeactivate(false)

Previous approaches that failed:
1. CGShieldingWindowLevel + CanJoinAllSpaces — hidden (NSWindow limitation)
2. Window level i32::MAX-17 + Stationary — hidden (Space membership issue)
3. CGS private API CGSSetWindowTags sticky bit — blocked on Sonoma
4. object_setClass WITHOUT NonactivatingPanel mask — hidden
5. Create new NSPanel + reparent webview — CRASH (Tao delegate panic)

Also removes unused objc2-core-graphics and objc2-foundation deps.

Ref: https://github.com/tauri-apps/tauri/issues/11488

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

* fix(sidecar): make dev signing non-fatal in stage script

codesign failures no longer call process.exit(), preventing
yarn tauri dev from hanging when the dev signing identity is
missing or the keychain rejects the request.

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

* fix(voice): prevent race condition and fix restart after stop

- Atomically transition Stopped → Idle at start of run() to prevent
  duplicate run() calls during slow globe listener compilation
- Wrap CancellationToken in Mutex so run() creates a fresh token on
  each start — a cancelled token cannot be reused after stop()
- Reset state to Stopped if hotkey listener fails to start

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

* fix(voice): capture server errors from spawned run() task

Store errors from the background server.run() task via
set_last_error() so they surface in voice_server_status RPC
responses instead of being silently lost.

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

* fix(overlay): enable programmatic resize and shrink idle dimensions

- Change overlay window from 60x60 to 50x50 to match idle orb size
- Remove minWidth/minHeight constraints that blocked dynamic resize
- Set resizable: true so setSize() calls work for bubble expansion

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

* fix(overlay): simplify window resize and bubble rendering

- Clear min/max constraints before resizing to avoid clamping
- Replace CSS transition-based bubble visibility with conditional
  mount for more reliable rendering when mode changes

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

* chore: fix fmt and remove unused bubbles variable

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

* fix(voice): enforce lock ordering to prevent race between run() and stop()

Acquire cancel lock before state lock in run() — same order as stop() —
so stop() cannot cancel a stale token between setting Idle and swapping.

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

* fix(overlay): restore saved position on resize and format with prettier

Parse and apply saved drag coordinates instead of just using their
presence as a sentinel. Also reformats for prettier compliance.

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

* fix(sidecar): fail-fast on dev signing failure in CI environments

Add CI detection so signing failures abort the build in CI but remain
non-fatal for local development.

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

* chore: fix cargo fmt on Tauri shell import

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 04:52:14 +05:30
f014058417 feat(local_ai): MVP model lockdown — lock selection to 2-4 GB tier (#573) (#588)
* feat(local_ai): add MVP tier ceiling and cap model recommendation (#573)

Introduce MVP_MAX_TIER constant (Ram2To4Gb), is_mvp_allowed() gate,
mvp_presets() filter, and cap recommend_tier() so auto-provisioning
never selects a model above the MVP ceiling regardless of device RAM.

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

* feat(local_ai): enforce MVP model allowlists on resolved IDs (#573)

Add per-category allowlists (chat, vision, embedding) so that
effective_*_model_id() silently redirects any non-MVP model to the
default. Prevents config-file edits from bypassing the 2-4 GB tier
restriction.

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

* feat(local_ai): reject non-MVP tiers in RPC and clamp at bootstrap (#573)

apply_preset handler now returns an error for tiers above the MVP
ceiling. Bootstrap clamps any existing out-of-range tier selection
down to the recommended (capped) preset on startup.

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

* feat(ui): lock model tier selection and show full roadmap (#573)

Replace clickable tier buttons with static cards. Active tier shows
"Active" badge; locked tiers show "Coming soon" with reduced opacity.
Add MVP info banner. Fix download size to 1 decimal place.

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

* fix(local_ai): resolve CI failures — fmt, unused props, dead code (#573)

Apply cargo fmt to single-element array constants. Remove unused
isApplyingPreset/onApplyPreset props and applyPreset function from
the settings panel since tier switching is disabled for MVP.

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

* style: apply Prettier formatting to settings panels (#573)

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 04:50:28 +05:30
github-actions[bot] 098206cea7 chore(release): v0.52.15 2026-04-15 20:45:19 +00:00
github-actions[bot] a2aee3a1f1 chore(release): v0.52.14 2026-04-15 19:42:53 +00:00
YellowSnnowmannandGitHub cca6c08ab0 Fix: discord (#580)
* feat(discord): implement managed link functionality and enhance DiscordConfig component

- Added support for managed Discord linking, including new API methods for initiating and checking link status.
- Enhanced the DiscordConfig component to manage link tokens and implement polling for link completion.
- Introduced new state management for link tokens and improved error handling during connection processes.
- Updated the definitions to include a new auth action for managed links, streamlining the onboarding experience for users.
- Added tests for the new Discord link functionality to ensure robust integration and error handling.

This commit significantly improves the user experience for connecting Discord accounts, providing clearer feedback and handling for managed links.

* feat(discord): implement managed link functionality and enhance DiscordConfig component

- Added support for managed Discord linking, including new API methods for initiating and checking link status.
- Enhanced the DiscordConfig component to manage link tokens and implement polling for link status, improving user experience during the linking process.
- Introduced new state management for link tokens and error handling, ensuring robust interaction with the Discord API.
- Updated the channel definitions to include a new auth action for managed links, streamlining the integration process.
- Added tests for the new API methods and updated existing tests to cover the new functionality.

This commit significantly improves the integration with Discord, allowing users to link their accounts more effectively and providing better feedback during the linking process.

* chore(release): update OpenHuman version to 0.52.9 in Cargo.lock

- Bumped the version of the OpenHuman package from 0.52.7 to 0.52.9 in both Cargo.lock files for the main application and the Tauri app.
- This update ensures that the latest features and fixes from the OpenHuman package are included in the project.

* fix(tests): update DiscordConfig test to reflect new Connect button count

- Adjusted the test for the DiscordConfig component to expect three Connect buttons instead of two, aligning with recent changes in the component's authentication modes.
- This update ensures that the test accurately reflects the current functionality and improves test reliability.

* refactor(discord): modularize channel permission checks and enhance logging

- Extracted the `check_channel_permissions_at_base` function to modularize the permission checking logic for better readability and maintainability.
- Updated the API calls to use a dynamic base URL instead of a hardcoded one, improving flexibility.
- Enhanced logging for non-success responses from Discord API calls, providing more context for debugging.
- Minor adjustment in the hallucination check logic to improve clarity in variable usage.

* fix(logging): enhance error handling in DiscordConfig and SocketProvider

- Updated error handling in DiscordConfig to log specific errors when link checks fail, improving debugging capabilities.
- Enhanced SocketProvider to log non-fatal RPC connection failures, providing clearer context for potential issues with the sidecar or backend connectivity.

* feat(discord): add validation functions for Discord link start and complete responses

- Introduced `expectDiscordLinkStart` and `expectDiscordLinkComplete` functions to validate the structure of responses from Discord link API calls.
- Updated `channelConnectionsApi` methods to utilize these new validation functions, improving error handling and response consistency.
- Added tests to ensure proper unwrapping and validation of Discord link responses, enhancing overall reliability of the API integration.

* fix(channelConnections): improve handling of lastError and capabilities in touchConnection function

- Updated the touchConnection function to conditionally assign lastError and capabilities based on their presence in the patch object, ensuring more accurate state management.
- This change enhances the reliability of connection updates by preventing unintended overwrites of existing values.

* test(channelConnections): add test to clear lastError when explicitly set to undefined

- Introduced a new test case to verify that the lastError state is cleared when an explicit patch sets it to undefined. This enhances the reliability of the state management in the channelConnectionsSlice reducer.

* test(tests): add tests for upstream_unhealthy detection and failure reason precedence

- Introduced multiple test cases to verify the detection of upstream unavailability and service unavailability errors.
- Ensured that the `failure_reason` function correctly prioritizes upstream_unhealthy over other error states, enhancing the reliability of error handling in the system.

* feat(discord): add OAuth success handling in DiscordConfig component

- Implemented a new useEffect to handle successful OAuth events for Discord, updating the channel connection status and capabilities accordingly.
- This enhancement improves the integration with Discord by ensuring that the application responds correctly to OAuth success events, providing a better user experience.

* feat(deepLink): enhance OAuth deep link handling to include skillId

- Updated the deep link handling logic to also retrieve the skillId from the URL parameters, improving flexibility in OAuth success scenarios.
- Added a new simulation example for skillId in the setupDesktopDeepLinkListener function to aid in testing and development.

* refactor(format): ran format

* fix(discord): update permissions mock and improve message dispatch test

- Revised the permissions mock to include additional endpoints for better accuracy in testing Discord API interactions.
- Adjusted the message dispatch test to utilize a deterministic stub for the agent's response, ensuring consistent timing and behavior during tests.
- Reduced the delay in the SlowProvider to enhance test performance while maintaining robustness.

* chore(dependencies): update OpenHuman package version to 0.52.13 in Cargo.lock
2026-04-15 22:59:28 +05:30
d545c193b9 feat(agent): fuzzy-filter skills_agent toolkit actions by task prompt (#579)
* feat(agent): fuzzy-filter skills_agent toolkit actions by task prompt

Narrow large Composio toolkits (e.g. github ~500 actions) down to the
handful relevant to a given delegation prompt before registering them
as native tools on a spawned skills_agent. Falls back to the full
catalogue when the filter yields fewer than MIN_CONFIDENT_HITS hits to
avoid starving the sub-agent on under-specified prompts.

Filter is only invoked when both `definition.id == "skills_agent"` and
a `toolkit=` argument is present, so orchestrator and other sub-agents
are unaffected.

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

* test(composio): mock toolkits route in ops integration test

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 21:06:59 +05:30
github-actions[bot] d575cf2cca chore(release): v0.52.13 2026-04-15 14:33:51 +00:00
github-actions[bot] 70a2a6fcc3 chore(release): v0.52.12 2026-04-15 06:30:33 +00:00
github-actions[bot] f179d2d3f9 chore(release): v0.52.11 2026-04-15 04:35:59 +00:00
github-actions[bot] fc103bf89f chore(release): v0.52.10 2026-04-15 03:51:46 +00:00
CodeGhost21andGitHub 13ce2cdcbf test(coverage): raise Rust unit test coverage to ≥80% on 10 critical modules (issue #530) (#567)
* test(coverage): raise 9 critical modules to ≥80% line coverage

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* test(coverage): push all 4 remaining modules

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

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

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

* test(coverage): more local_ai + voice gains

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

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

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

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

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

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

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

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

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

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

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

Miscellaneous:
- voice/server: OnceCell-backed comment (was OnceLock); drop duplicate
  initial-status test; supply the HallucinationMode argument to two
  stale hallucination tests so the crate type-checks
2026-04-14 12:52:59 -07:00
Cyrus GrayandGitHub 21e4a8b307 fix(onboarding): remove Screen & Accessibility Permissions step (#557)
* fix(onboarding): remove Screen & Accessibility Permissions step

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

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

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

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

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

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

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

* fix(onboarding): address CodeRabbit review feedback

- Preserve accessibilityPermissionGranted from existing state instead
  of hardcoding false (matches ToolsPanel defensive pattern)
- Update E2E test step comments and detection logic to match the real
  onboarding flow (WelcomeStep → ReferralApplyStep → SkillsStep →
  ContextGatheringStep) and use actual UI text
2026-04-14 13:44:02 +05:30
github-actions[bot] d5be45d42d chore(release): v0.52.9 2026-04-14 07:12:04 +00:00
github-actions[bot] 95ccf86069 chore(release): v0.52.8 2026-04-14 06:01:16 +00:00
Steven EnamakelandGitHub 2824850708 feat(streaming): thinking tokens, tool call deltas, and progressive channel edits (#549)
* feat(conversations): implement live streaming for assistant responses

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

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

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

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

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

New rest.rs helper: BackendOAuthClient::send_channel_edit.

* style: cargo fmt on streaming-related files

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

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

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

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

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

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

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

Unblocks the json_rpc_protocol_auth_and_agent_hello E2E test.

* Enhance event handling for progressive-edit streaming in ChannelInboundSubscriber

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

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

* Enhance tool call tracking in AgentProgress and parsing logic

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

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

* Enhance tool call tracking and event handling in Conversations component

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

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

* Enhance tool call event handling and progress reporting in Agent

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

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

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

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

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

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

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

* feat: update environment configuration and enhance settings UI

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

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

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

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

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

* feat(rewards): introduce ReferralRewardsSection and RewardsRedeemTab components

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

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

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

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

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

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

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

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

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

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

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

* refactor(billing): streamline BillingPanel and BillingPlansTab components

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* style: apply formatter fixes from pre-push hook

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

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

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

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

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

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

* feat(release): configure staging environment for deployment

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

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

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

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

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

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

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

- Streamlined the `handle_referral_claim` function by removing unnecessary `as_deref()` and `filter()` calls, enhancing code clarity and performance.
- Updated the JSON response construction to eliminate redundant line breaks, improving readability without altering functionality.
2026-04-13 14:58:58 -07:00