mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 05:12:33 +00:00
d1c577d25a0f6efd67d3bf11bfdff15761bfa241
1098
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d1c577d25a |
feat(agent): drive orchestrator delegation tools from TOML subagents (#525, #526)
Completes the half-built migration from a hardcoded ARCHETYPE_TOOLS table
+ orphan skill_delegation.rs to a TOML-driven delegation surface where
each agent declares its subagents and the tool list is synthesised from
the registry at agent-build time.
Rewrites `collect_orchestrator_tools` to take the orchestrator's
AgentDefinition, the global AgentDefinitionRegistry, and the slice of
connected Composio integrations, then iterates the definition's
`subagents` field:
* `SubagentEntry::AgentId` → one ArchetypeDelegationTool. The tool's
`name()` comes from the target agent's `delegate_name` override (or
`delegate_{id}` fallback) and its `description()` is the target's
`when_to_use`. Editing an agent's TOML when_to_use now immediately
updates the tool schema the orchestrator LLM sees — zero drift, no
hardcoded description strings to keep in sync.
* `SubagentEntry::Skills { skills = "*" }` → one SkillDelegationTool
per connected Composio toolkit. Each routes to the generic
skills_agent with `skill_filter` pre-populated. Empty integrations
list (CLI path, or user not yet connected) produces zero tools
rather than phantom `delegate_*` entries for unconnected toolkits.
Also in this commit:
- Wire the orphan `skill_delegation.rs` into `impl/agent/mod.rs` via
`mod skill_delegation;` + `pub use SkillDelegationTool;`. The file has
existed since earlier work but was never declared in the module tree,
so it compiled as dead code.
- Delete the legacy `MAIN_AGENT_TOOL_ALLOWLIST` constant and the
`main_agent_tools` filter in `tools/ops.rs`. They were documented as
"no longer the primary source of truth" since the from_config builder
switched to `collect_orchestrator_tools`, and grep confirms no
external callers remain. Clean deletion.
- Delete the hardcoded `ARCHETYPE_TOOLS` const in
`tools/impl/agent/mod.rs`. The 4-entry table has been replaced by the
orchestrator TOML's `subagents` list (which covers those 4 plus
archivist plus the skills wildcard), and the re-export in
`tools/mod.rs` is removed accordingly.
- Update `agents/orchestrator/agent.toml`: add the `subagents` field
listing researcher / planner / code_executor / critic / archivist /
{ skills = "*" }. Keep `spawn_subagent` in `[tools] named` as an
advanced fallback so power users can still spawn custom workspace-
override agent ids that aren't in the declarative subagents list.
- Add `delegate_name = "..."` to the 5 archetype TOMLs so the
orchestrator LLM sees natural tool names (`research`, `plan`,
`run_code`, `review_code`, `archive_session`) rather than the
`delegate_<agent_id>` fallback.
- Update `agent/harness/session/builder.rs` (line ~461) to call the new
`collect_orchestrator_tools` signature. Looks up the orchestrator
definition from the global registry; passes an empty integrations
slice because the builder is synchronous and cannot await Composio's
async fetch. The channel-dispatch path will populate integrations in
a later commit — the CLI/REPL path ships without per-toolkit delegation
tools, which is acceptable regression since CLI users still reach
Composio via `composio_execute` and the retained `spawn_subagent`
fallback.
Tests:
* 5 new unit tests in `orchestrator_tools.rs` cover the baseline
AgentId + Skills wildcard expansion, empty-integrations edge case,
unknown-id graceful skip, non-delegating agent with empty subagents,
and the slug sanitiser for tool-name-safe Composio toolkit names.
* Runs clean alongside all existing agent-module tests (323 pass;
one pre-existing Windows-path failure in `self_healing::tests::
tool_maker_prompt_includes_command` is unrelated to this PR and
fails identically on the upstream baseline).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
8f92155b4d |
feat(agent): add subagents + delegate_name fields to AgentDefinition (#525, #526)
Introduces the schema change needed to make agent definitions the single source
of truth for both direct tools and delegation targets:
- `subagents: Vec<SubagentEntry>` — declarative list of agents this agent can
spawn, expanding at build time into synthesised delegate_* tools on the LLM's
function-calling surface. Supports two TOML shapes via `#[serde(untagged)]`:
* Bare string (`"researcher"`) → `SubagentEntry::AgentId`
* Inline table (`{ skills = "*" }`) → `SubagentEntry::Skills(SkillsWildcard)`
The `Skills` variant expands dynamically to one delegate_{toolkit} tool per
connected Composio toolkit at runtime.
- `delegate_name: Option<String>` — optional override for the tool name this
agent is exposed as when another agent lists it in `subagents`. Defaults to
`delegate_{id}` when absent, lets the researcher agent be exposed as
`research`, code_executor as `run_code`, etc.
Schema only — no runtime behavior change yet. Follow-up commits wire the field
into `collect_orchestrator_tools`, the dispatch path, and the debug dump.
TOML placement note: `subagents = [...]` must appear before the `[tools]` table
header in agent TOMLs. Once a table section opens, every subsequent top-level
key is consumed by that table, so placing `subagents` after `[tools]` parses it
as `tools.subagents` and fails deserializing ToolScope. The test doc-comment
records this constraint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
af454afbb3 | chore(release): v0.52.6 v0.52.6 | ||
|
|
ec138c8491 |
feat(composio): provider folder modules + user profile persistence (#523)
* feat(composio): implement profile persistence for user data
- Introduced a new `profile` module to handle the persistence of user profile data from various providers into the local `user_profile` facet table.
- Enhanced the `composio_get_user_profile` and `fetch_user_profile` functions to call `persist_provider_profile`, ensuring that profile fields like display name, email, and avatar are stored locally for quick access.
- Added debug logging to track the number of facets written during the persistence process, improving observability of profile updates.
- This change aims to enhance user experience by reducing the need for repeated upstream API calls for frequently accessed profile information.
* style: apply cargo fmt to profile.rs and client.rs
* fix: PR review — cursor whitespace, stale profile values, test precision, log level
- Trim whitespace in cursor_to_gmail_after_filter before parsing so
leading/trailing spaces don't silently bypass the date filter.
- Change profile_upsert condition from `>` to `>=` so equal-confidence
provider refreshes replace stale values instead of only bumping
evidence_count.
- Tighten epoch millis test to assert exact date "2026/03/31" instead
of loose contains('/') check.
- Lower profile persistence log from info to debug to reduce noise in
normal connect/sync flows.
|
||
|
|
ae9ac30db6 |
feat: add proactive welcome onboarding flow (#522)
* feat: add proactive agents for onboarding experience - Introduced two new proactive agents: "Morning Briefing" and "Welcome Message". - The Morning Briefing agent provides a daily summary of the user's calendar, tasks, and relevant context, scheduled to run automatically at 7 AM. - The Welcome Message agent delivers a personalized greeting after onboarding, utilizing user information for a tailored experience. - Updated the cron job system to seed these agents upon onboarding completion, enhancing user engagement from the start. - Added comprehensive tests to ensure the correct functionality of the new agents and their integration into the system. * feat: implement proactive message handling for user engagement - Added a new `ProactiveMessageSubscriber` to route proactive messages (e.g., morning briefings, welcome messages) to the user's active channel, enhancing user engagement. - Introduced `ProactiveMessageRequested` event in the event bus to facilitate proactive message delivery. - Updated the configuration schema to include a preferred channel for proactive messages, allowing for tailored user experiences. - Seeded default proactive agent cron jobs to ensure timely delivery of messages post-onboarding. - Enhanced the startup process to register the proactive message subscriber, ensuring proactive messages are consistently routed. - Comprehensive tests added to validate the functionality of proactive message handling and delivery mechanisms. * feat: enhance welcome agent functionality and onboarding process - Updated the welcome agent's description to clarify its role as the first point of contact for new users, focusing on guiding them through remaining onboarding steps. - Increased the maximum iterations for the agent from 4 to 6 to allow for more complex interactions. - Introduced a new `complete_onboarding` tool to check the user's setup status and mark onboarding as complete, improving the onboarding experience. - Enhanced the prompt structure to provide clearer guidance on the agent's workflow, including steps for checking setup status, greeting users, and completing onboarding. - Updated the tools list to include `complete_onboarding`, ensuring the welcome agent can effectively manage user onboarding. - Comprehensive documentation added to clarify the agent's functionality and improve user engagement. * feat: enhance welcome agent functionality and onboarding process - Updated the welcome agent's description to clarify its role as the first point of contact for new users, focusing on guiding them through setup and onboarding. - Increased the maximum iterations for the agent from 4 to 6 to allow for more comprehensive interactions. - Introduced a new `complete_onboarding` tool to check the user's setup status and mark onboarding as complete, improving the onboarding experience. - Enhanced the prompt structure to provide clearer guidance on the agent's workflow, including steps for checking setup status, greeting users, and completing onboarding. - Updated the tools list to include the new `complete_onboarding` tool, ensuring it is available for the welcome agent's operations. - Improved documentation for the welcome agent's prompt, emphasizing tone guidelines and what not to do during user interactions. * style: apply rustfmt to onboarding flow changes * refactor: streamline proactive message subscriber registration and enhance onboarding agent tests - Replaced the direct registration of the proactive message subscriber with a new `register_web_only_proactive_subscriber` function, ensuring it is only registered once during domain startup. - Updated the welcome agent test to reflect the addition of the `complete_onboarding` tool, verifying its presence and adjusting the expected number of tools. - Enhanced the onboarding process by improving logging for proactive agent seeding transitions, providing clearer insights during onboarding state changes. - Refactored the cron job system to support agent definitions, allowing for more flexible job scheduling and execution based on defined agent parameters. - Improved documentation and comments across the affected modules to clarify the purpose and functionality of changes made. * refactor: improve proactive subscriber registration and logging - Streamlined the registration process for the web-only proactive message subscriber, enhancing clarity and maintainability. - Consolidated logging statements in the onboarding completion function for improved readability and consistency. - These changes aim to enhance the overall structure and logging clarity within the proactive messaging and onboarding processes. |
||
|
|
4cf608c2be |
feat: native embeddings module with Ollama and vector store (#521)
* feat: replace fastembed with candle for local embeddings - Introduced a new `CandleEmbedding` provider using the `candle` ML framework, eliminating C++ dependencies and enhancing performance. - Updated configuration to default to `candle` for embedding provider settings, replacing the previous `fastembed` references. - Added new modules for embedding providers, including `candle_embed`, `noop`, and `openai`, to support various embedding strategies. - Enhanced the `EmbeddingProvider` interface to accommodate the new `CandleEmbedding` implementation. - Refactored related tests to ensure comprehensive coverage of the new embedding functionalities and maintain backward compatibility with existing configurations. * feat: update embedding provider to Ollama - Replaced the default embedding provider from Candle to Ollama, enhancing local embedding capabilities with improved model management and GPU acceleration. - Updated configuration defaults for embedding model and dimensions to align with Ollama specifications. - Introduced a new Ollama embedding module, including necessary constants and functionality for embedding requests. - Refactored related code and tests to ensure compatibility with the new provider, maintaining backward compatibility with existing configurations. * refactor: remove Candle embedding provider and related dependencies - Deleted the `CandleEmbedding` module and its associated files, streamlining the embedding provider architecture. - Updated `Cargo.toml` and `Cargo.lock` to remove references to Candle-related packages, ensuring a cleaner dependency tree. - Refactored the `EmbeddingProvider` interface to eliminate support for the Candle provider, maintaining compatibility with existing providers. - Adjusted tests and documentation to reflect the removal of the Candle embedding functionality, ensuring clarity and consistency across the codebase. * feat: add SQLite-backed vector store for embeddings - Introduced a new `store` module to implement a local vector store backed by SQLite, enabling efficient storage and retrieval of text embeddings. - Added functionality for inserting, updating, and searching embeddings using cosine similarity, enhancing the embedding management capabilities. - Updated the `mod.rs` file to include the new `store` module and expose relevant functions for cosine similarity and vector operations. - Enhanced documentation to provide usage examples and clarify the integration of the vector store with existing embedding providers. * Add fs2 dependency for improved file locking in ComposeIO trigger history * test: boost embeddings module coverage to 97%+ Add tests for batch insert mismatch error path, invalid metadata JSON handling, disk store parent directory creation, and fake embedding dimensions accessor. 95 tests total across the module, all files at 97-100% line coverage. * style: apply cargo fmt to embeddings module * feat: enhance embedding provider creation with error handling - Updated the `create_embedding_provider` function to return an `anyhow::Result`, allowing for immediate error reporting on unrecognized provider names. - Added support for a "none" provider that returns a no-op embedding. - Enhanced tests to cover new error handling paths and validate behavior for known and unknown providers, improving overall test coverage. * feat: enhance Ollama and OpenAI embedding providers with improved handling for blank inputs and response validation - Updated the `embed` method in both `OllamaEmbedding` and `OpenAiEmbedding` to skip blank inputs while preserving their positions in the output as zero-vectors. - Added validation to ensure the response count matches the input count, with appropriate error handling for dimension mismatches. - Enhanced tests to cover new behavior for blank inputs and response validation, ensuring robustness in embedding functionality. * fix: address PR review findings for embeddings module - Factory returns Result for unknown providers instead of silent noop - Ollama: preserve positional alignment when blank texts are filtered - Ollama: validate response count and dimensions before returning - OpenAI: strict parsing errors on non-numeric embedding values - OpenAI: skip Authorization header when api_key is empty - OpenAI: validate response count and dimensions - OpenAI/Ollama: add tracing at entry, success, and error paths - Store: add store_meta table to persist and validate embedding provider/dimensions on open — errors on dimension mismatch - Store: propagate row decode errors instead of filter_map(ok) - Store: add tracing to search, insert, delete, and count paths - Update factories.rs caller for Result-returning factory 101 tests pass, all files at 97%+ coverage. |
||
|
|
3a20599f45 |
feat: dynamic connected integrations in agent system prompts (#520)
* feat(agent): add support for connected integrations in system prompts - Introduced a new `fetch_connected_integrations` method to retrieve and populate active Composio integrations for the agent. - Updated the `Agent` struct to include a `connected_integrations` field, allowing the system prompt to display available external services. - Enhanced the `build_system_prompt` method to incorporate connected integrations, improving the context provided to users during interactions. - Added a `ConnectedIntegrationsSection` to the prompt rendering, ensuring visibility of active integrations in the system prompt output. - Overall, these changes enhance the agent's ability to leverage connected services, improving user experience and interaction capabilities. * feat(debug_dump): integrate connected integrations into agent prompt dumps - Added a new `fetch_connected_integrations_for_dump` function to retrieve active integrations for the agent during prompt dumps. - Updated the `render_main_agent_dump` function to include connected integrations, enhancing the context provided in the debug output. - Improved the overall structure and clarity of the debug dump process, ensuring that connected integrations are accurately represented in the agent's prompt context. * refactor(agent): streamline integration fetching for system prompts - Refactored the `fetch_connected_integrations` method in the `Agent` struct to delegate integration fetching to a new centralized function in the `composio` module, enhancing code clarity and maintainability. - Updated the `fetch_connected_integrations_for_dump` function to utilize the new centralized fetching logic, ensuring consistent integration retrieval across different contexts. - Improved the overall structure of integration handling, allowing for better error management and logging during the fetching process. * feat(agent): add connected integrations support to parent execution context - Introduced a new field `connected_integrations` in the `ParentExecutionContext` struct to store active Composio integrations. - Updated relevant functions to utilize the new `connected_integrations` field, ensuring that system prompts and agent dumps reflect the current integrations. - Enhanced the integration cache management by implementing cache invalidation logic when connections are created or deleted, improving the accuracy of integration data across sessions. - Overall, these changes enhance the agent's ability to leverage connected services, providing users with better context during interactions. * feat(agent): initialize connected integrations in subagent context - Added a `connected_integrations` field to the `ParentExecutionContext` and `Agent` struct, allowing for the storage and retrieval of active Composio integrations. - Updated the `dispatch_target_agent` function to populate the `connected_integrations` field when creating a new sub-agent context. - Enhanced the `fetch_connected_integrations` method to return an `Option<Vec<ConnectedIntegration>>`, improving error handling and caching logic. - These changes improve the agent's ability to manage and utilize connected integrations, enhancing user interactions and context awareness. * refactor(agent): improve caching logic in fetch_connected_integrations - Updated the `fetch_connected_integrations` function to handle caching more effectively by using a match statement. - The function now caches results only when the backend is reachable, preventing unnecessary caching when the client is unavailable. - This change enhances error handling and ensures that subsequent calls with different configurations can retry without stale data. * style: apply cargo fmt formatting * feat(agent): enhance connected integrations handling and caching - Updated the `dispatch_target_agent` function to initialize connected integrations for sub-agents, ensuring they have access to the latest integrations. - Improved the caching mechanism for connected integrations by using a `HashMap` keyed by configuration identity, allowing for user-specific caching and better isolation of integration data. - Refactored the `invalidate_connected_integrations_cache` function to clear the entire cache instead of setting it to `None`, enhancing cache management. - Added a new method `load_from_default_paths` in the `Config` struct to reliably load user configurations without being affected by environment variable overrides, improving the debug dump process. - Enhanced the rendering of connected integrations in system prompts to provide clearer instructions based on available tools, improving user interaction clarity. * feat(agent): add method to set connected integrations - Introduced a new `set_connected_integrations` method in the `Agent` struct to allow for replacing the agent's connected integrations from external sources, enhancing flexibility in integration management. - Updated the caching mechanism for connected integrations to utilize `LazyLock`, improving initialization efficiency and thread safety. * style: apply cargo fmt |
||
|
|
01a948c18d |
feat: tree summarizer uses local AI exclusively (#518)
* refactor: update module visibility and enhance summarization logic
- Changed the visibility of the `ollama_api` module to `pub(crate)` to restrict its access to the current crate, improving encapsulation.
- Refactored the `run_summarization` and `propagate_node` functions to pass the chat model ID from the configuration, ensuring consistent usage of the model across summarization tasks.
- Enhanced the `summarize_to_limit` function to accept the model parameter, allowing for more flexible and dynamic summarization based on the specified model.
- Updated the `create_provider` function to enforce the requirement of enabling local AI for the tree summarizer, ensuring proper configuration before execution.
* fix: update Ollama provider credential handling
- Changed the credential parameter in the `create_local_ai_provider` function from `None` to `Some("ollama")`, clarifying that while Ollama does not require authentication, a non-None credential is necessary for the provider's configuration.
* feat: add tree summarization script for memory namespaces
- Introduced a new script `tree-summarizer-run-all.sh` that automates the process of running tree summarization across all memory namespaces.
- The script discovers namespaces from the specified workspace and supports various commands including `run`, `status`, `query`, and `rebuild`.
- Enhanced error handling and logging for improved usability and debugging during summarization tasks.
* style: apply cargo fmt to tree summarizer
* refactor: improve argument handling and output summary in tree summarizer script
- Refactored the argument construction in `tree-summarizer-run-all.sh` to use an array for better handling of command-line arguments.
- Enhanced the output summary to provide a clearer report of succeeded and failed namespace processing.
- Updated the while loop to read from `NAMESPACES` directly, improving readability and efficiency.
* fix: address PR review — array args, subshell loop, retry wrapper, narrow export
- Script: use bash array for args instead of string to prevent word-splitting
- Script: use here-string loop so SUCCEEDED/FAILED propagate to parent shell
- ops.rs: wrap Ollama provider in ReliableProvider for retry/backoff
- local_ai/mod.rs: keep ollama_api private, re-export only OLLAMA_BASE_URL
|
||
|
|
172cd0da4c |
Fix stale voice server state between dictation sessions (#517)
* Fix stale voice server state between dictation sessions * Enhance audio capture and dictation listener tests - Added new test utilities in `audio_capture.rs` for handling recording results in tests. - Introduced multiple tests for audio processing functions, including handling silence and RMS calculations. - Updated `dictation_listener.rs` with tests for normalizing hotkey aliases and ensuring proper serialization of dictation events. - Improved overall test coverage and reliability for audio processing and dictation functionalities. * Refactor audio processing functions and enhance test coverage - Simplified the `from_test_result` function in `audio_capture.rs` by removing unnecessary line breaks. - Consolidated assertions in `server.rs` for better readability. - Introduced new functions in `streaming.rs` for decoding PCM16 LE frames and appending stream samples, improving audio processing logic. - Added tests for the new audio processing functions, ensuring robust validation of their behavior and enhancing overall test coverage. |
||
|
|
08178b5ff3 |
feat(composio): incremental sync with per-item persistence for Gmail and Notion (#519)
* feat(composio): implement incremental sync and state management for Gmail and Notion providers - Enhanced the Gmail and Notion providers to support incremental synchronization with per-item persistence, improving data handling efficiency. - Introduced a new `SyncState` module to manage persistent sync state, including cursor tracking, synced IDs, and daily request budget management. - Updated sync logic to load state from a KV store, check daily budget limits, and handle paginated API requests, ensuring robust data retrieval and deduplication. - Refactored existing sync methods to utilize the new state management, enhancing overall reliability and performance of the providers. - Improved documentation for the sync process and state management, clarifying the operational flow and usage of the new features. * refactor(composio): improve error handling and logging in Gmail and Notion providers - Enhanced error handling in the Gmail provider to format error messages more clearly during email fetching. - Streamlined debug logging in both Gmail and Notion providers to improve readability by consolidating multiline statements into single lines. - Refactored the `extract_page_title` function in the Notion provider for better clarity in property extraction logic. - Overall, these changes aim to enhance maintainability and improve the clarity of error reporting and logging across the providers. |
||
|
|
a115758c6c |
Improve local voice readiness and add Composio trigger history (#516)
* feat: enhance local AI asset state management and error handling - Updated the Home component to improve readiness checks for local AI assets, ensuring a more robust UI experience. - Refactored the LocalAiService to provide clearer state management for STT and TTS models, including handling on-demand downloads and error logging. - Enhanced the voice status function to accurately reflect the availability of transcription backends, improving overall system reliability. - Introduced warnings for on-demand model downloads to inform users about potential delays in functionality. * feat: implement polling for voice server status in OverlayApp - Added a polling mechanism to periodically check the voice server status every 2 seconds, ensuring the overlay remains in sync with the server state. - Introduced logic to activate or dismiss the speech-to-text (STT) mode based on the server's recording or transcribing state, enhancing user experience and responsiveness. - Utilized the existing `callCoreRpc` function to fetch server status, improving reliability in state management during brief disconnects or reconnections. * feat: refine prompt handling in LocalAiService - Updated the prompt construction logic in `LocalAiService` to enhance clarity and functionality. - When `no_think` is set, the system prompt now includes a directive for the model to respond with only the final answer, improving response accuracy. - Refactored the prompt and system parameters to ensure they are correctly formatted and passed to the `OllamaGenerateRequest`, enhancing overall request handling. * feat: enhance STT readiness checks in VoicePanel and useVoiceSkillStatus - Updated the STT readiness logic in `VoicePanel` to account for both 'ready' and 'ondemand' states, improving the accuracy of readiness assessments. - Refined the `useVoiceSkillStatus` hook to ensure it only blocks when the local AI's STT state is explicitly 'missing', enhancing overall system reliability and user experience. * feat(composio): implement ComposeIO trigger history component and hook - Added `ComposeioTriggerHistory` component to display a list of ComposeIO trigger events with formatted timestamps and payloads. - Introduced `useComposeioTriggerHistory` hook to manage fetching and state of trigger history entries, including error handling and loading states. - Updated `Webhooks` page to integrate the new component and hook, replacing previous webhook activity display with ComposeIO trigger history. - Created utility functions for formatting timestamps and payloads for better readability in the UI. - Established backend support for fetching trigger history through new Tauri commands, ensuring robust data handling and storage. * style: apply repo formatting fixes * feat: add fs2 dependency and enhance ComposeIO trigger history handling - Introduced the `fs2` crate to manage file locking, improving the reliability of file operations in the ComposeIO trigger history. - Updated `ComposioTriggerHistoryStore` to utilize exclusive file locks during archive writing, ensuring data integrity. - Enhanced error handling for file operations, providing clearer logging for failures related to file access and locking. - Refactored the initialization logic for global trigger history to prevent duplicate setups, improving overall stability. |
||
|
|
0a09d72677 |
feat: native mouse and keyboard control tools (#515)
* feat: add native computer control tools for keyboard and mouse - Introduced `ComputerControlConfig` to manage mouse and keyboard tool activation. - Implemented `KeyboardTool` and `MouseTool` for native input control using platform-native APIs. - Updated configuration schema to include computer control settings. - Enhanced tool registration logic to conditionally include mouse and keyboard tools based on user configuration. - Added comprehensive documentation and tests for new functionalities, ensuring robust integration and usability. * style: apply cargo fmt to computer control tools * fix: harden computer control tools — safe cleanup, strict validation, gate tests - keyboard hotkey: track pressed keys and always release in reverse on error (prevents stuck modifiers); validate modifier-first pattern (reject ["a","Ctrl"], ["Ctrl"], ["Ctrl","Shift"]) - mouse drag: guarantee button release via best-effort cleanup after press, even when move_mouse fails - mouse parse_button: return Result, reject unknown/non-string values instead of silently defaulting to left - mouse scroll: use i32::try_from instead of silent `as i32` truncation - Add debug logs on security block branches (can_act / record_action) - Add ops.rs regression tests for computer_control enabled/disabled gate |
||
|
|
ef9c117e9e |
test: expand agent harness coverage (#513)
* feat(tests): add comprehensive unit tests for hooks and memory context - Introduced a suite of tests for the `fire_hooks` function, ensuring that all hooks are dispatched even if one fails, enhancing reliability in the hook execution flow. - Added tests for the `sanitize_tool_output` function to validate the correct mapping of success and failure messages for various tool outputs. - Implemented a mock memory structure to facilitate testing of memory context building, ensuring that working memory is prioritized and deduplication occurs correctly. - Enhanced the `build_memory_context` function tests to verify filtering and truncation of memory entries, improving the robustness of memory management in the system. - Overall, these tests aim to strengthen the codebase by ensuring that critical functionalities related to hooks and memory context are thoroughly validated. * feat(tests): enhance unit tests for provider alias resolution and prompt options - Updated the `provider_alias_and_route_selection_round_trip` test to dynamically resolve the first provider from the registry, ensuring accurate alias resolution. - Added new tests for `DumpPromptOptions` and `ComposioStubTools`, validating default settings and expected tool names. - Introduced tests for rendering main agent dumps, ensuring tool instructions and skill counts are correctly included in the output. - Enhanced prompt handling tests to cover cache boundary extraction and subagent render options, improving overall test coverage and reliability. * feat(tests): enhance error handling and formatting in unit tests - Added new tests for `AgentError` variants to validate string formatting and error recovery from `anyhow`. - Improved formatting consistency in existing tests for better readability. - Enhanced the `sanitize_tool_output` test to ensure accurate mapping of success and failure messages. - Updated memory loader tests to enforce minimum limits and budget constraints, ensuring robust memory management. - Overall, these changes aim to strengthen the test suite by improving coverage and clarity in error handling scenarios. * feat(tests): add unit tests for tool filtering and subagent dump rendering - Introduced new tests to validate the filtering of tools based on named scopes and disallowed tools, ensuring correct tool selection in debug dumps. - Added tests for rendering subagent dumps, including handling file prompt fallbacks and missing files without panicking. - Enhanced the workspace prompt handling to prefer custom prompt locations, improving the flexibility and reliability of agent prompt rendering. - Overall, these additions strengthen the test suite by covering critical functionalities related to tool filtering and prompt rendering. * feat(tests): add comprehensive unit tests for memory loader and multimodal helpers - Introduced new tests for the memory loader to validate behavior when the header exceeds budget and when recall fails, ensuring robust memory management. - Added tests for multimodal helpers, covering image marker counting, payload extraction, and MIME type normalization, enhancing the reliability of multimodal interactions. - Overall, these additions strengthen the test suite by improving coverage and ensuring correct functionality in memory handling and multimodal processing. * feat(tests): add unit tests for tool execution and agent behavior - Introduced new tests for the `run_tool_call_loop` function, validating the rejection of vision markers for non-vision providers and ensuring correct streaming of final text chunks. - Added tests to verify that CLI-only tools are blocked in prompt mode and that native tool results are persisted as tool messages. - Enhanced the `Agent` class with tests for error handling and event publishing during single runs, ensuring robust agent behavior in various scenarios. - Overall, these additions strengthen the test suite by improving coverage and reliability in tool execution and agent interactions. * feat(tests): enhance tool execution and agent behavior tests - Added new tests for the `run_tool_call_loop` function, including scenarios for auto-approving supervised tools on non-CLI channels and handling unknown tools with default max iterations. - Introduced `ErrorResultTool` and `FailingTool` to simulate error conditions during tool execution, improving coverage of error handling in the agent. - Updated the `ScriptedProvider` to return results wrapped in `anyhow::Result`, ensuring consistent error handling across test cases. - Overall, these enhancements strengthen the test suite by validating tool execution paths and agent behavior under various conditions. * refactor(tests): improve test readability and structure - Enhanced formatting in various test cases for better clarity and consistency, including the use of line breaks and indentation. - Updated assertions to improve readability by aligning them with Rust's idiomatic style. - Overall, these changes aim to strengthen the test suite by making it more maintainable and easier to understand. * docs(agent): enhance module documentation for agent domain - Added comprehensive documentation to the `mod.rs` file, detailing the agent domain's purpose, key components, and their functionalities. - Improved clarity on how LLMs interact with the system, manage conversation history, and handle autonomous behaviors. - This update aims to enhance understanding and maintainability of the agent domain within the OpenHuman project. * docs(agent): improve documentation and formatting across multiple files - Enhanced comments and documentation in `dispatcher.rs`, `error.rs`, `hooks.rs`, and `harness/mod.rs` for better clarity and consistency. - Adjusted formatting in the `TurnContext` and `ToolCallRecord` structs to improve readability and understanding of their purpose and functionality. - Overall, these changes aim to strengthen the documentation and maintainability of the agent domain within the OpenHuman project. * feat(tests): add comprehensive tests for memory loader and agent behavior - Introduced new tests for the `DefaultMemoryLoader`, validating error propagation during primary recall failures and ensuring correct context emission when working memory is present. - Added tests to verify behavior when the working memory section exceeds budget constraints, enhancing memory management robustness. - Overall, these additions strengthen the test suite by improving coverage and reliability in memory handling and agent interactions. * refactor(tests): improve formatting and readability in memory loader tests - Reformatted the `load_context` calls in memory loader tests for better readability by chaining method calls. - Enhanced documentation comments in the `pformat.rs` file to clarify the purpose and functionality of functions. - Improved consistency in spacing and formatting across various sections of the codebase, including the `interrupt.rs` and `builder.rs` files. - Overall, these changes aim to enhance code clarity and maintainability within the test suite and related modules. * feat(tests): add new tests for self-healing interceptor and local AI provider - Introduced tests to validate the detection of missing commands in the `SelfHealingInterceptor`, ensuring proper handling of recognized and unrecognized patterns. - Added tests for the `ensure_polyfill_dir` method to confirm directory creation and path exposure. - Enhanced local AI provider tests to verify correct behavior when the service is ready and the appropriate tier is set, as well as ensuring local metadata is utilized during provider resolution. - Overall, these additions strengthen the test suite by improving coverage and reliability in self-healing and local AI functionalities. * refactor(tests): enhance test structure and external ID handling in escalation tests - Updated the `envelope` function to accept an `external_id` parameter, improving flexibility in test scenarios. - Modified various test cases to utilize specific external IDs, enhancing clarity and ensuring accurate event assertions. - Introduced a mutex lock in local AI tests to prevent race conditions, ensuring reliable test execution. - Overall, these changes improve the robustness and maintainability of the test suite for escalation and local AI functionalities. * refactor(tests): remove redundant test modules and improve test organization - Eliminated unused test modules from `hooks.rs`, `memory_loader.rs`, `fork_context.rs`, `interrupt.rs`, and `parse.rs` to streamline the codebase. - Enhanced overall test organization by consolidating relevant tests into appropriate files, improving maintainability and readability. - These changes aim to simplify the test structure and focus on active test cases, ensuring a cleaner and more efficient testing environment. * refactor(tests): improve test formatting and readability - Reformatted assertions in multiple test cases for better readability by aligning them with Rust's idiomatic style. - Enhanced the structure of test cases by using line breaks and consistent indentation, improving overall clarity. - These changes aim to strengthen the test suite by making it more maintainable and easier to understand. * refactor(api): improve string containment check and formatting in transcript handling - Updated the `key_bytes_from_string` function to use a more concise containment check for special characters. - Changed the message writing in the `write_transcript` function to utilize `writeln!` for better formatting. - Enhanced the condition in `latest_in_dir` to use `is_none_or` for improved readability and clarity. - These changes aim to streamline code and enhance maintainability across the API and transcript handling modules. * refactor(code): streamline function implementations and improve readability - Removed unnecessary whitespace in `run_voice_server_command` for cleaner code. - Simplified directory search logic in `bundled_openclaw_prompts_dir` by using `find` instead of a loop. - Updated `request_accessibility_access` to use direct references for keys and values, enhancing clarity. - Improved documentation formatting in `mod.rs` and `types.rs` for better consistency. - Refactored `Config` initialization in `load.rs` to use struct update syntax for clarity. - Added `#[allow(clippy::too_many_arguments)]` annotations in multiple functions to address linter warnings. - Enhanced type definitions and function signatures for better type safety and readability in various modules. - Overall, these changes aim to improve code maintainability and readability across the project. * chore(ci): update typecheck workflow and pre-push hooks to include clippy checks - Modified the GitHub Actions workflow to run clippy with warnings treated as errors for the `openhuman` package. - Enhanced the pre-push hook to include clippy checks, ensuring code quality before pushing changes. - Updated package.json to define a new script for running clippy, integrating it into the format check process. - These changes aim to improve code quality and maintainability by enforcing stricter linting rules. * refactor(api): simplify condition in key_bytes_from_string function - Streamlined the condition in the `key_bytes_from_string` function to improve readability by consolidating the if statement into a single line. - This change enhances code clarity while maintaining the original functionality of the key validation process. * chore(package): update format:check script to remove clippy integration - Modified the `format:check` script in `package.json` to exclude the clippy check, streamlining the formatting process. - This change simplifies the formatting workflow while maintaining the integrity of Rust formatting checks. * refactor(core): enhance documentation and structure in core modules - Improved documentation across various core functions, including `build_registered_controllers`, `run_from_cli_args`, and `dispatch`, to clarify their purpose and usage. - Streamlined comments to provide clearer guidance on the flow of operations and error handling. - Enhanced the structure of the `EventBus` and `NativeRegistry` to improve readability and maintainability. - Overall, these changes aim to improve code clarity and facilitate easier navigation and understanding of the core components. * refactor(core): reorganize imports in engine.rs for clarity - Adjusted the import statements in `engine.rs` to improve organization and readability. - Moved the macOS-specific import of `validate_focused_target` to a more appropriate location and ensured consistent ordering of imports. - These changes aim to enhance code clarity and maintainability within the core module. * refactor(core): enhance WebChannelEvent structure and documentation - Introduced a new `WebChannelEvent` struct to standardize event payloads for chat-related activities, including fields for event name, client ID, thread ID, request ID, and optional response details. - Improved documentation for the `attach_socketio` function, clarifying its role in setting up Socket.IO event handlers and the associated chat logic. - Removed unused structs and streamlined the event handling process to improve code clarity and maintainability across the core module. * refactor(core): streamline Socket.IO event handlers for clarity and consistency - Refactored the Socket.IO event handlers in `attach_socketio` to improve readability by standardizing the formatting and structure of the code. - Enhanced the organization of the event handling logic for `rpc:request`, `chat:start`, and `chat:cancel` events, making it easier to follow the flow of operations. - These changes aim to improve code maintainability and facilitate easier navigation within the Socket.IO integration. * feat(core): add new structs for Socket RPC and chat events - Introduced `SocketRpcRequest`, `ChatStartPayload`, and `ChatCancelPayload` structs to facilitate handling of Socket.IO events related to chat functionality. - These additions enhance the structure and clarity of the event payloads, improving the maintainability of the Socket.IO integration. * refactor(core): remove unused json_type_name function from socketio.rs - Eliminated the `json_type_name` function from `socketio.rs` as it was not utilized in the current codebase. - This change helps to clean up the code and improve maintainability by removing unnecessary functions. * chore(ci): update clippy command in typecheck workflow - Modified the clippy command in the GitHub Actions workflow to remove the `-D warnings` flag for the `openhuman` package, allowing warnings to be displayed without failing the build. - This change aims to improve the development experience by providing more flexibility during code analysis while still encouraging code quality. * chore(husky): remove clippy check from pre-push hook - Eliminated the clippy command from the pre-push hook to streamline the pre-push checks. - Updated the failure message to reflect the removal of clippy, focusing on format, lint, TypeScript, and Rust errors only. - This change simplifies the pre-push process while maintaining essential checks for code quality. * refactor(tests): add macOS-specific imports for enhanced test coverage - Introduced conditional imports for macOS in the tests module of `engine.rs` to support platform-specific functionality. - This change improves the test setup for macOS environments, ensuring compatibility and enhancing overall test coverage. * refactor(tests): update tool call execution in test cases - Modified the `execute_tool_call` method calls in multiple test cases to include a second parameter, improving the accuracy of the tests. - This change ensures that the tests reflect the latest method signature and enhances the reliability of the test outcomes. |
||
|
|
8635ac16c5 |
feat: real-time inference progress events for web channel (#514)
* feat(conversations): implement real-time inference status tracking - Added new event listeners for inference start, iteration start, subagent spawning, and completion to track the live state of chat interactions. - Introduced an `InferenceStatus` interface to manage the current phase and active tools/subagents for each thread. - Updated the UI to display inference status indicators, enhancing user experience during chat interactions. - Created a new `progress` module in the Rust backend to emit real-time progress events, allowing for better integration with the web channel. - Refactored the `subscribeChatEvents` function to include new event handlers for managing inference and subagent events, improving clarity and maintainability of the event handling logic. * style: fix formatting from pre-push hook * fix(test): read SSE events until chat_done instead of first event The e2e test expected `chat_done` as the first SSE event, but now real-time progress events (inference_start, iteration_start) are emitted before it. Use `read_sse_event_by_type` to skip progress events and wait for the terminal `chat_done` event. |
||
|
|
ace0006c85 |
feat: session transcripts for LLM KV cache stability (#512)
* feat(transcript): implement session transcript management for KV cache stability - Added support for session transcript persistence, allowing the exact `Vec<ChatMessage>` to be stored as human-readable `.md` files. - Introduced methods for loading previous transcripts to pre-populate messages for KV cache reuse, enhancing session continuity. - Updated `AgentBuilder` to include an agent definition name for transcript file naming. - Refactored `Agent` to handle transcript loading and persistence during session turns, ensuring byte-identical message handling across sessions. - Created a new `transcript.rs` module to encapsulate transcript-related functionality, improving code organization and maintainability. * feat(usage): enhance API response structure with usage and billing metadata - Added `usage` and `openhuman` fields to the `ApiChatResponse` struct to capture standard OpenAI usage metrics and OpenHuman backend metadata. - Introduced `ApiUsage`, `OpenHumanMeta`, and related structs to encapsulate detailed usage and billing information. - Updated `parse_native_response` and `extract_usage` methods to process and return usage data, improving the integration of usage tracking in chat responses. - Modified the `UsageInfo` struct in traits to include new fields for cached input tokens and charged amount, enhancing the overall usage reporting capabilities. * feat(provider): integrate usage extraction into OpenAiCompatibleProvider responses - Added usage extraction functionality to the `OpenAiCompatibleProvider`, enhancing the API response structure to include usage metrics. - Updated the `parse_native_response` method to utilize a new `wrap_message` function for improved testability and clarity in response handling. - Refactored tests to accommodate the new usage extraction logic, ensuring comprehensive coverage of the updated response structure. * feat(transcript): implement sub-agent transcript persistence and usage tracking - Added functionality to persist sub-agent conversation transcripts, enabling inspection for debugging and KV cache analysis. - Introduced a new `persist_subagent_transcript` function to handle transcript writing, including metadata for input/output tokens and charged amounts. - Updated the `Agent` implementation to accumulate usage statistics across iterations and include them in the session transcript. - Enhanced the `write_transcript` function to include additional metadata fields, improving the detail of stored transcripts. - Refactored tests to validate the new transcript persistence and usage tracking features, ensuring comprehensive coverage. * refactor(transcript): improve code readability and structure - Reformatted the `write_transcript` and `read_transcript` functions for better clarity by adjusting line breaks and indentation. - Enhanced the `parse_meta` function to improve readability by restructuring the `get` closure. - Updated test cases to maintain consistency with the new formatting, ensuring clarity in the test structure. - Overall, these changes aim to enhance code maintainability and readability without altering functionality. * fix(provider): return Result from parse_native_response, use Option<u64> for OpenHumanUsage fields - parse_native_response now returns Result and propagates an error when choices is empty instead of silently returning text: None - OpenHumanUsage token fields changed to Option<u64> so missing keys yield None and allow fallback to standard OpenAI usage block - extract_usage now logs which source (openhuman vs standard) provided token counts via structured tracing - run_inner_loop returns AggregatedUsage so subagent transcripts reflect real usage instead of zeros - Document escape_content/unescape_content edge case with pre-existing escape sequences |
||
|
|
1cb70e3234 |
feat: P-Format tool calls, user memory injection, planner upgrades (#511)
* feat(agent): introduce debug agent prompts script and CLI for prompt inspection
- Added `scripts/debug-agent-prompts.sh` to dump system prompts for built-in agents, facilitating prompt engineering reviews.
- Implemented `openhuman agent` CLI commands for inspecting agent definitions and rendering prompts.
- Updated `.gitignore` to exclude local prompt dumps and added version bump for `openhuman` to 0.52.5.
- Introduced `debug_dump` module for shared prompt rendering logic, enhancing debugging capabilities across the application.
* feat(pformat): introduce P-Format tool calls for efficient parameter handling
- Added a new module `pformat` to implement P-Format ("Parameter-Format") tool calls, which significantly reduce token usage in tool invocations.
- Updated the agent module to include the new `pformat` module.
- Enhanced the context management by integrating user memory summaries from the tree summarizer, optimizing the prompt rendering process.
- Introduced constants for user memory character limits to ensure efficient memory usage across namespaces.
- Implemented a new `UserMemorySection` in the prompt to display distilled long-term context, improving the agent's ability to leverage learned information during interactions.
- Refactored the tree summarizer store to collect root-level summaries with character caps, ensuring manageable context sizes in prompts.
* feat(dispatch): implement PFormatToolDispatcher for efficient tool call handling
- Introduced `PFormatToolDispatcher`, a new dispatcher that utilizes P-Format for compact tool call syntax, significantly reducing token usage during interactions.
- Updated the agent's session builder to support the new dispatcher, allowing for a seamless transition to P-Format as the default for text-based providers.
- Enhanced the prompt rendering process to accommodate P-Format, ensuring backward compatibility with existing JSON tool calls.
- Modified the context management to reflect the new tool call format, improving the overall efficiency of prompt generation and tool interaction.
- Added tests to validate the correct rendering of tool signatures in P-Format, ensuring that the new format is correctly integrated into the system.
* feat(tests): add comprehensive tests for PFormatToolDispatcher functionality
- Introduced multiple tests for the `PFormatToolDispatcher`, validating its ability to parse tool calls from both P-Format and JSON formats.
- Implemented tests to ensure correct handling of multiple tool call tags and the dispatcher’s fallback behavior to JSON when P-Format is ignored.
- Enhanced the `render_main_agent_dump` function to include the dispatcher instructions, ensuring accurate context for tool usage in debug outputs.
- Updated the tree summarizer tests to verify namespace filtering and summary collection with respect to character limits, improving overall test coverage and reliability.
* feat(prompt): enhance tool signature rendering with P-Format support
- Introduced a new function `render_pformat_signature_for_box_tool` to generate P-Format signatures for tools, improving consistency in tool call formatting.
- Updated the `render_subagent_system_prompt` function to utilize the new P-Format signatures, ensuring alignment with the main agent's tool call protocol.
- Enhanced documentation to clarify the use of P-Format in tool calls, including detailed instructions for argument handling and formatting within the tool use protocol.
* feat(planner): update agent configuration and enhance planning context
- Revised the `when_to_use` description to emphasize the agent's ability to gather real context through memory recall and web searches.
- Increased `max_iterations` from 5 to 8 to allow for more complex planning scenarios.
- Changed `omit_memory_context` to false, enabling the agent to utilize memory context during planning.
- Updated the tools list to include `memory_recall`, `memory_store`, `memory_forget`, and `web_search_tool`, enhancing the agent's capabilities for context gathering.
- Expanded the prompt documentation to instruct users on gathering context before planning, ensuring more informed and effective task decomposition.
* style: apply cargo fmt to new and modified files
* feat(debug): enhance error handling and logging in debug-agent-prompts and tool dispatching
- Added error handling for missing output directory in `debug-agent-prompts.sh`, ensuring clearer feedback for users.
- Introduced a verbose flag in `agent_cli.rs` to control logging output, improving usability during debugging.
- Refactored tool response parsing in `dispatcher.rs` to prefer p-format calls while maintaining compatibility with JSON, enhancing response handling.
- Updated session builder in `builder.rs` to finalize dispatcher selection after tool list preparation, ensuring accurate tool handling.
- Improved debug dump functionality in `debug_dump.rs` to clarify the context of the dump process, ensuring better understanding of the output.
- Enhanced prompt rendering functions to support explicit tool call formats, improving flexibility in subagent interactions.
* feat(cli, prompt): enhance logging and tool call format handling
- Added debug logging for the agent subcommand in `cli.rs`, improving traceability during command execution.
- Updated the `render_subagent_system_prompt_with_format` function in `prompt.rs` to support multiple tool call formats (P-Format, JSON, Native), ensuring consistent output and flexibility for subagent interactions.
- Refactored tool call protocol documentation to clarify usage across different formats, enhancing user understanding and implementation.
* fix: address PR review — 8 findings
1. scripts/debug-agent-prompts.sh: validate --out argument exists
2. agent_cli.rs: silence logger in run_list before Config::load_or_init
3. dispatcher.rs: per-tag p-format/JSON selection (no all-or-nothing)
4. builder.rs: move pformat_registry build after orchestrator tools
5. debug_dump.rs: fall back to bundled prompt location for File sources
6. store.rs: fix char/byte mixing in total_cap computations
7. prompt.rs: thread ToolCallFormat into render_subagent_system_prompt
8. cli.rs: add debug trace on agent dispatch + lower dispatcher log
|
||
|
|
4c195e984a |
feat(composio): native Rust providers for per-toolkit profile, sync, triggers (#509)
* chore(composio): update Composio version and enhance periodic sync functionality - Bump Composio version to 0.52.5 in Cargo.lock. - Introduce periodic synchronization for Composio connections, allowing for regular updates based on defined intervals. - Register both Composio trigger and connection created subscribers to handle events effectively. - Implement a new periodic sync scheduler that manages sync operations for active connections, improving data freshness and integration reliability. - Enhance Composio provider implementations to support user profile fetching and sync operations, ensuring seamless integration with the backend. * fix(composio): address review feedback on provider system - bus: poll list_connections with exponential backoff (500ms→4s, 60s cap) until the connection is observed in ACTIVE/CONNECTED before firing on_connection_created, replacing the fixed 2s sleep that raced the OAuth handoff. - ops: parse_sync_reason now returns Result and rejects unrecognized reason strings instead of silently coercing them to Manual; new unit tests cover the happy path and rejection cases. - periodic: add a static OnceLock guard inside start_periodic_sync so the scheduler is only spawned once even when both startup paths call into it. - gmail/providers: redact PII in tracing output — log has_email + email_domain instead of the raw address, and drop display_name + email from the default on_connection_created log. - notion: align the comment with the actual filter (recently-edited pages, databases intentionally excluded for snapshot size reasons). * feat(composio): enhance sync handling and periodic scheduler - Introduced `record_sync_success` function to track successful syncs for connections, preventing redundant re-firing by the periodic scheduler. - Updated `ComposioTriggerSubscriber` and `ComposioConnectionCreatedSubscriber` to utilize the new sync recording mechanism. - Refactored periodic sync logic to share a process-wide map for last successful sync timestamps, improving synchronization efficiency across event-driven and periodic paths. - Adjusted imports in `mod.rs` to include the new sync recording function. * fix(notion): improve error handling in snapshot persistence - Updated the error handling for the `persist_snapshot` function to enhance clarity in error messages, ensuring that failures are logged with specific context for easier debugging. |
||
|
|
658a75b39e |
feat(triage): reusable trigger triage agent (commit 1 of 3) (#510)
* feat(triage): implement trigger triage agent for external event classification - Introduced a new `trigger_triage` agent to classify incoming external triggers (e.g., Composio webhooks, cron jobs) and determine appropriate actions (drop, acknowledge, react, escalate). - Added `TriggerEvaluated`, `TriggerEscalated`, and `TriggerEscalationFailed` events to the event bus for tracking triage decisions. - Implemented a `TriggerEnvelope` structure to standardize the input for the triage pipeline, ensuring source-agnostic handling of triggers. - Developed a decision parser to interpret classifier outputs and enforce response contracts. - Enhanced the event bus with functions to publish triage-related events, improving observability and logging. - Updated the Cargo.lock to version 0.52.5 to reflect the new changes. * feat(triage): implement trigger triage agent for external event classification - Introduced a new `trigger_triage` agent to classify incoming external triggers (e.g., Composio webhooks, cron jobs) and determine appropriate actions (drop, acknowledge, react, escalate). - Added `TriggerEvaluated`, `TriggerEscalated`, and `TriggerEscalationFailed` events to the event bus for tracking triage decisions. - Implemented a structured decision parser and a triage pipeline that processes triggers and applies decisions based on the classifier's output. - Enhanced the Composio integration to utilize the new triage functionality, ensuring seamless handling of incoming events. - Updated tests to validate the new triage logic and ensure correct behavior across various scenarios. * feat(triage): enhance triage evaluation with retry logic and error handling - Introduced a configuration-based approach to resolve providers for triage turns, allowing for retries on local failures by falling back to remote providers. - Added a `TurnOutcomeFailure` struct to encapsulate recoverable errors during triage processing, enabling clearer error reporting and decision-making for retries. - Implemented caching for provider decisions to optimize performance and reduce redundant configuration loads. - Enhanced the `run_triage` function to handle local and remote execution paths, improving resilience against transient failures. - Updated the `resolve_provider` function to support both local and remote provider resolution based on configuration settings, ensuring flexibility in triage operations. - Improved logging for error scenarios to aid in debugging and monitoring triage outcomes. * refactor(triage): improve error handling and code formatting in evaluator and routing - Enhanced error handling in the `run_triage` function to improve clarity when both local and remote executions fail. - Refactored code formatting in the `cache_snapshot` and `decide_fresh` functions for better readability. - Updated test assertions for improved clarity and consistency in formatting, ensuring better maintainability. * feat(triage): local routing + real subagent escalation + trigger_reactor agent (commit 2 of 3) - Rewrite routing.rs with local-vs-remote provider resolution: LocalAiService adapter wrapping Ollama behind the Provider trait, ModelTier floor check (>= Ram4To8Gb), 60s decision cache with Local/Remote/Degraded states, and mark_degraded() for the retry path. - Add parse-failure / local-failure → remote retry in evaluator.rs: TurnOutcomeFailure wrapper distinguishes local vs remote errors; run_triage retries once on remote when used_local=true and marks the routing cache Degraded so subsequent triggers skip local. - Wire real escalation in escalation.rs via run_subagent: builds a full Agent from config, extracts a ParentExecutionContext from its accessors, installs it via with_parent_context, and calls run_subagent for react (trigger_reactor) / escalate (orchestrator). - New trigger_reactor built-in agent (agents/trigger_reactor/): narrow tool scope (memory_recall, memory_store, read_workspace_state, spawn_subagent), agentic model hint, max 6 iterations. - 33 triage tests passing (routing cache, tier scoring, retry path with stateful stub, local parse failure eligibility). * feat(triage): add triage_evaluate schema and handler for trigger evaluation - Introduced a new controller schema for `triage_evaluate`, enabling the trigger-triage classifier to process synthetic trigger payloads for testing and replay. - Implemented the corresponding handler to manage the evaluation process, returning parsed decisions and timing metadata. - Enhanced the input structure to include required and optional fields for comprehensive trigger evaluation, including support for dry runs. * feat(triage): expose RPC surface + default-on (commit 3 of 3) - Add `openhuman.agent_triage_evaluate` JSON-RPC method to agent/schemas.rs: accepts a synthetic trigger payload with an optional `dry_run` flag. When dry_run=true the decision is not acted on (no sub-agent dispatch). Canonical test/replay hook for exercising the triage pipeline without forging a Socket.IO webhook. - Flip the composio subscriber from opt-in (`OPENHUMAN_TRIGGER_TRIAGE_ENABLED`) to default-on with an opt-out escape hatch (`OPENHUMAN_TRIGGER_TRIAGE_DISABLED`). Every Composio trigger now flows through the triage pipeline unless the env var is explicitly set. - Update composio/bus.rs tests to match the new opt-out semantics. |
||
|
|
403f239ca5 |
refactor: remove QuickJS skills runtime (#508)
* refactor: remove quickjs skills runtime * style: apply repo formatting * refactor: clean up error reporting and connection handling - Removed the 'skill' source option from the error report structure to streamline error reporting. - Refactored the ConnectionsPanel component to simplify connection status badge rendering and improve clarity. - Updated the CronJobsPanel to enhance logging for cron job loading processes. - Adjusted SkillCard component to use a more consistent type for icons. - Deleted outdated end-to-end tests for Gmail and Notion skills, improving test suite maintainability. * fix: remove unnecessary ESLint disable comment in Conversations component - Cleaned up the Conversations component by removing the ESLint disable comment for exhaustive dependencies in the useEffect hook, improving code clarity and maintainability. * fix: remove unnecessary whitespace in Conversations component - Eliminated an extra line of whitespace in the Conversations component, enhancing code readability and maintainability. * refactor: streamline SkillCard imports for improved clarity - Combined import statements in the SkillCard component to enhance code readability and maintainability. |
||
|
|
5420ede6c4 |
fix(entitlements): enable audio input device access in macOS sidecar configuration
- Added a key to the entitlements file to allow audio input device access, ensuring proper functionality for applications utilizing audio features under the macOS Hardened Runtime. |
||
|
|
759691e380 |
feat(composio): improve toolkit sync and connection handling (#507)
* Enhance release workflow with build target input and improved job structure - Added a new input parameter `build_target` to specify the environment (production or staging) for the release process. - Made `release_type` input optional with a default value of `patch`. - Refactored job names and dependencies to reflect the new build target logic, including conditional steps for production and staging environments. - Introduced a `resolve` step to determine build outputs based on the selected environment, enhancing the workflow's flexibility and clarity. - Updated the `create-release` job to depend on the new `prepare-build` job, ensuring proper execution flow based on the build target. * feat(composio): enhance Composio integration with toolkit management and testing - Added `KNOWN_COMPOSIO_TOOLKITS` constant to facilitate access to available toolkits. - Implemented unit tests for `useComposioIntegrations` to ensure correct behavior during toolkit and connection fetching, including error handling scenarios. - Updated `Skills` page to utilize the new `KNOWN_COMPOSIO_TOOLKITS` for improved toolkit display logic. - Refactored hooks to handle connection errors gracefully and maintain toolkit visibility. - Enhanced backend integration by updating Composio client configuration to streamline toolkit management. * refactor(dispatch): remove channel delivery instructions for Telegram - Deleted the `channel_delivery_instructions` function, which provided response guidelines for Telegram messages. This change simplifies the message processing logic in the `process_channel_message` function by eliminating unnecessary instructions, enhancing clarity and maintainability. * refactor(composio): simplify Composio client configuration and remove toggles - Updated the `build_composio_client` function to remove unnecessary configuration checks, as Composio is always enabled when the user is signed in. - Revised the `resolve_client` function to clarify error handling related to user authentication. - Streamlined the `IntegrationsConfig` structure by removing toggles for Composio and related backend settings, ensuring a consistent configuration approach across integrations. - Adjusted tests to reflect the removal of integration toggles and focus on core API key usage. * refactor(composio): remove composio disabled state and improve error handling - Eliminated the `disabled` state from the `useComposioIntegrations` hook, as Composio is always enabled when the user is authenticated. - Updated error handling to surface backend connection issues directly, replacing previous checks for a disabled state. - Revised tests to reflect the new error handling logic, ensuring clarity in toolkit fetch error reporting. * refactor(integrations): update authentication handling for client configuration - Revised the `build_client` function to prioritize app-session JWT for user authentication, enhancing clarity in the fallback mechanism to `config.api_key`. - Improved error messages in `resolve_client` and `build_client` to provide clearer guidance on authentication issues related to session tokens. - Streamlined comments and documentation to reflect the updated authentication flow, ensuring consistency across integration components. * refactor(composio): unwrap CLI envelope for API responses - Introduced a new `unwrapCliEnvelope` function to handle the response format from the Rust side, allowing for easier access to the flat shapes defined in `./types`. - Updated `listToolkits`, `listConnections`, `listTools`, `authorize`, `deleteConnection`, and `execute` functions to utilize the new unwrapping logic, improving response handling consistency across the Composio API. - Enhanced error handling by ensuring that responses without logs pass through unchanged, maintaining backward compatibility. * refactor(skills_agent): update agent description and enhance Composio tool integration - Revised the `when_to_use` description in `agent.toml` to clarify the role of the Skills Agent as a service integration specialist, emphasizing its capability to execute both Composio and QuickJS skill tools. - Expanded the `prompt.md` documentation to detail available tool surfaces and typical Composio flow, improving clarity on how to interact with external services. - Implemented category overrides for Composio tools in `tools.rs` to ensure they are recognized as part of the Skill category, allowing proper access through the skills sub-agent. - Added tests to verify that Composio tools are correctly filtered and accessible by the skills sub-agent, ensuring robust integration and functionality. * style: apply formatter output from pre-push checks * refactor(tests): update Gmail and Notion integration tests for composio - Refactored tests for the Skills page to integrate Gmail and Notion as composio tools, enhancing the testing framework. - Removed mock data and streamlined the test setup to reflect the current state of available skills. - Updated assertions to verify the rendering of connected and disconnected states for Gmail and Notion integrations, respectively. - Improved clarity and maintainability of test cases by consolidating mock implementations and removing redundant code. * refactor(skills): update toolkit categorization and enhance test assertions - Modified the Skills component to assign categories dynamically based on toolkit metadata, improving organization of displayed tools. - Updated test cases to reflect the new categorization, ensuring accurate rendering of tools under their respective categories instead of a generic 'Other' group. - Enhanced assertions in tests to verify the presence of specific tools and their categories, improving test coverage and reliability. * refactor(skills): streamline item creation in Skills component - Simplified the item creation logic in the Skills component by removing unnecessary line breaks, enhancing code readability without altering functionality. - This change contributes to cleaner code structure and maintainability in the Skills page. * refactor(tests): enhance Gmail and Notion integration tests for improved clarity - Updated the integration tests for Gmail and Notion on the Skills page to utilize the `within` function for more precise querying of elements within their respective sections. - Improved test assertions to ensure that the connected and disconnected states are accurately verified, enhancing the reliability of the tests. - Streamlined the test setup to better reflect the current structure of the Skills component, contributing to overall test maintainability. * feat(skills): enhance Composio integration error handling and logging - Added error handling for Composio integrations in the Skills component, displaying a user-friendly message when integration status is stale or an error occurs. - Implemented logging in development mode to provide insights into the state of Composio toolkits and connections, aiding in debugging. - Updated the item rendering logic to reflect the error state, ensuring users can retry fetching integrations when an error is detected. - Enhanced tests to verify the display of error messages and the functionality of the retry mechanism, improving overall test coverage and reliability. |
||
|
|
362d0a014f |
fix(context): preserve cache-boundary metadata through prompt builders (#506)
* feat(prompt): enhance system prompt handling with cache boundary support - Updated the `SystemPromptBuilder` to include a new method for building prompts with cache metadata, returning a `RenderedPrompt` struct that contains the prompt text and an optional cache boundary index. - Introduced a constant for the cache boundary marker to improve readability and maintainability. - Modified the `extract_cache_boundary` function to cleanly remove the cache boundary marker from the rendered prompt while returning the relevant index. - Updated tests to validate the new cache boundary functionality and ensure that the system prompt does not leak internal markers. - Adjusted the agent's session management to track the cache boundary, enhancing the overall prompt handling and memory context management. * feat(context): add method to build system prompt with cache metadata - Introduced `build_system_prompt_with_cache_metadata` method in `ContextManager` to assemble the opening system prompt while preserving cache-boundary metadata for improved request prefix caching. - Updated imports to include `RenderedPrompt` for the new functionality, enhancing the context management capabilities. * feat(prompt): include cache boundary in subagent system prompt rendering - Updated `render_subagent_system_prompt` to insert a cache boundary marker before the workspace section, allowing typed sub-agents to maintain static instructions above this boundary for efficient prompt reuse. - Added a new test to verify that the cache boundary is correctly included in the rendered prompt, ensuring that the system prompt structure supports improved caching behavior. - Adjusted comments for clarity and updated the runtime banner numbering to reflect the new structure. |
||
|
|
69c4fa46cc | chore(release): v0.52.5 | ||
|
|
afb95e72a5 |
refactor(event-bus): native typed request/response surface + channels encapsulation (#505)
* feat(event-bus): introduce typed request/response API for enhanced inter-module communication - Added a typed request/response surface to the existing event bus, allowing modules to execute requests through a shared controller registry. - Implemented `request_global` and `request_controller_global` functions for executing typed requests, enhancing the API's usability. - Updated documentation to reflect the new capabilities and usage patterns for the event bus, including when to use the request API versus traditional event publishing. - Added tests to validate the functionality of the new request/response features, ensuring robust integration with existing event bus operations. * refactor(event-bus): restructure event bus module and update references - Moved the event bus implementation from `src/openhuman/event_bus/` to `src/core/event_bus/`, establishing a clearer module hierarchy. - Updated all references throughout the codebase to reflect the new location of the event bus, ensuring consistency and reducing confusion. - Enhanced documentation to clarify the usage of the event bus and its core types, improving developer experience. - Introduced new files for event handling, requests, and subscribers, streamlining the event bus functionality and making it more modular. - Added tests to validate the new structure and ensure that the event bus operates correctly after the refactor. * refactor(event-bus): enhance event bus with native request/response surface - Updated the event bus to include a native, in-process typed request/response surface, allowing for zero serialization of Rust types and direct communication between modules. - Replaced the previous request API with a more streamlined approach using `register_native_global` and `request_native_global` functions. - Improved documentation to clarify the usage of the event bus, detailing when to use broadcast events versus native requests. - Removed the old request/response implementation to simplify the event bus structure and enhance maintainability. - Added examples and guidelines for registering and using native request handlers, improving developer experience and usability. * feat(agent): introduce native request handlers for agentic turns - Added a new `bus` module to encapsulate native event-bus handlers for the agent domain, including the `agent.run_turn` handler for executing agentic turns. - Updated the event bus registration process to include the new agent handlers, allowing for direct in-process request/response communication without serialization. - Refactored the channel message processing to dispatch agentic turns through the native bus, enhancing modularity and testability. - Improved documentation to clarify the usage of the new agent handlers and their integration with the event bus. - Added tests to validate the functionality of the new request handlers and ensure proper routing through the event bus. * refactor(tests): implement global bus handler lock for channel dispatch tests - Introduced a `use_real_agent_handler` function to manage the global bus handler lock during channel dispatch tests, ensuring exclusive access to the `agent.run_turn` handler. - Updated multiple test files to utilize the new handler function, improving test reliability by preventing race conditions during concurrent test execution. - Enhanced documentation to clarify the usage of the bus handler lock in tests that interact with the global native request registry. * feat(tests): add integration tests for Discord channel dispatch - Introduced a new test file `discord_integration.rs` to validate the end-to-end functionality of the Discord dispatch path within the channels module. - Implemented tests to ensure proper handling of inbound messages, reaction capabilities, and conversation history management specific to Discord. - Updated `mod.rs` to include the new Discord integration tests, enhancing overall test coverage for the channels module. * feat(tests): add Telegram integration tests for channel dispatch - Introduced new tests in `telegram_integration.rs` to validate the end-to-end functionality of the Telegram dispatch path within the channels module. - Implemented tests to ensure proper handling of threaded inbound messages, automatic acknowledgment reactions, and response routing through the agent bus handler. - Enhanced test coverage for Telegram, ensuring that the `supports_reactions()` capability is honored and that the dispatch pipeline operates correctly for both Telegram and Discord channels. * feat(tests): add testing utilities for event bus stubbing - Introduced a new `testing` module in the event bus to provide shared utilities for stubbing the global native bus registry. - Implemented `mock_bus_stub` and `MockBusGuard` to facilitate safe installation and restoration of stub handlers in tests, preventing race conditions. - Updated existing tests to utilize the new mocking utilities, enhancing test reliability and clarity in handling agent bus interactions. - Improved documentation to guide users on using the new testing features effectively. * style(event-bus): clean up formatting and remove unnecessary line breaks - Removed trailing whitespace and unnecessary line breaks in the event bus module files to improve code readability and maintainability. - Consolidated import statements and function definitions for a cleaner code structure across the event bus and agent modules. * fix(memory): point conversations/bus.rs at crate::core::event_bus Incoming `memory/conversations/bus.rs` from upstream/main still imports from the old `openhuman::event_bus` path. This branch relocated the bus to `core::event_bus`, so the merge left the import unresolved and the crate failed to compile. Rewire both references (`use` + fully-qualified `subscribe_global` call) to the canonical `crate::core::event_bus` path. |
||
|
|
986ff7ae4b |
feat(context): global context management module (#504)
* refactor(context): implement layered context pipeline with memory management - Introduced a new context pipeline orchestrator that manages context reduction stages before each provider call, including tool-result budgeting, microcompaction, and session memory management. - Added `ContextGuard` to monitor context utilization and trigger auto-compaction when thresholds are exceeded. - Implemented `microcompact` to replace older tool result payloads with placeholders, preserving API invariants while managing memory effectively. - Created `SessionMemory` to maintain persistent notes across sessions, updated by a background process to avoid impacting performance during user interactions. - Enhanced overall context management to improve memory efficiency and ensure smoother operation of the agent's functionality. * chore(context): add context module and refactor imports - Introduced a new `context` module to centralize context management for agent sessions, enhancing organization and maintainability. - Updated various files to replace references to the deprecated `context_pipeline` with the new `context` module, ensuring consistency across the codebase. - Bumped the version of the `openhuman` package to 0.52.4 in `Cargo.lock` to reflect these changes. * refactor(imports): update prompt module paths to new context structure - Refactored import statements across multiple files to replace references to the deprecated `agent::prompt` module with the new `context::prompt` module. - This change enhances code organization and aligns with the recent restructuring of the context management system. * feat(context): introduce comprehensive context management configuration - Added a new `ContextConfig` struct to manage global context settings, including budget thresholds, summarization triggers, and session-memory extraction parameters. - Implemented environment variable overrides for context management settings, allowing dynamic configuration. - Refactored the configuration loading process to accommodate the new context management structure, ensuring backward compatibility with existing configurations. - Introduced a `Summarizer` trait and default implementation for handling conversation summarization, enhancing the agent's ability to manage context effectively. - Updated related modules to integrate the new context management features, improving overall organization and maintainability of the codebase. * feat(context): implement ContextManager for enhanced session context handling - Introduced a new `ContextManager` struct to manage session context, including prompt assembly, context reduction, and summarization dispatch. - Added methods to `ContextGuard` for tracking input and output token counts, as well as the context window size. - Updated the `mod.rs` files to include the new `manager` module and its exports, improving organization and maintainability of the context management system. - Enhanced overall context management capabilities, allowing for more efficient handling of conversation context during agent interactions. * refactor(context): centralize system prompt assembly for channel runtimes - Moved the system prompt construction logic for channel runtimes into a new `channels_prompt` module within the `context` directory, ensuring all prompt-building code is organized in one location. - Updated various files to replace deprecated references to the old prompt module, enhancing code clarity and maintainability. - Introduced a new `build_system_prompt` function tailored for channel-specific requirements, including tool descriptions and channel-specific preambles, while maintaining byte-stability for cache efficiency. - Refactored related imports and tests to align with the new structure, improving overall organization of the context management system. * style(context): apply rustfmt to context module and integration sites Clippy caught a never-looping `while` in `snap_split_forward` that was really an `if` in disguise — collapse it. Everything else is pure `cargo fmt` cleanup on files touched during the context/ refactor. Full `cargo test --lib` sweep: 2253 tests passing. * delete(config): remove obsolete user configuration file - Deleted the `config.toml` file for user `69ccc8e95692bb0ddd56c10f`, which was no longer needed, streamlining the user configuration management. * refactor(SOUL.md): remove emoji usage guidelines to streamline prompt instructions - Deleted the section on emoji usage to simplify the prompt guidelines, focusing on clarity and direct communication with users. This change aims to enhance the overall effectiveness of the prompts by reducing unnecessary complexity. * refactor(config): enhance environment variable handling for context compaction settings - Improved the parsing and validation of environment variables for `OPENHUMAN_CONTEXT_COMPACTION_TRIGGER_PCT` and `OPENHUMAN_CONTEXT_HARD_LIMIT_PCT`, ensuring that the compaction trigger percentage is strictly less than the hard limit. - Added warnings for invalid percentage values and retained existing configuration values on failure. - Updated the context management logic to handle migration from deprecated fields, ensuring backward compatibility and clearer user guidance. * refactor(context): update tool result budget handling in Agent - Changed the source of the tool result budget to be derived from the ContextManager, ensuring it reflects the resolved `context.tool_result_budget_bytes` with any environment or configuration overrides. - This update removes reliance on the deprecated `agent.tool_result_budget_bytes` field, centralizing budget management for improved consistency across the context management system. * refactor(prompt): enhance subagent rendering options and system prompt construction - Introduced `SubagentRenderOptions` to manage per-definition rendering flags, allowing for more flexible control over the inclusion of identity, safety preamble, and skills catalog in the system prompt. - Updated `render_subagent_system_prompt` to utilize these options, ensuring that the rendering behavior aligns with the specified flags. - Modified `build_system_prompt` to accept an optional `channel_name`, improving clarity in channel capabilities messaging and removing hardcoded references to "Discord". - Adjusted tests to reflect changes in prompt construction, ensuring comprehensive coverage of the new rendering logic. * refactor(context): improve session memory handling in ContextManager - Updated session memory methods in `ContextManager` to use a locked reference for thread safety during extraction state changes. - Introduced a new method `session_memory_handle` to facilitate background task management of session memory extraction. - Adjusted the context statistics to utilize a snapshot of session memory, enhancing data integrity and consistency. * refactor(turn): improve extraction state management in Agent - Updated the extraction state handling to transition to "in-progress" instead of "complete" immediately, allowing for better control during background extraction tasks. - Introduced a shared handle for session memory to manage extraction completion and failure states, ensuring deltas are preserved for retries on failure. - Enhanced logging to provide clearer insights into the extraction process outcomes. |
||
|
|
462b4d2895 |
Move conversation persistence into workspace memory store (#503)
* Move conversation persistence into workspace memory store * Apply formatter updates for conversation persistence * Enhance conversation persistence by registering a new subscriber for channel events. Update domain subscriber registration to include workspace directory, ensuring proper message handling and persistence across channels. Refactor event structure to include message ID and reply target for improved tracking. Additionally, adjust module visibility for context management. |
||
|
|
73f8d1287a |
refactor: remove hardware-related components and streamline service management (#502)
* feat(config): introduce pre-login user directory structure - Added support for a pre-login user directory to encapsulate configuration, memory, and state before any user logs in. This ensures that all initial data is scoped under a dedicated user directory (`users/local`), preventing direct writes to the root `.openhuman` path. - Implemented the `pre_login_user_dir` function to return the appropriate path for the pre-login user. - Updated configuration loading logic to defer disk state creation until the first successful login, enhancing user data management and isolation. - Added tests to verify the correct behavior of the pre-login directory structure. * refactor: remove hardware-related components and streamline service management - Deleted hardware configuration and related tools from the codebase, including `HardwareConfig`, `HardwareTransport`, and associated memory management tools. - Introduced a new `service.ts` module for managing service and daemon commands, consolidating service-related functionalities. - Updated import paths across the application to reflect the removal of hardware references and the addition of the new service management module. - Refactored the `build_system_prompt` function to remove hardware access instructions, focusing on action instructions instead. - Cleaned up the Cargo.toml and Cargo.lock files by removing unused dependencies related to hardware management. * chore: apply formatting and tauri lockfile sync * refactor(tests): extract config file writing logic into a reusable function - Introduced a `write_config_file` function to encapsulate the logic for creating directories and writing configuration files, improving code reuse and readability. - Updated test cases to utilize the new function for writing configuration files, ensuring consistency and reducing duplication. - Added handling for pre-login user directory structure to ensure configuration is correctly written to the appropriate paths. |
||
|
|
1c7318603e |
feat(composio): backend-proxied Composio integration end-to-end (#501)
* feat(composio): add Composio integration module with OAuth support - Introduced a new Composio module for backend-proxied access to various OAuth integrations. - Implemented ComposioClient for handling API requests related to toolkits, connections, and actions. - Added RPC operations for listing toolkits, managing connections, and executing actions. - Registered Composio controllers and schemas for integration with the existing system. - Created a debug script for testing Composio OAuth flow against the live backend. - Updated Cargo.lock to version 0.52.3 to reflect the new changes. * feat(composio): implement Composio connection modal and API integration - Added ComposioConnectModal for managing Composio toolkit connections, mirroring the user experience of existing modals. - Introduced composioApi for backend communication, including functions for listing toolkits, managing connections, and handling OAuth authorization. - Created toolkitMeta for displaying metadata of Composio toolkits in the Skills grid. - Developed hooks for fetching and managing Composio integrations, ensuring real-time updates on connection status. - Updated Skills page to integrate Composio toolkits, providing a seamless user experience for connecting and managing integrations. * chore: update OpenHuman version to 0.52.3 and add debug-composio-trigger script - Bumped OpenHuman package version in Cargo.lock to 0.52.3. - Introduced a new script, debug-composio-trigger.mjs, for Socket.IO live listening of Composio trigger events, facilitating testing and debugging of webhook interactions. * style(composio): apply Prettier + rustfmt from pre-push hook * feat(composio): enhance ComposioConnectModal and improve polling logic - Updated ComposioConnectModal to handle various connection phases more effectively, including 'waiting' for pending connections. - Introduced new refs for managing polling state and in-flight requests to prevent overlapping executions. - Improved error handling during polling, providing clearer feedback on OAuth timeouts. - Added logic to resume polling if the modal opens while an OAuth handoff is in progress. - Refactored connection handling in the modal for better clarity and maintainability. * refactor(composio): improve JSON payload handling and connection verification - Updated debug-composio-login.sh to build JSON payloads using jq for safer handling of toolkit data. - Enhanced connection verification logic in debug-composio-trigger.mjs to prioritize newly created connections and provide warnings for missing toolkits. - Refactored composio operations in ops.rs to return a more explicit error type, improving clarity in error handling across RPC operations. |
||
|
|
57d307ad1e |
feat(agent): simplify harness + trim bundled prompts (#500)
* Add built-in agent definitions and prompts for orchestrator, planner, code executor, skills agent, researcher, critic, archivist, and tool maker - Introduced a new module for built-in agent definitions, allowing for easy addition of agents through a structured format. - Created TOML configuration files for each agent, detailing their properties such as id, display name, usage context, and tool specifications. - Developed corresponding prompt files that outline the responsibilities and rules for each agent, enhancing their functionality and usability. - Implemented a loading function to parse these definitions into usable agent structures, ensuring all agents are correctly initialized and validated. * Remove deprecated archetypes and related components from the multi-agent harness - Deleted the `archetypes.rs`, `dag.rs`, `executor.rs`, and `types.rs` files, which contained the definitions and implementations for agent archetypes, task DAGs, and execution logic. - Updated the `builtin_definitions.rs` and `definition.rs` files to remove references to the now-removed archetypes, streamlining the agent definition process. - Refactored the `mod.rs` file to eliminate unused modules and clarify the structure of the multi-agent harness. - Adjusted comments and documentation to reflect the removal of the DAG orchestration flow, emphasizing the current sub-agent delegation model. * Remove unused `ArchetypeConfig` from schema exports in `mod.rs` to streamline configuration management. * Implement context guard and memory management features in the harness module - Introduced `ContextGuard` to monitor context utilization and trigger auto-compaction when usage exceeds defined thresholds. - Added `scrub_credentials` function to sanitize sensitive information from tool outputs. - Implemented history management functions to trim conversation history and build compaction transcripts. - Created `build_tool_instructions` to generate tool usage guidelines for the system prompt. - Developed `memory_context` functions to manage user memory and relevant context for conversations. - Enhanced the `tool_loop` to integrate the new context management and tool invocation logic. This update improves the agent's ability to manage context effectively, ensuring efficient memory usage and secure handling of sensitive data. * Refactor agent module imports to use the harness instead of loop_ - Updated import paths in `dispatcher.rs`, `memory_loader.rs`, `mod.rs`, `dispatch.rs`, and `startup.rs` to replace references from the `loop_` module to the `harness` module. - This change enhances module organization and aligns with the recent architectural updates in the agent structure. * Remove cost tracking and context assembly modules from the agent structure - Deleted `cost.rs` and `context_assembly.rs` files, which handled token cost tracking and context assembly for the multi-agent harness, respectively. - Updated `mod.rs` files to remove references to the deleted modules, streamlining the agent's organization and focusing on essential components. - This cleanup enhances maintainability and aligns with the current architectural direction of the project. * Remove identity module and related configurations from the agent structure - Deleted the `identity.rs` file, which contained the AIEOS identity handling logic and related structures. - Updated `mod.rs` and other files to remove references to the deleted identity module, streamlining the agent's organization. - This change simplifies the codebase and aligns with the decision to rely solely on OpenClaw markdown files for identity management. * Enhance agent prompts with improved formatting and clarity - Added spacing for better readability in the prompts of the Archivist, Code Executor, Critic, Orchestrator, Researcher, Skills Agent, and Tool Maker agents. - Updated the table formatting in the Orchestrator prompt for consistency and clarity. - These changes improve the overall presentation and usability of agent documentation, making it easier for users to understand agent responsibilities and rules. * Remove REPL functionality and related components from the agent structure - Deleted the `repl.rs` file, which contained the implementation for the interactive REPL. - Removed references to the REPL in `cli.rs`, `mod.rs`, and other related files, streamlining the agent's organization. - Eliminated unused REPL session handling logic from the agent schemas and local AI operations, enhancing maintainability and focusing on essential components. - This cleanup aligns with the current architectural direction of the project, simplifying the codebase. * Refactor imports and clean up configuration exports - Updated import paths in `startup.rs` to include `host_runtime` from the correct module. - Streamlined the export statements in `mod.rs` and `schema/mod.rs` for better organization and clarity. - Removed unnecessary line breaks in the export lists to enhance readability and maintainability of the configuration schema. * Remove unused history management functions and clean up agent module exports - Deleted the `history.rs` and `session.rs` files, which contained functions for managing conversation history and session handling. - Updated `mod.rs` to remove references to the deleted modules and streamline the agent's organization. - Cleaned up import statements in `mod.rs` and other files to enhance clarity and maintainability of the codebase. * Add agent harness module with builder, runtime, and turn management - Introduced a new `harness` module for the `Agent`, encapsulating the `AgentBuilder`, runtime accessors, and turn lifecycle management. - Implemented the `AgentBuilder` fluent API for constructing `Agent` instances with customizable configurations. - Developed the `turn` method to handle user interactions, tool execution, and context management within the agent. - Created a `runtime` module for public accessors and utility functions related to agent operations. - Added comprehensive unit and integration tests to ensure the functionality of the new agent structure and its components. * Remove classifier and traits modules from the agent structure - Deleted the `classifier.rs` and `traits.rs` files, which contained the classification logic and core agent traits, respectively. - Updated `mod.rs` to remove references to the deleted modules, streamlining the agent's organization. - This cleanup enhances maintainability and focuses on essential components of the agent architecture. * Refactor agent prompt structure and remove unused files - Updated the `prompt.rs` file to streamline the orchestrator's logic by removing unnecessary tool documentation references and simplifying the file list. - Deleted several prompt files (`AGENTS.md`, `BOOTSTRAP.md`, `CONSCIOUS_LOOP.md`, `MEMORY.md`, `README.md`, `TOOLS.md`) to declutter the project and focus on essential components. - Adjusted the `harness/mod.rs` file to change module visibility from public to crate-level for better encapsulation. - These changes enhance maintainability and align with the current architectural direction of the project. * Refactor bootstrap file handling and update tests - Simplified the list of bundled prompt files in `prompt.rs` by removing references to `AGENTS.md` and `TOOLS.md`, focusing on essential identity files. - Adjusted the logic for injecting `MEMORY.md` to be optional, ensuring it only appears if it exists. - Updated test cases in `common.rs`, `identity.rs`, and `prompt.rs` to reflect the changes in the bootstrap file structure and ensure accurate validation of the new logic. - These modifications enhance clarity and maintainability of the codebase while aligning with the current project architecture. * Implement agent delegation tools and browser automation features - Introduced new tools for agent delegation, including `ArchetypeDelegationTool`, `AskClarificationTool`, `DelegateTool`, and `SkillDelegationTool`, enhancing the agent's ability to manage tasks through specialized sub-agents. - Added `SpawnSubagentTool` for delegating tasks to sub-agents, allowing for more complex workflows and improved task management. - Implemented browser automation capabilities with `BrowserOpenTool`, enabling secure opening of approved URLs in the Brave Browser. - Enhanced the `BrowserTool` with pluggable backends for improved automation and user interaction. - Added `ImageInfoTool` for extracting metadata from images, supporting future multimodal capabilities. - Organized tools into a new `impl` module structure for better maintainability and clarity in the codebase. * Refactor imports and clean up tool implementations - Updated import statements across various tool implementations to ensure consistency and clarity, particularly in the `traits.rs` file. - Removed unnecessary line breaks and adjusted module paths for better organization. - Cleaned up test files by removing trailing whitespace, enhancing code readability and maintainability. - These changes streamline the codebase and improve the overall structure of tool-related components. * Update built-in definitions and prompt handling for clarity and consistency - Revised the test for built-in agent definitions to dynamically reference the length of `BUILTINS`, enhancing maintainability. - Clarified documentation for the `system_prompt` field in `AgentDefinition`, emphasizing the default behavior and usage of inline prompts. - Simplified the `build_system_prompt` function by removing unnecessary conditional logic, ensuring a more straightforward return of the prompt string. * Enhance agent definition loading and documentation clarity - Updated the `load_file` function to reject definitions with missing or empty `system_prompt`, ensuring custom definitions are properly validated. - Added a new test to verify that definitions lacking a `system_prompt` are correctly rejected, improving robustness. - Clarified documentation for built-in definitions and TOML parsing, emphasizing compile-time guarantees and runtime checks. - Improved the logic for checking the existence of `MEMORY.md` to prevent errors from stray directories, enhancing file handling reliability. |
||
|
|
f181ae1d3b | chore(release): v0.52.4 | ||
|
|
31297ad19d |
refactor(memory): remove GLiNER/GLiREL ingestion phase (#499)
* refactor(memory): replace GLiNER model with heuristic extraction - Removed GLiNER-related code and dependencies from the memory ingestion pipeline, transitioning to a heuristic-only extraction approach. - Updated documentation and comments to reflect changes in extraction methods. - Adjusted tests to ensure compatibility with the new heuristic extraction configuration. - Bumped version of the tokenizers dependency and updated Cargo.lock accordingly. * chore: apply formatting and tauri lockfile sync |
||
|
|
88ae66ae71 | chore(release): v0.52.3 | ||
|
|
9118bfb5d6 |
Fix/skill start issue (#498)
* chore: update .gitignore and bump openhuman version to 0.52.2 - Added `overlay/src-tauri/target/` to .gitignore to prevent tracking of build artifacts. - Updated the openhuman package version from 0.52.0 to 0.52.2 in Cargo.lock files for both the main and app/src-tauri directories. - Enhanced entitlements for macOS Hardened Runtime to allow outbound HTTPS calls and server connections. - Refactored registry operations to use rustls explicitly, improving network reliability on macOS. * refactor(logging): improve debug message formatting in fetch_url_bytes function - Updated the logging statement in the fetch_url_bytes function to enhance readability by formatting the debug message across multiple lines. This change improves clarity in log outputs, making it easier to track the number of bytes fetched from URLs. * feat(skill-setup): enhance OAuth handling and skill status synchronization - Introduced a managed OAuth auto-advance mechanism to ensure it runs only once per login attempt, improving user experience during authentication. - Updated the SkillSetupWizard to handle skill runtime checks more effectively, ensuring that the skill starts correctly and transitions to the setup phase seamlessly. - Enhanced the useSkillSnapshot hook to provide a synthesized offline snapshot when the skill is not yet running, preventing UI stalls during loading. - Implemented background synchronization after OAuth completion to ensure users see fresh data immediately without blocking the UI. - Added tests to validate the new behavior for skills setup completion and status retrieval without requiring the skill to be started first. * refactor(skills): streamline setup_complete retrieval in handle_skills_status function - Simplified the retrieval of the `setup_complete` variable by removing unnecessary line breaks, enhancing code readability and maintainability. - This change improves the clarity of the function's logic without altering its functionality. * refactor(skills): simplify success message and remove initial sync from OAuth flow - Updated the success message in the SkillSetupWizard to remove references to background syncing, streamlining user communication. - Removed the initial sync trigger from the SkillManager after OAuth completion, shifting the responsibility for data synchronization to the user interface or cron jobs. - Adjusted comments in the desktopDeepLinkListener to reflect the new sync behavior, clarifying that initial data sync is no longer automatic. * fix(pr-498): address CodeRabbit review and CI failures - SkillSetupWizard: only show complete after startSetup succeeds; error on failures - hooks: merge prior snapshot into offline fallback; use const arrow for helper - E2E: reset skills_set_setup_complete in finally for isolation - json_rpc_e2e: assert oauth/complete returns start() result; add minimal start() - Skills page tests: mock screen-intelligence/autocomplete/voice hooks (CoreStateProvider) Made-with: Cursor * fix: address follow-up CodeRabbit (readiness poll, shared test mocks) - SkillSetupWizard: waitForSkillRunning after startSkill before startSetup/auth RPC - json_rpc_e2e: poll skills_status until running instead of fixed 400ms sleep - Consolidate Skills page vi.mocks in test/mockDefaultSkillStatusHooks.ts Made-with: Cursor * fix: CodeRabbit — legacy OAuth awaits setSetupComplete, const waitForSkillRunning, mock base - Legacy OAuth: await persistence before complete; error on failure; guard ref + reset on skillId - waitForSkillRunning: const arrow per TS style - mockDefaultSkillStatusHooks: offlineStatusBase spread for shared literals Made-with: Cursor |
||
|
|
7b457aa27d |
feat(agent): pure orchestrator pattern with per-skill delegation tools (#496)
* feat(agent): pure orchestrator pattern with per-skill delegation tools (#478) Refactors the main agent from a direct tool-calling model to a pure orchestrator that delegates all work through dynamically generated tools. Architecture changes: - Orchestrator only sees generated tools (notion, gmail, research, run_code, review_code, plan, spawn_subagent) — skill tools are architecturally unreachable from the main agent - Each installed skill auto-generates a delegation tool at build time (SkillDelegationTool) that routes to skills_agent with the correct skill_filter - Static archetype tools (research, run_code, etc.) delegate to their respective sub-agents - visible_tool_specs filters the function-calling schema sent to the provider, enforcing the orchestrator boundary at the API level Prompt changes: - Rewrote AGENTS.md as a lean orchestrator prompt — no more routing tables or agent_id instructions - Orchestrator skips TOOLS.md, MEMORY.md, HEARTBEAT.md (~6k tokens saved per turn) — subagents get tool specs from the registry - Workspace .md files auto-sync via builtin-hash mechanism so prompt updates ship automatically to existing installs Bug fixes: - ModelSpec::Hint now resolves to {hint}-v1 (e.g. agentic-v1) instead of hint:agentic which the backend rejected - validate_skill_filter now uses skill_id from the engine tuple instead of splitting on __ in the raw tool name (which always failed) - Memory context forwarded to subagents via ParentExecutionContext Observability: - Added [agent] tagged logs for tool responses, agent state transitions, and delegation decisions throughout turn.rs See docs/agent-prompt-architecture.excalidraw for the visual diagram. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: rustfmt orchestrator_tools.rs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: cargo fmt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address CodeRabbit review — dispatch guard, fork specs, decouple sync - Enforce visible-tool allowlist at dispatch time (not just schema) - Fork mode uses visible_tool_specs (not full registry) - De-duplicate spawn_subagent when extending orchestrator tools - Raw tool output moved to debug level, info level logs metadata only - Decouple workspace file sync from prompt rendering so skipped files still get synced to disk Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
b8ded44fbf |
fix(core): send SIGTERM before SIGKILL on sidecar shutdown (#460) (#495)
The Tauri shell's CoreProcessHandle::shutdown() was calling child.kill() which sends SIGKILL on Unix, instantly terminating the core process without giving it a chance to run graceful shutdown hooks. This left the autocomplete Swift overlay helper (unified_helper_bin) orphaned, causing persistent error notifications even after the app was closed. Now sends SIGTERM first and waits up to 5s for the core to exit gracefully (running shutdown hooks that stop the autocomplete engine and quit the Swift helper), then falls back to SIGKILL if still alive. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
e60b9f882d |
refactor(settings): restructure settings page for better UX (#494)
* refactor(settings): restructure settings page for better UX Reorganize settings into 4 clean sections (Account & Billing, Features, AI & Models, Developer Options) and extract developer-oriented options from user-facing panels into dedicated debug panels. - Merge Account & Security + Billing into Account & Billing section - Rename Automation & Channels to Features; add Tools, Voice here - Simplify AI & Skills to AI & Models (just Local AI Model) - Expand Developer Options from 4 to 10 items - Create 4 debug panels: ScreenAwarenessDebug, AutocompleteDebug, VoiceDebug, LocalModelDebug - Simplify 4 user panels by stripping dev knobs (FPS, debounce timers, test harnesses, diagnostics, etc.) - Delete AccessibilityPanel (merged into Screen Awareness) - Add "Advanced settings" link in each simplified panel - Update navigation breadcrumbs for new hierarchy * fix(settings): address PR review feedback on debug panels - Guard null result from openhumanAutocompleteDebugFocus() - Block save/start until full config loaded in AutocompletePanel - Separate poll errors from action errors in LocalModelDebugPanel - Replace useEffect setState with render-time one-shot init in ScreenAwarenessDebugPanel to avoid set-state-in-effect lint rule - Remove unused openhumanLocalAiAssetsStatus call from VoiceDebugPanel * fix(settings): update tests for simplified panel structure - Update ScreenIntelligencePanel test for renamed title, button text, and platform message - Rewrite AutocompletePanel test for simplified panel (dev options moved to AutocompleteDebugPanel) |
||
|
|
8e8da17ad9 |
fix(voice): cross-platform microphone permission handling (#489) (#491)
* fix(voice): add cross-platform microphone permission handling (#489) Voice dictation in release DMG silently fails because the macOS hardened runtime enforces entitlements and the sidecar plist lacked the audio-input entitlement. This adds the entitlement, NSMicrophoneUsageDescription for the system permission prompt, and cross-platform microphone permission detection (CPAL device probe) with clear error messages on macOS, Windows, and Linux. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(permissions): use plist file for infoPlist and fix cross-platform warnings (#489) - infoPlist expects a file path, not inline JSON — create Info.plist with NSMicrophoneUsageDescription and reference it as a string - Move Microphone permission request out of macOS-only cfg block since request_microphone_access() is cross-platform (fixes unused import warning on Linux CI) - Treat persistent Unknown mic permission as Denied per CodeRabbit review Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Cyrus Gray <144336577+graycyrus@users.noreply.github.com> |
||
|
|
49cbbbebaf |
Fix/skill start issue (#493)
* chore: update .gitignore and bump openhuman version to 0.52.2 - Added `overlay/src-tauri/target/` to .gitignore to prevent tracking of build artifacts. - Updated the openhuman package version from 0.52.0 to 0.52.2 in Cargo.lock files for both the main and app/src-tauri directories. - Enhanced entitlements for macOS Hardened Runtime to allow outbound HTTPS calls and server connections. - Refactored registry operations to use rustls explicitly, improving network reliability on macOS. * refactor(logging): improve debug message formatting in fetch_url_bytes function - Updated the logging statement in the fetch_url_bytes function to enhance readability by formatting the debug message across multiple lines. This change improves clarity in log outputs, making it easier to track the number of bytes fetched from URLs. |
||
|
|
a2fb1119ea |
refactor(skills): unify auth/oauth handshake on start({validate}) and drop enabled flag (#484)
* refactor(preferences): streamline skill preference management by removing the enabled toggle - Removed the `enabled` field from `SkillPreference`, simplifying the preference model to focus solely on `setup_complete`. - Updated related methods and RPC handlers to reflect this change, ensuring that skills are automatically started based on the completion of their setup process. - Adjusted tests to validate the new behavior, ensuring consistent functionality without the `enabled` toggle. - Enhanced documentation to clarify the new preference management approach. * refactor(auth): simplify authentication flow by removing onAuthComplete hook - Updated the `handle_auth_complete` function to eliminate the separate `onAuthComplete` JavaScript hook, streamlining the authentication process. - Revised the flow to directly inject new credentials and validate them using the `start` function, which now handles both validation and activation. - Enhanced rollback logic to ensure temporary credentials are cleared if validation fails, preventing persistence on disk. - Improved documentation to clarify the new authentication steps and their implications for credential management. * refactor(oauth): streamline OAuth credential handling in `handle_oauth_complete` - Removed the `build_start_credentials_arg` function and integrated its logic directly into `handle_oauth_complete`, simplifying the flow. - Updated the OAuth handling to validate credentials before persisting them, ensuring that only successful validations are saved. - Enhanced rollback logic to clear temporary credentials if validation fails, preventing incorrect state persistence. - Improved documentation to clarify the new steps in the OAuth process and their implications for credential management. |
||
|
|
0cd0f7a670 |
feat(voice): sync overlay orb with chat voice button state (#487) (#490)
* feat(voice): sync overlay orb with chat voice button state (#487) The overlay orb already reacts to hotkey-based dictation via Socket.IO events, but the chat "Start Talking" button used local React state only. Add a new RPC method `openhuman.overlay_stt_notify` that the chat button calls at each voice state transition, which publishes to the existing DICTATION_BUS / TRANSCRIPTION_BUS broadcast channels — so the overlay reflects recording/transcribing/idle from both input paths with zero changes to the Socket.IO bridge or overlay event handlers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(voice): address CI formatting and CodeRabbit review feedback - Run cargo fmt and prettier to fix formatting violations - Use typed enum OverlaySttState instead of raw String for state param (serde rejects invalid states at deserialization, eliminating the unknown state branch) - Require `text` field for transcription_done state (return error if missing instead of silently ignoring) - Replace raw transcript logging with metadata-only (has_text, text_len) to avoid logging sensitive user speech content - Use "Voice input active" aria-label (covers recording + linger phases) - Convert notifyOverlaySttState to arrow function with async/await per repo TS conventions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
3a2e026346 |
fix(billing): redesign subscription cards and polish billing page UI (#492)
* feat(skills): state-aware cards and setup modals for built-in skills Replace static "Settings" buttons on Screen Intelligence, Text Auto-Complete, and Voice Intelligence skill cards with live status dots, labels, and dynamic CTA buttons (Enable/Setup/Manage/Retry) matching third-party skill UX. Each built-in skill gets: - A status hook deriving card state from core RPC snapshots - A setup/enable modal with step-by-step flows (permissions, enable, success) - Escape key + aria dialog attributes for accessibility Screen Intelligence: permission grant flow → enable → success Text Auto-Complete: one-click enable → success Voice Intelligence: STT model check → enable voice server → success * fix(billing): redesign subscription cards and polish full billing page UI - Redesign plan cards with clear visual hierarchy: name/tagline left, prominent price right, vertical feature checklist with check/X icons, full-width CTA buttons - Add "Popular" badge to Basic plan with accent border and shadow - Add taglines and rewrite features to user-friendly language - Remove confusing technical pills (monthly budget, 7-day cycle, 10-hour cap, discount %) - Hide "Premium-usage discount: 0%" pill for free users - Remove redundant "Why upgrade?" section - Fix double padding (SubscriptionPlans px-4/mx-4 and AutoRecharge px-4 inside parent p-4) - Fix "5-hour cap" label to "10-hour cap" and hide when both values are zero - Fix progress bar background from dark stone-700/60 to light stone-200 - Shorten verbose copy across Current Plan header, divider, and Pay as You Go description * style: apply prettier formatting |
||
|
|
aee9c52e88 |
fix(channels): Telegram threading, live listeners, core restart, and webhook cleanup (#485)
* feat(config): enhance world-readable config warning mechanism - Introduced a new static variable to track previously warned world-readable config files, preventing duplicate warnings. - Updated the warning logic to only log a warning for each unique world-readable config file, improving log clarity and reducing noise. - Added new `ChannelReactionReceived` and `ChannelReactionSent` events to the DomainEvent enum, expanding event handling capabilities in the event bus. - Included tests for the new reaction events to ensure proper functionality and integration. * feat(logging): add log file constraints and event filtering - Introduced functions to parse log file constraints from environment variables and filter log events based on these constraints. - Enhanced the `init_for_cli_run` function to apply the new filtering logic, improving log management and clarity. - Updated the `conversation_history_key` function to include thread context for Telegram, ensuring accurate message targeting. - Added a new trait method `supports_reactions` to the `Channel` trait, indicating support for emoji reactions. - Implemented integration tests for Telegram channel features, including reaction handling and thread message forwarding. * feat(telegram): enhance message handling with reactions and typing indicators - Added support for emoji reactions in Telegram responses, allowing for contextual acknowledgment of user messages. - Implemented a decision heuristic for when to use reactions, improving user interaction quality. - Introduced a typing indicator that activates immediately upon receiving a message, providing instant feedback to users. - Updated the channel delivery instructions to include new reaction syntax and guidelines for usage. - Enhanced tests to cover new reaction handling and message acknowledgment features, ensuring robust functionality. * fix(tests): update route key for Telegram message handling tests - Changed the route key in tests from `telegram_alice` to `telegram_alice_chat-1` to match the updated `conversation_history_key` format for Telegram. - This adjustment ensures accurate routing and consistency in message handling tests. * refactor(tests): streamline message handling in runtime tool calls - Refactored the message handling tests to utilize a `ChannelMessage` struct for improved clarity and maintainability. - Updated the route key generation to use the `conversation_history_key` function, ensuring consistency in message routing. - Simplified the invocation of `process_channel_message` by directly passing the constructed message, enhancing readability. * fix(telegram): enhance finalize_draft method to support thread context - Updated the `finalize_draft` method in the `Channel` trait and its implementation for `TelegramChannel` to accept an optional `thread_ts` parameter, allowing for message threading. - Adjusted related message handling functions to utilize the new parameter, ensuring proper message context during sending. - Modified tests to reflect changes in the `finalize_draft` method signature, enhancing the robustness of message handling in threaded conversations. * refactor(tests): ran format * feat(discord, telegram): implement core process restart on channel connection - Added functionality to restart the core process when a channel connection requires a restart, enhancing the user experience by automating the process. - Implemented error handling to log any issues during the restart, ensuring users are informed to restart the app if necessary. - Updated both Discord and Telegram configuration components to include this new behavior, improving consistency across channel integrations. * feat(core-update): enhance core update logging and error handling - Added warnings for outdated sidecar versions and potential mismatches in UI features, improving user awareness of version compatibility. - Implemented detailed error logging for failed attempts to fetch the latest core release, providing users with clear instructions for manual updates if necessary. - Enhanced logging for reusing existing core RPC endpoints, alerting users to potential issues with stale connections. * feat(channels): implement real-time channel listeners and enhance logging - Added support for real-time channel listeners for Telegram and Discord, ensuring inbound bot messages are polled during `openhuman run`. - Introduced a method to check for configured listening integrations, preventing unnecessary listener spawning when not needed. - Enhanced logging for channel connection events and message handling, providing better visibility into channel operations and user interactions. - Updated the Telegram channel connection to log the count of allowed users and mention-only settings for improved debugging. * chore(dependencies): update openhuman version to 0.51.18 and refactor imports in channel config components - Bumped the openhuman package version from 0.49.17 to 0.51.18 in Cargo.toml and Cargo.lock. - Refactored import statements in DiscordConfig.tsx and TelegramConfig.tsx to maintain consistency and ensure proper functionality. * Implement webhook deletion for long polling in TelegramChannel - Added `delete_webhook_for_long_polling` method to clear the Bot API webhook, enabling `getUpdates` long polling. - Updated error handling in `fetch_bot_username` to call the new method when a 409 conflict indicates an active webhook, allowing for retries after webhook deletion. - Enhanced logging for better traceability of webhook deletion and polling conflicts. * Refactor Discord and Telegram connection handling to ensure channel connection updates are dispatched regardless of restart requirement. Improved error handling during core process restart and enhanced logging for connection status. |
||
|
|
f32c0d59f6 |
fix(billing): normalize TeamUsage API response to prevent crash on navigation (#488)
getTeamUsage() returned raw backend JSON without normalization, so undefined/null numeric fields caused .toFixed() TypeErrors that crashed the billing page. Add normalizeTeamUsage() (matching the existing normalizeCreditBalance pattern), defensive ?? 0 guards on .toFixed() call sites, and switch BillingPanel to Promise.allSettled for partial rendering on API failure. Closes #482 |
||
|
|
ce5523c34f | chore(release): v0.52.2 v0.52.2 | ||
|
|
ca4ea9bb12 | chore(release): v0.52.1 | ||
|
|
6410db1fad |
feat(thu-fullrun): overlay attention, skills sync, credits & settings refresh (#479)
* Update Conversations component to enhance user messaging for budget limits. Changed the warning text for exhausted weekly inference budget to improve clarity and user experience. * feat(schemas): add new configuration option for vision model usage - Introduced a new optional boolean field `use_vision_model` in the schemas for enabling vision LLM for screenshot analysis. - Updated the screen intelligence schemas to include a required `consent` field for starting sessions, replacing the previous `sample_interval_ms` field. - Enhanced the `ttl_secs` field description for clarity and modified the `capture_policy` to `screen_monitoring` for better understanding of its purpose. * feat(CoreStateProvider): enhance state management with optimistic updates and error handling - Implemented optimistic local commits for `setAnalyticsEnabled` and `setOnboardingCompletedFlag` to provide instant UI feedback while ensuring state consistency through authoritative snapshot refreshes. - Added error handling for the `refresh` function calls in `setAnalyticsEnabled`, `setOnboardingCompletedFlag`, and `clearSession` to log failures, improving robustness in state management during user interactions. - Updated dependencies in the `useCallback` hooks to include `refresh`, ensuring proper state updates and synchronization with the core. * feat(paths): centralize runtime path resolution for user-scoped skills data - Introduced a new module `paths.rs` to handle the resolution of runtime paths for skills, ensuring that `skills_data` and `workspace` directories are scoped per user. - Updated `bootstrap_skill_runtime` and `bootstrap_skills_runtime` functions to utilize the new path resolution logic, improving consistency and clarity in directory management. - Enhanced error logging for directory creation failures to include the specific path that failed, aiding in debugging. - Added a new optional field `overlay_ttl_ms` in the autocomplete schemas to support overlay time-to-live configuration. * feat(ScreenIntelligencePanel): optimize config synchronization to prevent user edit clobbering - Introduced a reference to track the last synced configuration signature, ensuring that user edits are preserved during periodic updates from the CoreStateProvider. - Updated the effect to compare serialized configuration values, allowing for re-sync only when actual changes occur, enhancing user experience and preventing unintended data loss. * feat(SkillManager): implement initial sync after OAuth completion - Added functionality to trigger an initial data sync immediately after OAuth completion, ensuring users see fresh data without waiting for the next scheduled sync. - Updated comments to clarify the change in sync behavior due to recent modifications in the Rust core, which no longer auto-triggers sync on OAuth completion. * fix(UsageLimitModal, Conversations): enhance user messaging for budget limits - Updated warning messages in both UsageLimitModal and Conversations components to provide clearer information regarding weekly limits and reset times. - Improved clarity in user notifications to enhance overall experience when budget limits are reached. * refactor(SkillSetupModal): improve session mode handling for skill configuration - Updated the SkillSetupModal component to lock the mode at mount time, ensuring users remain in the setup wizard during their session even if the skill is marked as complete. - Simplified mode management by replacing the forceSetup state with a sessionMode state, allowing explicit mode switching while maintaining a consistent user experience. * feat(SkillManager): enhance setup flow for OAuth-based skills - Updated the `startSetup` method to handle OAuth-based skills more effectively by implementing a fallback to core RPC for skills without a frontend runtime. - Improved error handling to treat missing `onSetupStart` implementations as successful completion for pure OAuth skills, allowing the setup wizard to display the "Connected!" screen. - Added detailed logging for both local runtime and core RPC fallback scenarios to improve traceability during the setup process. * feat(Home): enhance local AI status handling and asset management - Introduced a new state for local AI assets, allowing for better tracking of model file readiness. - Updated the loading logic to fetch both local AI status and assets concurrently, improving performance and error handling. - Implemented a mechanism to hide the Local Model Runtime card once all models are fully downloaded, enhancing user experience. - Added comprehensive comments to clarify the logic behind model readiness checks based on asset states. * refactor(Credits): update credit balance structure and terminology - Renamed credit categories in the RewardsCouponSection and PayAsYouGoCard components for clarity, changing "General credits" to "Promo credits" and "Top-up credits" to "Team top-up." - Updated the credit balance API to reflect the new structure, replacing `balanceUsd` and `topUpBalanceUsd` with `promotionBalanceUsd` and `teamTopupUsd`. - Adjusted normalization logic in the credits API to accommodate the new credit balance fields. - Modified tests to ensure correct handling of the updated credit balance structure. * feat(Settings): reorganize billing settings and update descriptions - Added a new top-level billing section to the settings, promoting it out of the Account & Security category for better visibility. - Updated the description for the Account & Security section to remove billing references, focusing on recovery phrase, team management, and linked account access. - Adjusted the settings navigation to accommodate the new billing section, ensuring proper routing and user experience. * refactor(Config): change logging level from info to debug for environment overrides - Updated logging statements in the Config implementation to use debug level instead of info, reducing verbosity during runtime while maintaining necessary traceability for configuration loading. * feat(Overlay): implement overlay attention event handling and refactor overlay app structure - Introduced a new overlay module to manage attention events, allowing the core to publish messages to the overlay window. - Enhanced the OverlayApp component to handle dictation and attention events, improving user interaction with the overlay. - Refactored the overlay state management to support different modes (idle, stt, attention) and added auto-dismiss functionality for attention messages. - Removed the Browser Access Toggle from the Skills page, streamlining the UI and focusing on core functionalities. - Updated tests to reflect changes in the Skills component and removed unnecessary mocks related to browser access. * fix(OverlayBubbleChip): reset typewriter animation on new bubble identity - Updated the OverlayBubbleChip component to reset the typewriter animation correctly when a new bubble is displayed by using the `key` prop. - Refactored the cleanup logic in the useEffect hook to ensure proper interval management and state reset, enhancing the user experience with bubble transitions. * refactor(rest): streamline key_bytes_from_string function and improve readability - Simplified the condition for checking the ASCII key length and character restrictions in the key_bytes_from_string function. - Consolidated the import statements for base64 engines into a single line for better clarity. - Adjusted test data formatting for improved readability in the key_bytes_from_string_tests module. * enhance(logging): improve color detection logic for terminal output - Updated the color detection logic in the logging module to prioritize environment variables (`NO_COLOR`, `FORCE_COLOR`, `CLICOLOR_FORCE`) for better control over color output. - Added detailed comments explaining the color resolution order, enhancing code clarity and maintainability. * test(Home): add mock for openhumanLocalAiAssetsStatus in tests - Enhanced the Home and HomeBootstrapButtons test files by adding a mock implementation for openhumanLocalAiAssetsStatus, which resolves to an object with null result and empty logs. This improves the test setup for local AI asset status handling. * refactor(SkillSetupModal): improve session mode handling and loading state - Updated the SkillSetupModal component to ensure session mode is determined after the first snapshot resolution, preventing premature defaults to the setup wizard. - Introduced a loading state to display a message while waiting for the skill setup status, enhancing user experience during the modal's initial render. - Refactored the SkillManager to throw errors for real failures during setup, ensuring proper error handling and user feedback. * refactor(Config): simplify logging for invalid proxy scope values - Consolidated the logging statement for invalid OPENHUMAN_PROXY_SCOPE values into a single line, improving code readability while maintaining the warning functionality. |
||
|
|
6465f3d314 |
feat(agent): sub-agents, reasoning→agentic routing, layered context pipeline (#474)
* Enhance agent architecture with sub-agent support and memory optimizations - Refactored the `Agent` struct to use `Arc` for shared ownership of the provider, tools, and tool specifications, enabling efficient memory management and concurrent access. - Introduced a `NullMemoryLoader` to optimize memory usage for sub-agents, allowing them to operate without incurring the cost of memory recall. - Added new methods in the `Agent` implementation to facilitate sharing of the provider, tools, and tool specifications with sub-agents, enhancing their operational efficiency. - Implemented a new `SystemPromptBuilder` method for constructing prompts specifically for sub-agents, ensuring they receive tailored context while minimizing unnecessary information. - Established a framework for loading custom agent definitions from TOML files, allowing for dynamic agent configuration and specialization. - Introduced a `ForkContext` to support efficient sub-agent execution in fork mode, leveraging shared resources for improved performance and reduced token usage. * Enhance agent definition management and sub-agent functionality - Introduced a global `AgentDefinitionRegistry` to manage built-in and custom agent definitions from TOML files, ensuring idempotent initialization. - Added new RPC handlers for listing, fetching, and reloading agent definitions, improving the flexibility of agent management. - Refactored the `Agent` struct to streamline sub-agent execution, including enhancements to the task execution flow and context handling. - Updated the orchestrator configuration to support fork mode for sub-agents, optimizing resource usage and performance. - Improved error handling and logging for agent definition loading and initialization processes, enhancing system reliability. * Add end-to-end test for sub-agent spawning and response integration - Implemented a new asynchronous test to validate the full path of a parent agent issuing a `spawn_subagent` tool call. - The test ensures that the sub-agent's output is correctly folded into the parent's response, verifying the interaction between the parent agent and the sub-agent. - Enhanced the `AgentDefinitionRegistry` to support global initialization of built-in agents, ensuring consistent behavior across tests. - Updated the handling of tool calls and memory configuration to facilitate the new test scenario, improving overall test coverage for agent interactions. * Enhance agent tool filtering with category support - Introduced a new `category_filter` in `AgentDefinition` to restrict tool visibility based on their category (System or Skill). - Updated the `from_archetype` function to apply the category filter for the `SkillsAgent` archetype. - Modified `SubagentRunOptions` to include a `category_filter_override` for dynamic filtering during sub-agent execution. - Enhanced the `filter_tool_indices` function to incorporate category filtering logic, ensuring tools are correctly filtered based on their defined categories. - Updated relevant tests to validate the new category filtering functionality, improving overall test coverage for agent interactions. * Implement layered context reduction pipeline for agent - Introduced a new `context_pipeline` module to manage a layered context reduction strategy, enhancing memory efficiency during agent interactions. - Added stages for tool-result budgeting, history trimming, microcompaction, autocompaction, and session memory extraction, each with specific triggers and cache implications. - Updated the `Agent` struct to include a `context_pipeline` field, ensuring state persistence across turns. - Enhanced the `AgentBuilder` to initialize the context pipeline by default. - Implemented tests to validate the functionality and stability of the context pipeline, ensuring consistent behavior across agent sessions. - Refactored relevant components to integrate the new context management features, improving overall agent performance and memory handling. * Enhance agent context pipeline with tool result budgeting and microcompaction - Renamed variable for clarity in tool execution result handling. - Implemented a new stage in the context pipeline to apply a byte budget to tool results, ensuring efficient memory usage. - Added logging for budget application, including details on original and final byte sizes. - Integrated microcompaction stages before tool calls to manage history and reduce memory footprint, with appropriate logging for outcomes. - Updated the agent's session memory management to track turn counts, facilitating better resource handling across iterations. * Refactor agent context pipeline for session memory extraction and tool call management - Simplified method calls in the `Agent` struct for clarity and efficiency. - Enhanced session memory extraction logic to spawn a background archivist sub-agent when thresholds are met. - Improved context pipeline handling for tool call recording and usage tracking. - Updated documentation and comments for better understanding of session memory extraction process. - Refactored microcompact function for cleaner code structure and readability. * refactor(agent): split agent.rs into focused submodules - Convert agent.rs (1988 lines) into agent/ folder with six files: * types.rs — Agent + AgentBuilder struct defs * builder.rs — AgentBuilder fluent API + Agent::from_config factory * turn.rs — turn lifecycle, tool dispatch, context pipeline wiring * runtime.rs — public accessors, run_single/run_interactive, helpers * tests.rs — integration tests with shared fakes * mod.rs — glue + top-level `run` convenience function - Drop misc external inspiration references from doc comments in the context_pipeline module and fork_context — the files now stand on their own design language. * fix(agent): address review comments on sub-agent + context pipeline PR Inline comment fixes: - definition.rs: YAML/TOML inconsistency — module doc, PromptSource, source bookkeeping, and load() all now uniformly document the TOML format. - subagent_runner.rs: render_subagent_system_prompt previously only appended PromptSource::Inline bodies, silently dropping PromptSource::File content. Thread the preloaded archetype_body through as an explicit &str parameter so both source variants render. Drops the unused SystemPromptBuilder + tools_for_prompt wiring while we're here. - prompt.rs: remove DateTimeSection from SystemPromptBuilder::for_subagent. Local::now() would make the sub-agent system prompt change per call and break KV-prefix cache stability. Document the invariant. Nitpick fixes: - agent/turn.rs: drop the no-op mark_extraction_started() call — the immediately-following mark_extraction_complete() clears the in-flight flag anyway. - context_pipeline/pipeline.rs: call guard.record_compaction_success() on microcompact success so a prior streak of autocompaction failures doesn't leave the circuit breaker tripped after a successful reduction. - context_pipeline/tool_result_budget.rs: remove the unnecessary out.clone() in the truncation return — capture final_bytes first, then move out. - definition_loader.rs: replace brittle reg.len() == 10 with assert!(reg.len() > 1) plus the existing targeted .get() checks. - executor.rs: tracing::warn! on unknown sandbox override values so typos surface during development; explicitly accept "none" and empty string as valid defaults. - fork_context.rs: add parent_context_visible_inside_scope test mirroring fork_context_visible_inside_scope, with minimal stub Provider/Memory impls so the test stays self-contained. - schemas.rs: drop redundant serde_json::to_value(serde_json::json!(...)) wrapping in handle_list_definitions + handle_get_definition. - event_bus/events.rs: add SubagentSpawned/SubagentCompleted/SubagentFailed cases to all_variants_have_correct_domain. - tools/ops.rs: add all_tools_includes_spawn_subagent regression test. - tools/spawn_subagent.rs: sort/dedup the known skill list in place instead of cloning into a second vec. Tests: 2316 passed / 0 failed (up from 2314; two new tests added). fmt + clippy clean on all touched files. * udpate prompts * Enhance AgentBuilder and runtime with event context and interactive CLI improvements - Added `event_context` method to `AgentBuilder` for setting `session_id` and `channel` for `DomainEvent`s, improving event tagging and correlation. - Updated `run_interactive` method in `Agent` to dispatch messages through `run_single`, ensuring consistent lifecycle event handling and error sanitization for interactive turns. * Optimize configuration handling in AgentBuilder by lazily creating Arc for full config in reflection hook. This change reduces unnecessary cloning when learning is enabled, improving performance. * Add fork-mode test for sub-agent spawning in agent - Introduced a new test, `turn_dispatches_spawn_subagent_in_fork_mode`, to validate the behavior of the agent when spawning a sub-agent in fork mode. - The test ensures that the parent agent correctly processes the sub-agent's output and maintains the expected response sequence. - Enhanced the test setup with a mock provider and memory configuration to simulate the agent's environment effectively. * Refactor sync RPC handling in skills to treat missing onSync as no-op - Updated the `handle_sync` function to log a debug message and return a no-op response when a skill does not implement the `onSync` handler, preventing unnecessary RPC errors for skills that do not require periodic syncs. - This change improves logging clarity and reduces error noise in logs and dashboards for skills that are not designed to handle sync operations. |
||
|
|
d5822ffcaf |
Integrate Rewards page with backend Discord roles and achievements (#475)
* Integrate rewards page with backend rewards data * Refactor Rewards component to improve loading state and calculation logic - Removed redundant loading state management in the Rewards component. - Updated the calculation of unlocked and total rewards to derive values from the achievements array when necessary, enhancing accuracy. - Adjusted the display logic to reflect the new calculation method for better clarity. Enhancements in the rewards API include improved error handling for backend failures, ensuring robust user feedback during data retrieval. Added a utility function to validate numeric values, enhancing data normalization for achievements. Updated tests to cover new error handling scenarios and ensure consistent behavior across the rewards API. * Refactor Rewards component for improved readability - Adjusted the formatting of the unlocked rewards calculation for better clarity and maintainability. - Ensured consistent code style in the Rewards component, enhancing overall readability. These changes contribute to a cleaner codebase and facilitate future modifications. |
||
|
|
a1f8bc55c4 |
Improve upsell flow and retire legacy overlay app (#473)
* fix(autocomplete): disable autocomplete feature by default - Updated the default configuration for the Autocomplete feature to be disabled instead of enabled in both the frontend and backend configurations. This change aims to improve user experience by preventing unintended activations of the autocomplete functionality upon application startup. * feat(overlay): enhance overlay window functionality and responsiveness - Updated the OverlayApp component to dynamically adjust its size and position based on the overlay status (idle/active), improving user interaction. - Introduced new constants for overlay dimensions and margins, enhancing visual consistency. - Implemented hover effects to adjust opacity, providing better visual feedback. - Refactored window resizing and positioning logic to ensure the overlay remains user-friendly and visually appealing across different scenarios. - Updated macOS window level to NSScreenSaverWindowLevel for improved behavior in fullscreen and multi-space environments. * feat(dependencies): add objc2-core-graphics and related packages - Introduced `objc2-core-graphics` as a new dependency in the Cargo.toml for macOS support. - Updated Cargo.lock to include `objc2-metal`, `block2`, and `libc` as dependencies for enhanced functionality. - Refactored overlay window configuration to utilize `CGShieldingWindowLevel`, improving window behavior in macOS environments. * refactor(billing): remove storage limits and update plan budgets - Removed `storageLimitBytes` from the `PlanMeta` interface and all plan definitions, simplifying the billing structure. - Updated the `Free` plan to have zero budgets for monthly and weekly usage, aligning with the new billing strategy. - Adjusted the `BillingPanel` and related components to conditionally display budget information based on the updated plan values. - Enhanced the `InferenceBudget` and `PayAsYouGoCard` components to reflect changes in budget handling and improve user messaging. - Updated tests to ensure consistency with the new billing logic and removed references to storage limits. * feat(upsell): enhance GlobalUpsellBanner and PayAsYouGoCard components - Added the GlobalUpsellBanner component to the App, improving user visibility of upgrade options. - Refactored PayAsYouGoCard to better handle credit balance calculations, separating promo and top-up credits for clarity. - Updated the UpsellBanner styles for a more consistent visual presentation. - Introduced normalization functions in creditsApi to ensure robust handling of credit balance data. - Added tests for creditsApi to validate the normalization logic and prevent UI crashes with missing data. * feat(upsell): reintroduce GlobalUpsellBanner in App and enhance UpsellBanner styling - Added the GlobalUpsellBanner back into the App component to improve user visibility of upgrade options. - Updated the UpsellBanner component to include a new `rounded` prop for customizable styling. - Removed dismissible functionality from the GlobalUpsellBanner, streamlining the user experience. - Enhanced visual presentation by adjusting CSS styles for better consistency. * refactor(overlay): remove obsolete overlay files and configurations - Deleted unused files including .gitignore, index.html, package.json, postcss.config.js, README.md, tailwind.config.js, tsconfig.json, vite.config.ts, and yarn.lock from the overlay directory. - Removed all source files related to the overlay functionality, including App.tsx, main.tsx, parentCoreRpc.ts, styles.css, and various components. - Cleaned up the src-tauri directory by removing configuration files, icons, and capabilities related to the overlay, streamlining the project structure. - This commit enhances maintainability by eliminating legacy code and unused resources. * refactor(rewards): move DISCORD_INVITE_URL to a separate utility file - Refactored the Rewards component to import the DISCORD_INVITE_URL from a new links utility file, improving code organization and maintainability. - Created a new links.ts file to centralize URL constants, enhancing clarity and reusability across the application. * style(app): apply formatter hook fixes * chore(dependencies): remove @heroicons/react from yarn.lock - Deleted the entry for @heroicons/react@^2.2.0 from yarn.lock, streamlining dependency management and reducing potential conflicts. |
||
|
|
38eb934242 |
Add coupon redemption to Rewards page (#471)
* Add coupon redemption to Rewards page * Format Rewards coupon changes * refactor: enhance coupon redemption logic and error handling in Rewards section - Updated the coupon redemption process to utilize Promise.allSettled for improved error handling during state refresh. - Adjusted the display logic for redeemed coupons to ensure clarity when no rewards are available. - Refactored the normalization of coupon redeem results to streamline data extraction from the API response. These changes improve the robustness and user experience of the Rewards feature. * test: add unit tests for coupon redemption and balance display in Rewards section - Introduced a new test case to validate the display of pending coupon messages and ensure the current balance remains unchanged until the reward is fulfilled. - Enhanced existing tests for the `redeemCoupon` function to verify the unwrapping of nested success/data payloads. - Updated the `RewardsCouponSection` component to improve the conditional rendering logic for better clarity. These changes enhance test coverage and ensure the correctness of coupon handling in the Rewards feature. * test: simplify data structure in redeemCoupon test case - Refactored the `redeemCoupon` test case to streamline the data structure for the success response, enhancing readability and maintainability. - This change improves the clarity of the test while ensuring it continues to validate the unwrapping of nested success/data payloads effectively. |