mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
59cb250e99fc90d376f5f7cc73aaec656e8830b1
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c134d96056 |
fix(skills): route sync RPC to onSync handler and persist state to memory (#183)
* feat(debug): add script for Notion sync memory verification and enhance memory persistence - Introduced `debug-notion-sync-memory.sh` to facilitate live testing of the Notion skill with memory verification. - The script validates the full flow from skill start to memory persistence, ensuring required environment variables are set. - Updated `handle_skills_sync` to change the RPC method from `skill/tick` to `skill/sync` for better clarity in the sync process. - Implemented `persist_state_to_memory` function to ensure published ops state is saved to memory after sync, cron, and tick events. - Enhanced end-to-end tests to validate memory persistence during skill sync and tick operations, ensuring robust functionality. This update improves the debugging process for the Notion skill and enhances the overall reliability of memory operations. * style: apply cargo fmt formatting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(memory): implement background memory-write worker for skill state persistence - Introduced a `MemoryWriteJob` struct to encapsulate the details of memory write operations. - Added a bounded background worker using `tokio::spawn` to handle memory writes asynchronously, improving performance and responsiveness. - Updated `persist_state_to_memory` to queue memory write jobs instead of executing them directly, allowing for better flow control and error handling. - Enhanced logging for memory persistence operations to provide clearer insights into success and failure cases. - Modified event handling in `handle_message` to ensure state persistence occurs only after successful operations, reducing the risk of data loss. This update significantly enhances the memory management capabilities of the skill instance, ensuring more reliable state persistence. * feat(skills): enhance skills synchronization and memory persistence - Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations. - Updated `persist_state_to_memory` to include a memory write transaction, ensuring state persistence is handled more robustly and efficiently. - Enhanced event handling in `handle_message` to ensure memory writes are queued correctly, improving the reliability of state persistence during skill operations. These changes improve the overall functionality and reliability of skills synchronization and memory management. * feat(skills): enhance skills synchronization and memory persistence - Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations. - Updated `persist_state_to_memory` to include a `memory_write_tx` parameter, allowing for more efficient state persistence in the event loop. - Enhanced tests for skills synchronization to ensure robust memory handling and state persistence during skill operations. This update improves the reliability and traceability of skills synchronization processes, ensuring better memory management and debugging capabilities. * refactor(tests): update JSON-RPC sync handling in end-to-end tests - Enhanced comments in `json_rpc_skills_runtime_start_tools_call_stop` to clarify the sync process routing through the `skill/sync` RPC. - Updated assertions in `skills_sync_rpc_calls_on_sync_not_on_tick` to ensure proper handling of the new sync flow, verifying that the `skills_sync` method routes correctly to `onSync`. - Improved logging for better observability during skill synchronization tests, ensuring that the expected behavior aligns with the updated RPC structure. These changes improve the clarity and reliability of the end-to-end tests related to skills synchronization. * feat(env): enhance environment configuration for skills development - Updated `.env.example` to include `SKILLS_LOCAL_DIR` for local skills source directory, allowing developers to specify a path for skill discovery and installation. - Improved comments in the environment file to clarify the usage of `SKILLS_REGISTRY_URL` for both remote and local paths, enhancing the development experience. - Refactored `qjs_engine.rs` to prioritize the `SKILLS_LOCAL_DIR` for skill source directory resolution, improving local development workflows. - Added utility functions in `registry_ops.rs` to support local file path handling for skill registries, enhancing flexibility in skill management. These changes streamline the development process for skills by providing clearer configuration options and improving local development capabilities. * feat(tests): enhance skills directory discovery in test files - Updated `try_find_skills_dir` function across multiple test files to include support for the `SKILLS_LOCAL_DIR` environment variable, improving the flexibility of skills directory resolution. - Enhanced comments to clarify the order of directory search priorities, ensuring better understanding for developers. - Improved error handling and logging for cases where the specified directory does not exist, aiding in debugging and test reliability. These changes streamline the skills directory discovery process in tests, enhancing the overall development experience. * feat(tests): enhance skills directory discovery in test files - Updated `try_find_skills_dir` function to include support for the `SKILLS_LOCAL_DIR` environment variable, allowing for more flexible skills directory resolution. - Improved documentation to clarify the priority order for skills directory discovery. - Refactored multiple test files to utilize the updated skills directory discovery logic, enhancing consistency and maintainability across tests. These changes streamline the skills directory discovery process in tests, improving the overall testing framework. * refactor(tests): streamline memory client verification in Notion live tests - Updated the memory client verification process in `notion_live_with_real_data` to utilize `MemoryClient::new_local()` for improved clarity and consistency. - Enhanced comments to clarify the memory store check location and removed redundant error handling for workspace directory creation. - Simplified the error logging to focus on the memory client creation failure, improving readability and maintainability of the test code. These changes enhance the reliability of memory verification in the Notion live tests, ensuring a clearer understanding of the memory client initialization process. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |