Commit Graph
1188 Commits
Author SHA1 Message Date
github-actions[bot] 5bc799ffeb chore(release): v0.52.27 v0.52.27 2026-04-21 14:57:32 +00:00
Steven Enamakelandgitbook-bot 8233458990 GITBOOK-37: No subject 2026-04-21 14:14:15 +00:00
a29056fa6f feat(webview): browser-like permission management for embedded apps (#713) (#721)
* chore(cef): bump submodule to include permission handler (#713)

Picks up permission handler from tauri-cef feat/713-webview-permissions:
  c17221ea8 feat(cef): add permissions helper module with unit tests
  c7213ceb4 feat(cef): allow desktop-capture + deny-by-default prompts

Enables mic / camera / screen-share / notifications / clipboard /
persistent-storage prompts in embedded webviews (Slack, Discord, Meet,
WhatsApp Web).

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

* feat(cef): enable SharedArrayBuffer for embedded app huddles (#713)

Slack Huddles, Meet, and Discord voice rely on SharedArrayBuffer-backed
WebRTC audio worklets / Opus encoders. Chromium gates SharedArrayBuffer
behind cross-origin isolation (COOP/COEP) by default, and embedded apps
don't send those headers, so the feature silently disappears — huddle
and call buttons become unresponsive because init aborts before any
getUserMedia / permission-handler path is reached.

Passing --enable-features=SharedArrayBuffer to CEF's command line makes
the constructor available again in top-level secure contexts, matching
the default behaviour of desktop Chrome. Verified in DevTools console
on app.slack.com: typeof SharedArrayBuffer === "function" after the
flag, "undefined" before.

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

* feat(macos): add NSCameraUsageDescription for embedded webview calls (#713)

macOS TCC rejects any camera access request from an app bundle that
doesn't declare a purpose string in Info.plist. Without this key the
OS silently denies getUserMedia({video:true}) before the user ever
sees a prompt, which breaks video calls in every embedded app (Google
Meet, Discord, Slack huddles).

Paired with NSMicrophoneUsageDescription so mic + camera are both
covered for the CEF permission handler landing in the companion
submodule bump.

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

* feat(macos): grant camera entitlement for embedded video calls (#713)

The Hardened Runtime entitlement com.apple.security.device.camera is
required for the signed app bundle to receive the macOS TCC camera
prompt. Without it, getUserMedia({video:true}) inside embedded
webviews (Google Meet, Discord, Slack huddles) is refused at the OS
layer regardless of the CEF permission handler decision.

Mirrors the existing audio-input entitlement so mic + camera both
work end-to-end once the CEF handler permits the request.

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

* chore(deps): sync Cargo.lock with v0.52.26 release bump

Cargo.toml versions bumped to 0.52.26 in prior release commits but the
lockfiles still recorded 0.52.24. Regenerated via cargo check — no
dependency graph changes.

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

* chore(vendor): bump tauri-cef to include loopback/local-network perms (#713)

Bumps the tauri-cef submodule to e2471bb80 on feat/cef, which adds
CEF_PERMISSION_TYPE_LOOPBACK_NETWORK / LOCAL_NETWORK / LOCAL_NETWORK_ACCESS
to the auto-accepted prompt mask. Required so embedded WebRTC call flows
(Slack Huddles, Meet, Discord voice) don't stall during STUN/TURN local
candidate gathering.

Upstream PR: tinyhumansai/tauri-cef#6

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

* feat(permissions): clarify mic/camera Info.plist usage for huddles (#713)

Previous NSMicrophoneUsageDescription only mentioned voice dictation
and NSCameraUsageDescription mentioned video calls but not huddles
explicitly. Updates both strings to name the huddle/call flows in
embedded apps (Slack, Meet, Discord) that drive the macOS TCC prompt,
so the first-launch dialog is accurate about why the permission is
being requested.

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

* feat(webview): route Slack huddle popups in-app (#722)

Slack Huddles use openManagedChildWindow, which calls
window.open("about:blank", …) and then programmatically navigates the
returned popup to the huddle UI. The previous deny-all policy on
on_new_window meant window.open returned null, and Slack's caller
aborts the huddle flow with a beacon/error when the handle is falsey.

Adds popup_should_stay_in_app() with a narrow per-provider allowlist:
- Slack: about:blank + app.slack.com / *.slack.com hosts
- All other providers / URLs: existing deny-and-hand-to-system-browser
  behavior is preserved

Popups matching the allowlist return NewWindowResponse::Allow so CEF's
default handling spawns an in-app child window with a real handle.

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 18:52:00 +05:30
CodeGhost21andGitHub 63bc463c26 fix(windows): hide conhost window spawned with core sidecar (#731)
The core binary is a console-subsystem .exe so `openhuman core run`
works correctly in a terminal. When the GUI shell (which is built with
`windows_subsystem = "windows"`) spawns it as a child without the
`CREATE_NO_WINDOW` creation flag, Windows allocates a fresh conhost
window that pops up on top of the app.

Apply `CREATE_NO_WINDOW` (0x08000000) at every site where the GUI
launches a core subprocess:

- `core_process.rs`: both sidecar spawn paths (`CoreRunMode::InProcess`
  fallback and `CoreRunMode::ChildProcess`).
- `lib.rs`: the short-lived `run_core_cli` used by `service_*_direct`
  commands.

Non-Windows builds get a no-op helper, so the cross-platform call sites
stay identical. Stdout/stderr piping for log forwarding is unaffected.
2026-04-21 16:16:00 +05:30
Mega MindandGitHub 1792135aea fix(settings): tool capability toggles now persist and are enforced at runtime (#720)
* chore: update OpenHuman version to 0.52.26 and refine tool preference handling

- Bumped the OpenHuman package version to 0.52.26 in Cargo.lock files.
- Enhanced the ToolsPanel component to include user feedback on save status.
- Implemented filtering of tools based on user preferences in the Rust backend, allowing for more customizable tool availability.
- Added new utility functions to map UI tool IDs to Rust tool names for better integration.

These changes improve user experience and maintain compatibility with the latest features.

* style: apply cargo fmt to user_filter.rs
2026-04-20 13:50:02 -07:00
Mega MindandGitHub 6dc007850f fix(chat): increase agent silence timeout from 2 to 10 minutes (#719)
The frontend silence timer was cutting off long-running agent tasks after
120s of no inference progress signals. Increased to 600s so extended
thinking and multi-step tasks can complete without being force-aborted.
Manual cancel remains the primary stop mechanism.

Closes #715
2026-04-20 17:25:57 +05:30
Steven Enamakelandgitbook-bot 72313353ce GITBOOK-36: No subject 2026-04-20 10:05:37 +00:00
Steven Enamakelandgitbook-bot 8d5cdbef8a GITBOOK-35: Updated content according to the app 2026-04-20 10:03:02 +00:00
Steven Enamakelandgitbook-bot 3331ff2202 GitBook: No commit message 2026-04-20 10:02:44 +00:00
github-actions[bot] a04a7edb75 chore(release): v0.52.26 v0.52.26 2026-04-18 17:37:27 +00:00
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 v0.52.25 2026-04-18 16:47:15 +00:00
Steven Enamakel 3131b3829d feat(release): enhance macOS artifact upload and signing process
- Updated the release workflow to include signing of macOS .app tarballs with the Tauri updater key, ensuring integrity for installed clients.
- Modified the upload script to handle the signing process and added error handling for missing signing keys.
- Removed Linux x86_64 asset handling from the updater manifest to streamline the release process.

These changes improve the security and reliability of macOS artifact uploads in the release workflow.
2026-04-18 09:46:45 -07:00
github-actions[bot] 28354bb33c chore(release): v0.52.24 2026-04-18 13:40:16 +00:00
Steven Enamakel a23f2373fd chore(release): comment out Ubuntu platform configuration in release workflow
- Commented out the Ubuntu 22.04 platform configuration in the release.yml file to streamline the workflow and focus on active platforms.
- This change helps maintain clarity in the release process by reducing clutter from unused configurations.
2026-04-18 06:25:51 -07: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
Steven Enamakel 420adc2326 feat: enhance Tauri CLI caching and installation process
- Updated the release workflow to include caching for the vendored `tauri-cli` binary and its installation metadata, improving build efficiency across platforms.
- Modified the `ensure-tauri-cli.sh` script to restore the cached binary if available, reducing installation time and ensuring the correct version is used.
- Changed the build script to utilize `cargo tauri build` instead of `npx tauri build`, aligning with the new CLI setup for better integration with the CEF-aware environment.

These changes streamline the development workflow and enhance the reliability of the Tauri setup.
2026-04-18 06:00:27 -07:00
github-actions[bot] 5719379798 chore(release): v0.52.22 2026-04-18 08:59:52 +00:00
Steven Enamakel 28d2fd822d Merge remote-tracking branch 'refs/remotes/upstream/main' 2026-04-18 01:32:47 -07:00
Steven Enamakel be7576c17e feat(release): re-enable Ubuntu and Windows platform configurations in release workflow
- Added back the previously commented-out configurations for Ubuntu 22.04 and Windows in the release.yml file, allowing builds for these platforms to be included in the release process.
- Updated the arguments, targets, and artifact suffixes for both platforms to ensure proper handling during the release workflow.

These changes enhance the cross-platform support in the release process, ensuring that builds for Ubuntu and Windows are correctly generated and published.
2026-04-18 01:31:42 -07: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 Enamakel 480ba9f746 chore(release): update release workflow to improve readability and organization
- Commented out unused platform configurations for Ubuntu and Windows in the release.yml file to streamline the workflow.
- Reformatted the `needs` section in the `Publish draft release` and `Remove release and tag if build failed` jobs for better clarity and consistency.

These changes enhance the maintainability of the release workflow by improving its structure and readability.
2026-04-17 21:23:17 -07:00
Steven EnamakelandGitHub e5f571cec7 feat(tokenjuice): Rust port of terminal-output compaction engine (#644)
* feat(tokenjuice): implement core functionality for terminal-output compaction engine

- Introduced the `tokenjuice` module, which includes the classification and reduction of tool outputs based on JSON-configured rules.
- Added new dependencies for Unicode handling: `unicode-segmentation` and `unicode-width`.
- Implemented the `classify` module to match tool execution inputs against predefined rules, enhancing the ability to process and summarize terminal outputs.
- Created a comprehensive set of types and utilities for managing tool execution inputs and classification results.
- Established a built-in rule set for common tools, improving the initial setup and usability of the `tokenjuice` engine.
- Enhanced testing framework with integration tests to ensure the accuracy of output compaction and classification.

These changes lay the groundwork for a robust terminal-output management system, facilitating better interaction with various tools and improving overall user experience.

* feat(tokenjuice): implement tokenjuice module for terminal output compaction

- Introduced the `tokenjuice` module, which includes functionality for classifying and reducing terminal output based on JSON-configured rules.
- Added new dependencies: `unicode-segmentation` and `unicode-width` to support text processing.
- Created a new `classify.rs` file for rule classification logic, including matching helpers and scoring functions.
- Implemented a `reduce.rs` file to handle the main reduction pipeline and text normalization.
- Established a structured approach for loading and compiling rules from multiple sources, including built-in and user-defined rules.
- Added integration tests to ensure the correctness of the output reduction process.

These changes enhance the application's ability to manage and compact verbose tool outputs, improving overall efficiency and user experience.

* test(tokenjuice): enhance test coverage for classification and reduction logic

- Added a series of unit tests to `classify.rs` to validate the behavior of tool name filters and argument matching, ensuring correct classification of tool executions.
- Introduced tests for edge cases in `reduce.rs`, including command tokenization and normalization of execution inputs, to improve robustness against various input formats.
- Expanded tests in `builtin.rs` to cover duplicate ID reporting and compile issues, enhancing error handling and reporting mechanisms.
- Implemented additional tests in `compiler.rs` to verify regex handling in rule definitions, ensuring invalid patterns are correctly ignored.

These enhancements improve the overall test coverage and reliability of the tokenjuice module, facilitating better maintenance and future development.

* test(tokenjuice): add edge-case tests for gh table and reduction pipeline

* style(tokenjuice): apply cargo fmt

* feat(tokenjuice): wire into agent tool loop output compaction

Add `tokenjuice::compact_tool_output` helper and call it in the agent
tool loop after credential scrubbing (and on error paths with exit=1),
before any optional payload_summarizer. Derives argv/command
heuristically from JSON tool arguments (command / args / argv / cmd
shapes) so shell-wrapping tools still match upstream family rules
(git/*, package/*, tests/*, etc.). Pass-through safe: outputs under
512 bytes or where compaction saves <5% are returned untouched.

* fix(tokenjuice): address coderabbit review comments

- classify: derive command from argv join when input.command is unset,
  so commandIncludes* rules still match argv-only callers
- rules/loader: log read_dir / file_type / read_to_string failures at
  debug level so permission or filesystem issues are observable rather
  than silently skipped
- text/ansi: add trace log at strip_ansi entry/exit with lengths (no
  text content) per the project debug-logging rules
- tests: remove orphan src/openhuman/tokenjuice/tests/integration.rs
  which was never wired into any module declaration; the real fixture-
  parity runner lives at tests/tokenjuice_integration.rs and asserts
  hard when the fixtures directory is missing

Vendored-rule issues (docker-ps / kubectl-describe / git/branch /
grep casing / counter-pattern overbreadth / etc.) come from upstream
and are left as-is; this module is a straight port of the upstream
rule set and should not fork from it in v1.
2026-04-17 21:15:19 -07:00
Steven Enamakel e98f537fb7 feat(release): publish latest.json for Tauri auto-updater on production
The updater was wired client-side (prepareTauriConfig.js sets
plugins.updater.endpoints to
https://github.com/tinyhumansai/openhuman/releases/latest/download/latest.json
and embeds UPDATER_PUBLIC_KEY) but the manifest itself was never
generated after we moved off tauri-action — so installed apps would
fetch 404 and believe they were up to date forever.

Add scripts/release/publish-updater-manifest.sh which:
- Lists the release's assets via gh CLI
- Finds the updater bundles produced by createUpdaterArtifacts=true
  (.app.tar.gz for macOS, .AppImage.tar.gz for Linux, -setup.nsis.zip
  for Windows) for each of darwin-aarch64 / darwin-x86_64 /
  linux-x86_64 / windows-x86_64
- Reads the matching .sig files (minisign base64 payloads)
- Composes latest.json per the Tauri v2 static-manifest schema with
  version, pub_date, notes, and a platforms map
- Uploads it to the release via gh release upload --clobber

Wired as a new production-only job `publish-updater-manifest` that runs
after the build-desktop matrix. publish-release now waits on it, and
the asset-validation step requires /^latest\.json$/ so releases can't
ship without the manifest. cleanup-failed-release also tears down
if the manifest step fails.

Staging builds are deliberately skipped — they shouldn't poison the
public updater endpoint.
2026-04-17 21:12:47 -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 Enamakel f88d6572fb fix(ci-image): include vendored tauri-cef in CI Docker build context
The root .dockerignore excludes `app/` (it's sized for the openhuman-core
Dockerfile), which also excludes `app/src-tauri/vendor/tauri-cef`. The CI
image Dockerfile at .github/Dockerfile needs that path to compile the
CEF-aware tauri-cli, so the docker-ci-image workflow fails at the
`COPY app/src-tauri/vendor/tauri-cef /opt/tauri-cef` step.

BuildKit prefers `<dockerfile>.dockerignore` over the root one, so add a
dedicated .github/Dockerfile.dockerignore that keeps the vendored
submodule while still stripping target/, node_modules/, etc. Verified
locally: `docker build -f .github/Dockerfile .` reaches the verify step
with `cargo tauri --version` printing 2.10.1.
2026-04-17 20:05:40 -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 v0.52.20 2026-04-17 20:05:37 +00:00
c7487324cc feat(channels): dynamic filler messages during long agent turns (#600) (#636)
* refactor(channels): add extract_message_id helper for varied response shapes

Backend send_channel_message responses use at least three shapes:
{"id":"..."}, {"data":{"id":"..."}}, and {"messageId":1456,"success":true}.
The last one returns the id as a JSON number, so the prior inline
as_str()-only extraction silently dropped it. Consolidate the extraction
into a single helper that handles str/i64/u64 candidates and routes both
streaming-edit and thinking-message send paths through it. Fixes the
silent id loss that left thinking bubbles undeletable (#600).

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

* fix(channels): latch thinking edits off when first POST yields no id

When the initial thinking POST returned 200 but carried no message id
(either because the response shape was unexpected or the send itself
failed before C1), every subsequent thinking_dirty tick re-entered the
"send new message" branch. The user then saw one standalone italic
bubble per accumulated snippet instead of a single evolving one. Add a
thinking_edit_disabled latch that is set in both failure paths and
guard the edit_timer branch on it so we post at most one thinking
bubble per turn when the id is unrecoverable (#600).

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

* style(channels): label thinking bubble with explicit "Thinking:" header

A bare italicized snippet under a 💭 emoji reads ambiguously in chat —
it could be a user quote, a system note, or assistant output. Prefix
the italic body with an explicit "Thinking:" line so the ephemeral
bubble is unmistakably the LLM's reasoning stream and visually distinct
from both filler messages and the final reply (#600).

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

* fix(channels): reply-first finalize with orphan draft recovery

Two problems in the old finalize path. (1) The thinking bubble was
deleted before the reply was sent, leaving the chat momentarily empty
between the two round-trips. (2) When the final edit failed, the half-
streamed draft was left in place and the user never received the
canonical response — a silent data-loss hole during edit-endpoint
flakiness. Wrap the three delivery paths in a 'send: labeled block so
they share a single cleanup tail, delete the orphan draft and send a
fresh atomic reply on edit failure, and move the thinking-bubble
deletion to after the reply is on screen so the chat never blinks
empty (#600).

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

* feat(channels): ephemeral filler messages every 13s with dynamic snippets

Long agent turns (30–90 s) leave the chat static once the thinking
stream goes quiet and progressive edits stop, which reads as a frozen
bot. Add a third timer branch in the inbound loop that posts a short
"still working" message every FILLER_INTERVAL (13 s, tuned to stay
inside Telegram's ~1 msg/sec chat cap with headroom).

Each filler prefers a tail slice of the live thinking_accumulator
(last MAX_FILLER_CHARS = 200 Unicode scalars, trimmed at a word
boundary so it reads cleanly) so the user sees the agent's actual
reasoning instead of canned text. When the accumulator hasn't advanced
since the last filler we fall through to a rotating STATIC_FILLERS
pool ("💭 Still working on it…", etc.) so the chat still moves. All
filler ids are tracked in StreamingState.filler_message_ids and
deleted in finalize_channel_reply alongside the thinking bubble, so
the user ends each turn seeing only the canonical reply. A
filler_disabled latch stops hammering endpoints that reject filler
sends twice in a row.

Verified end-to-end on Telegram with both long (74 s, 5 fillers) and
short (32 s, 2 fillers) turns — all ephemeral messages cleaned up
cleanly after the final reply landed (#600).

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:49 -07: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
Steven EnamakelandGitHub 156944478d feat(cache): wire-level prompt/response dumps + JSONL into session_raw/ (#640)
* feat(transcript): enhance session transcript persistence with per-turn usage tracking

- Updated the `write_transcript` function to accept an optional `last_assistant_turn_usage` parameter, allowing for the inclusion of per-message token and cost figures in the JSONL output.
- Modified the `persist_session_transcript` method to capture and pass the last turn's usage data to the transcript writer, ensuring accurate tracking of resource usage.
- Improved documentation to clarify the new functionality and its impact on transcript persistence.

This change enhances the fidelity of session transcripts by associating usage metrics with the last assistant message, improving overall transparency in resource consumption.

* refactor(transcript): improve transcript reading logic by routing based on file extension

- Renamed `read_transcript` function to clarify its purpose and updated its logic to first check the file extension.
- Added handling for legacy `.md` files, ensuring they are processed with the appropriate parser.
- Enhanced fallback mechanism to check for the existence of a `.md` sibling file if the primary JSONL file is not found.

This change improves the robustness of transcript reading by accommodating legacy formats while maintaining compatibility with new JSONL files.

* feat(transcript): mirror final assistant reply in session transcript

- Added functionality to capture the final assistant reply in the transcript snapshot, ensuring that both the prompt and response are persisted in the JSONL output.
- This enhancement improves the completeness of session transcripts by including the assistant's final message alongside the user prompts.

This change enhances the fidelity of session transcripts, providing a more comprehensive record of interactions.

* feat(cache): wire-level prompt/response dumps + split JSONL into session_raw/

Two related changes for KV-cache debugging and on-disk clarity:

1. Wire-level dump (`providers/compatible.rs`)
   When OPENHUMAN_PROMPT_DUMP_DIR is set, every chat completion writes
   the outgoing NativeChatRequest body and the aggregated ApiChatResponse
   to paired timestamped JSON files. Covers both the non-streaming and
   SSE streaming paths. Unset → zero overhead, no behavior change.

   Why: the prompt-level transcript captures what the dispatcher
   assembled, but the actual wire bytes (including
   prompt_tokens_details.cached_tokens and the openhuman meta block)
   only surface at the HTTP layer. Pairing request + response per turn
   lets us diff consecutive turns to confirm cache-hit accounting and
   diagnose cache-miss causes.

2. JSONL source-of-truth moves to session_raw/ (`agent/harness/session/transcript.rs`)
   JSONL transcript files now live under workspace/session_raw/DDMMYYYY/
   instead of workspace/sessions/. The human-readable .md companion
   stays in workspace/sessions/DDMMYYYY/ so the structured source-of-
   truth and the readable debug view are cleanly separated on disk.

   - resolve_new_transcript_path returns session_raw/ paths and
     advances the index past both session_raw/*.jsonl and legacy
     sessions/*.md so indices stay unique across the migration.
   - find_latest_transcript prefers session_raw/ and falls back to the
     legacy sessions/ dir for pre-migration .md files (one-release compat).
   - md_companion_path derives the sessions/ md path from the
     session_raw/ jsonl path via path-component rewrite, with a
     sibling-file fallback for tests that use flat tempdirs.

* fix(cache,transcript): address PR review findings

- transcript: .md companion write is now best-effort — failures are
  logged with log::warn! and Ok(()) is returned. The JSONL above is
  the source of truth; a readable-log hiccup must not take down state
  persistence.
- compatible: replace peek_dump_seq() (non-atomic) with
  reserve_dump_seq() that fetch_adds PROMPT_DUMP_SEQ in one step and
  returns the reserved value. dump_prompt_if_enabled now takes seq as
  a parameter, so request/response files cannot be misaligned under
  concurrent requests.
- turn: explicitly clear last_turn_usage when resp.usage is None so
  the final assistant message can't inherit a prior iteration's stale
  numbers during a tool-using turn.
- transcript (nit): last-assistant lookup uses rposition; the emit
  loop pattern-matches (Option, Option) together so there's no
  separate unwrap.
- transcript (nit): JSONL meta parsing is positional — first non-empty
  line must be _meta or we error out. Replaces the substring-based
  heuristic that could false-positive on message content.
- compatible (nit): lower prompt/response dump success logs from info
  to debug — they fire on every turn when the env var is set.
2026-04-17 13:02:50 -07:00
CodeGhost21andGitHub c4ef14383d fix(ci): unblock release-packages workflow YAML parse (#639)
The `actions/github-script` block for the backlog-issue step used a JS
template literal whose markdown body lines sat at column 1, outside the
`script: |` literal block. YAML treated those lines as new mapping keys
and rejected the whole file — every run of release-packages.yml failed
at load time with zero jobs executed, so the brew tap, apt repo, npm
publish, linux-arm64 CLI, and smoke tests never ran for recent releases.

- Rewrite the issue body as a string array joined with `\n`, so every
  line lives inside the block scalar at the correct indentation.
- Fix stray backslash-escapes around the final `core.info(...)` template
  literal that were JS-invalid even before YAML choked on the body.

Validated locally with PyYAML; file now parses cleanly.
2026-04-17 12:49:37 -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
YellowSnnowmannandGitHub 0c04314004 Refactor: rust modules (#633) 2026-04-17 09:08:53 -07:00
Mega MindandGitHub 43d44acc1a fix: wire proactive welcome into conversations (#635) 2026-04-17 09:07:07 -07:00
6733720df9 fix(channels): delete thinking messages after final response (#600) (#612)
* feat(channels): add send_channel_delete to REST client (#600)

Add DELETE method to BackendOAuthClient for removing channel messages.
Used to clean up ephemeral thinking indicators after final response delivery.

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

* fix(channels): show thinking ephemerally and delete on final response (#600)

Thinking deltas are accumulated and sent as a temporary "💭" message
on the channel. When the final agent response is ready the thinking
message is deleted via the new DELETE endpoint so the user only sees
the clean reply. This replaces the previous behaviour where thinking
messages persisted permanently in the Telegram chat.

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

* style(channels): apply cargo fmt to bus.rs (#600)

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 23:04:00 -07:00
github-actions[bot] 583a4d689c chore(release): v0.52.19 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
Mega MindandGitHub ec309c8f90 feat(onboarding): complete conversational onboarding stack and UX audit (#619)
* fix(onboarding): guard complete_onboarding against premature flag flip (#591)

- Remove premature `chat_onboarding_completed = true` flip from
  `set_onboarding_completed` in config/ops.rs. The flag is now
  exclusively owned by the welcome agent via `complete_onboarding`.

- Strip auto-finalize side-effect from `check_status` action. It is
  now pure read-only and returns `onboarding_status`, `exchange_count`,
  and `ready_to_complete` in the snapshot instead of `finalize_action`.

- Add engagement guard to `complete` action: rejects with a descriptive
  error unless exchange_count >= 3 OR ≥1 Composio integration connected.
  Auth check also enforced before any write.

- Add process-global `WELCOME_EXCHANGE_COUNT` (AtomicU32) with
  `increment_welcome_exchange_count()` / `get_welcome_exchange_count()`.
  Dispatch layer calls `increment_welcome_exchange_count()` each time a
  user message routes to the welcome agent.

- Update `welcome_proactive.rs` snapshot call to new signature and
  prompt copy to reflect `onboarding_status: "pending"` / no pre-flip.

- Add 7 pure-logic unit tests for `engagement_criteria_met`, plus tests
  for the new exchange counter and updated snapshot shape.

Fixes #591

* style: cargo fmt for complete_onboarding.rs

* feat(onboarding): inject CONNECTION_STATE block into welcome-agent turns (#593)

Add `build_connection_state_block()` to dispatch.rs: fetches current
Composio integration status (with a 3s timeout for graceful degradation)
and formats it as a `[CONNECTION_STATE]...[/CONNECTION_STATE]` block.

After `resolve_target_agent` selects the welcome agent, the block is
appended to the last user message in history so the agent always has
up-to-date connection state without spending a tool call. This captures
OAuth completions that happened mid-conversation (user clicked auth link
in chat, authenticated in browser, came back).

Scoped strictly to welcome-agent turns (chat_onboarding_completed=false).
Orchestrator turns are unaffected.

Fixes #593
Part of #599

* style: cargo fmt for dispatch.rs

* feat(welcome): parallel template messages with LLM inference for faster perceived welcome (#592)

Show two template messages immediately while the LLM runs in the
background, cutting the perceived wait from ~15s to ~0s:

- Template 1 (t≈0ms): time-of-day greeting that names any connected
  channels, built from the status snapshot without extra I/O
- Template 2 (t=4s): "Getting everything ready for you..." loading
  indicator, published via tokio::join! alongside the LLM future
- LLM response: published when inference completes, opened directly
  with personalised setup content (no duplicate greeting)

`run_proactive_welcome` now fires three `ProactiveMessageRequested`
events rather than one. The two template helpers (`time_of_day_greeting`,
`build_template_greeting`) are pure functions covered by 6 new unit
tests. `prompt.md` gains a proactive-invocation section explaining that
greeting templates are pre-delivered and the agent must skip them.

* feat(welcome): add composio_authorize tool and inline auth link guidance (#594)

Wire `composio_authorize` into the welcome agent's tool allowlist and
teach the prompt how to offer OAuth links directly in chat:

- agent.toml: add "composio_authorize" to the named tools list so the
  welcome agent can call it during multi-turn conversations
- prompt.md: new "Offering inline auth links" section covering the
  consent-first flow (offer → user agrees → call tool → markdown link →
  confirm success via [CONNECTION_STATE] block on next turn)
- prompt.md: toolkit slug reference table for the common services
- prompt.md: auth link rules (no speculative calls, no bare URLs,
  one service at a time, await CONNECTION_STATE before confirming)
- prompt.md: two new "What NOT to do" bullets for composio_authorize
  misuse patterns

* feat(welcome): conversational onboarding prompt for issue #595

- Rewrite prompt.md: multi-turn flow, Gmail-first, no silent first turn
- Align with check_status/complete and ready_to_complete semantics
- Update proactive injection copy to match new tool wording

Made-with: Cursor

* feat(onboarding): add completion readiness reason

Made-with: Cursor

* docs(ux): add onboarding and welcome audit for #563

Made-with: Cursor

* docs(welcome): clarify OAuth link behavior in onboarding prompt

Updated the onboarding prompt to explicitly state that clicking the Gmail connection link opens the user's default browser for authentication. Added guidance to return to the chat after completing the authorization process.

* fix(onboarding): resolve CI test and proactive greeting review

Made-with: Cursor
2026-04-16 14:14:24 -07:00
github-actions[bot] dced586a18 chore(release): v0.52.18 v0.52.18 2026-04-16 19:46:22 +00:00