Commit graph

45 commits

Author SHA1 Message Date
Max
2993b0b946 feat(messenger): enhance dynamic SMTP resolution and identity handling
- Implemented dynamic SMTP provider resolution based on user/team context, improving email sending capabilities.
- Updated the Send and SendT methods to utilize identity information from the context for dynamic provider selection.
- Refactored cloud encryption and decryption methods to delegate to the setting package, streamlining cryptographic operations.
- Enhanced team invitation email sending to include identity context, ensuring accurate user/team information is used.
- Removed obsolete crypto helper functions, simplifying the codebase and improving maintainability.
2026-05-04 18:15:21 +08:00
Max
8fdd1a3a6c feat(robot): add workspace support to robot management
- Introduced a new `workspace` field across various robot-related structures, including `CreateRobotRequest`, `UpdateRobotRequest`, and `RobotResponse`, allowing for better organization and management of robots within specific workspaces.
- Updated database queries and response mappings to accommodate the new workspace field, ensuring seamless integration with existing functionalities.
- Enhanced agent execution context to include workspace information, improving the contextual awareness of agents during operations.
- Added tests to validate the creation and updating of robots with workspace data, ensuring robust functionality and backward compatibility.
2026-03-28 16:59:52 +08:00
Max
14426327dd chore(logging): enhance logging and context management in agent and sandbox components
- Updated logging in various methods to include detailed traces for better monitoring of execution flow, including assistantID and chatID.
- Improved context management by ensuring proper release of resources and tracking of execution durations in agent calls.
- Added heartbeat logging in the Claude parser to monitor stream processing and prevent potential issues with long-running tasks.
- Refined the .gitignore file to exclude additional markdown files in the sandbox directory.
2026-03-25 22:00:58 +08:00
Max
2b0ac0d270 refactor(agent): update buildAgentContext to include assistantID
- Modified the buildAgentContext function to accept assistantID as a parameter, enhancing the context building process for agent calls.
- Updated multiple Call methods to pass the assistantID, ensuring proper context management during agent interactions.
2026-03-25 18:03:48 +08:00
Max
427c38bac7 fix(robot): improve locale handling in agent context
- Updated agent context to ensure locale is propagated correctly, defaulting to "en" when no locale is provided. This change enhances internationalization support and ensures consistent behavior across different contexts.
- Adjusted test assertions to reflect the updated execution trigger logic for times mode robots, allowing for a maximum of 2 triggers instead of 1.
2026-03-25 15:18:02 +08:00
Max
c4696380f4 feat(robot): implement global phase agent resolution for improved agent configuration
- Introduced a new global phase agent resolver to streamline agent ID retrieval for various robot pipeline phases, enhancing flexibility in agent configuration.
- Updated existing phase agent retrieval logic to prioritize per-robot configurations, falling back to global settings when necessary.
- Enhanced error handling to provide clearer messages when no agent is configured for specific phases.
- Added tests to validate the new resolution logic and ensure proper functionality across different configurations.
2026-03-24 12:11:55 +08:00
Max
ea9e070f29 Enhance robot integration with Telegram and improve event handling
- Add Telegram integration support by introducing a dispatcher for handling Telegram events and messages.
- Implement event notifications for robot configuration changes (creation, update, deletion) to facilitate integration with external services.
- Refactor the robot initialization process to load robots into cache and start the dispatcher, improving the overall system setup.
- Update the delivery event structure to include additional metadata for better context during message handling.
- Enhance logging capabilities for better observability during robot execution and event processing.
2026-03-01 22:03:25 +08:00
Max
4f9238ac95 Add chat metadata persistence and enhance executor goals injection tests
- Implement TestEnsureChatMetadata to verify that metadata, including robot_id, is correctly persisted in chat records.
- Update EnsureChat method to store metadata from the context when creating chat records.
- Introduce TestExecutorGoalsInjection to validate that pre-confirmed goals are injected into executions from TriggerInput.Data.
- Enhance executor logic to handle goal injection and persistence, ensuring accurate execution titles.
- Modify chat filtering to support chat_id_prefix for improved chat retrieval based on robot identifiers.
2026-02-28 13:57:45 +08:00
Max
5f5bcba2b2 Refactor delivery event handling and payload structure for improved clarity and functionality
- Update DeliveryPayload to use structured types for Content and Preferences, enhancing type safety and readability.
- Modify tests to reflect changes in payload structure, ensuring proper serialization and deserialization of delivery content.
- Implement a new robotHandler for processing delivery events, streamlining the handling of different delivery channels (email, webhook, process).
- Remove the deprecated DeliveryCenter, consolidating delivery logic within the new handler for better maintainability.
- Enhance error handling and logging during delivery processing to improve observability and debugging capabilities.
2026-02-27 18:19:57 +08:00
Max
3fee0e3fc3 Enhance execution listing and interaction with pagination and streaming support
- Refactor execution listing to support pagination with `Page` and `PageSize` options, replacing previous `Limit` and `Offset` parameters.
- Introduce `ExcludeStatuses` in execution queries to filter out specific execution statuses.
- Implement streaming interaction methods in the manager, allowing real-time responses from the host agent during interactions.
- Update API endpoints to accommodate new query parameters and enhance interaction capabilities with streaming support.
- Modify tests to ensure coverage for new pagination and streaming functionalities.
2026-02-27 16:38:30 +08:00
Max
ae346435b9 Enhance robot execution with language model integration and logging
- Add `language_model` field to robot data structures for LLM connector overrides.
- Update `AgentCaller` to utilize the robot's language model and include logging capabilities for agent calls.
- Refactor task execution to log task outputs and inputs, improving observability during execution.
- Modify tests to accommodate changes in the runner initialization and ensure proper logging functionality.
2026-02-26 14:23:42 +08:00
Max
67ab9350e8 Refactor testing structure and update Makefile for clarity
- Rename test folders and commands in the Makefile for consistency, changing references from AI to Agent tests.
- Update GitHub Actions workflows to reflect the new naming conventions for agent and robot tests, ensuring clarity in CI processes.
- Modify test cases to improve readability and maintainability, including renaming test functions for better understanding of their purpose.
- Enhance comments in the Makefile and workflows to provide clearer context on the testing processes and requirements.
2026-02-25 19:05:53 +08:00
Max
bc4787f857 Update executor to support V2 execution model and enhance event handling
- Implement V2 execution model in the standard executor, simplifying task execution to a single call without validation loops.
- Introduce support for resuming suspended executions, allowing for human input during task processing.
- Enhance event handling by pushing task completion and failure events to the event bus for better tracking and integration.
- Update tests to reflect changes in execution flow and ensure robust handling of task statuses and results.
2026-02-25 18:40:48 +08:00
Max
454da5208b Enhance Execution Control and Error Handling in Robot Manager
- Updated execution control methods (`PauseExecution`, `ResumeExecution`, `StopExecution`) to include error handling and database status updates for paused, running, and cancelled states.
- Introduced `ExecuteWithControl` method in the Executor interface to manage execution with pause/resume capabilities, allowing for better control during execution.
- Enhanced the `Execute` methods across different executors (DryRun, Sandbox, Standard) to support pre-generated execution IDs and control mechanisms.
- Improved error messages in the execution handling API to provide clearer feedback on execution status and errors.
- Added support for a new execution status `ExecPaused` in the execution model, enhancing the tracking of execution states.
2026-01-28 19:10:01 +08:00
Max
94492c90a7 Fix Default Email Channel in Tests
- Updated the expected default email channel in the `TestDefaultEmailChannel` test from "email" to "default" to align with recent configuration changes, ensuring accurate test validation.
2026-01-28 16:03:56 +08:00
Max
239dc4d221 Enhance Email Subject Generation in Delivery Center
- Updated the `buildEmailSubject` function to include the robot's display name in the email subject line, improving clarity and personalization.
- Modified the function signature to accept a `robot` parameter, allowing for dynamic subject prefixes based on the robot's identity.
- Ensured that the email subject reflects the robot's name when using template-based or summary-based subjects, enhancing user experience.
2026-01-28 15:53:10 +08:00
Max
274edfe7cc Update dependencies and enhance email body handling in Delivery Center
- Added new indirect dependencies: `github.com/JohannesKaufmann/dom` and `github.com/JohannesKaufmann/html-to-markdown/v2` for improved HTML processing.
- Updated `github.com/sergi/go-diff` to version 1.4.0 for enhanced diff functionality.
- Modified the `buildEmailBody` function to return both HTML and plain text versions of the email body, improving email formatting capabilities.
- Adjusted the default email channel name in configuration to "default" for better clarity.
2026-01-28 15:32:24 +08:00
Max
423d695d0e Add HMAC Signature Support for Webhook Payloads
- Implemented HMAC-SHA256 signature generation and verification for webhook requests to enhance security.
- Updated the Delivery Center to include the computed signature in the request headers when a secret is configured.
- Added utility functions for computing and verifying HMAC signatures, ensuring integrity of webhook payloads.
- Improved documentation for the new signature handling process to assist developers in implementing secure webhooks.
2026-01-28 14:58:10 +08:00
Max
ecb95f4cc8 Enhance Robot Delivery Logic and Context Management
- Introduced manager ID and email fields in the Robot struct to facilitate mandatory delivery to managers.
- Updated delivery routing logic to ensure manager email is always included if manager ID is set, improving delivery reliability.
- Added JSON serialization handling in the Delivery Center to ensure compatibility with various data types.
- Enhanced context ID generation by replacing time-based IDs with NanoID for improved uniqueness and consistency.
2026-01-28 14:44:42 +08:00
Max
235084dbae Add MCP Output Validation Tests and Enhance Runner Logic
- Introduced tests for validating MCP task output, ensuring only structure validation is performed without semantic checks.
- Implemented the `validateMCPOutput` function to validate MCP task outputs, checking for non-empty results and expected structure.
- Updated the `ExecuteWithRetry` method to incorporate MCP-specific validation logic, improving error handling and output validation for MCP tasks.
- Enhanced test coverage for various output scenarios, including nil, empty string, empty map, and empty array cases, to ensure robust validation behavior.
2026-01-27 19:00:41 +08:00
Max
3ae3f5425d Refine MCP Task Implementation and Documentation
- Updated MCP task executor ID format to use "mcp_server.mcp_tool" for better clarity and consistency.
- Added required MCP-specific fields (`mcp_server` and `mcp_tool`) to the Task struct and validation logic.
- Enhanced documentation in DESIGN.md and TECHNICAL.md to reflect changes in MCP task structure and requirements.
- Improved error handling in ExecuteMCPTask to ensure proper validation of MCP task fields before execution.
2026-01-27 18:44:25 +08:00
Max
0f8287a51b Enhance Robot Configuration with Agents and MCP Servers Integration
- Updated database queries to include 'agents' and 'mcp_servers' fields in robot data retrieval.
- Enhanced the robot configuration structure to merge agents and MCP servers from the member table into the robot's resources.
- Improved the input formatter to display time markers with check/cross indicators for better context awareness.
- Added tests to validate the new functionality and ensure proper formatting of robot identity when identity is nil.
2026-01-27 15:59:14 +08:00
Max
6e68b42128 Enhance Agent Documentation and Add Extract Command Functionality
- Updated README files to include new commands for running tests and extracting results for review.
- Introduced the `yao agent extract` command to facilitate extraction of test results from JSONL files into Markdown or JSON formats.
- Enhanced the `FormatAvailableResources` function to support localization and detailed information for agents and MCP tools.
- Improved output formatting for better readability and usability in test result documentation.
2026-01-27 10:57:27 +08:00
Max
fe67deb3e2 Refactor Goal Name Extraction and Add Markdown Formatting Stripping
- Enhanced the `extractGoalName` function to skip empty lines, markdown headers, and horizontal rules while extracting the first meaningful line as the goal name.
- Implemented a new `stripMarkdownFormatting` function to remove various markdown formatting elements, including bold, italic, inline code, and link syntax.
- Added comprehensive unit tests for both `extractGoalName` and `stripMarkdownFormatting` to ensure correct functionality across various markdown scenarios.
2026-01-24 17:21:06 +08:00
Max
28d5730289 Add Description Field to Task Struct and Enhance Execution Management
- Introduced a new `Description` field in the `Task` struct for a human-readable task description, improving UI clarity.
- Updated the `ParseTask` function to save the description from input data and convert it to a message if no explicit messages are provided.
- Enhanced the `Executor` to update UI fields with localized messages during task execution phases, ensuring better user feedback.
- Implemented a new method in the `ExecutionStore` to persist task status updates, allowing real-time UI updates.
- Added unit tests to validate the new task description handling and UI updates during execution phases.
2026-01-24 12:16:02 +08:00
Max
de9e2c589b Update Failure Messaging and Localization in Executor
- Refactored failure message construction to use concise phase names instead of full error messages, improving clarity in UI feedback.
- Updated localization support for failure messages, ensuring accurate translations for various phases in both English and Chinese.
- Added unit tests to validate the new failure message format and localization functionality.
2026-01-24 10:17:51 +08:00
Max
d590bd7557 Enhance Execution Management with UI Display Fields and Localization Support
- Added `Name` and `CurrentTaskName` fields to the `Execution` struct for improved UI display during execution phases.
- Implemented localization support for UI messages, allowing dynamic updates based on the execution context and user locale.
- Updated the executor to manage these fields at various phases, ensuring accurate representation of execution status.
- Enhanced OpenAPI documentation to reflect the new fields and their usage in execution responses.
- Added unit tests to validate the functionality of UI fields and localization handling.
2026-01-24 10:10:48 +08:00
Max
add933d34c Refactor Job System Integration to Execution Storage
- Removed the job system integration from the robot execution flow, transitioning to a dedicated ExecutionStore for managing execution records.
- Updated the design documentation to reflect the new architecture, emphasizing the relationship between robots and concurrent executions.
- Revised the API to return execution IDs instead of job IDs, ensuring clarity in execution tracking.
- Enhanced logging mechanisms to utilize the kun/log package for better traceability of execution phases.
- Updated tests and documentation to align with the removal of job-related structures and the introduction of execution management.
2026-01-22 18:24:50 +08:00
Max
62a18f0c8d Enhance Email Delivery Configuration and Update Documentation
- Added `robot_email` field to the Robot structure for specifying the sender's email address in email communications.
- Updated the EmailTarget structure by removing the CC field, simplifying the configuration for email targets.
- Revised TECHNICAL.md to include details on the new `robot_email` field and its usage in email delivery, ensuring clarity on the sender identity.
- Enhanced the Delivery Center's email handling to utilize the Robot's email as the From address, with a fallback to the provider's default if not configured.
- Updated DESIGN.md to reflect changes in email delivery architecture and added new sections for global email configuration.
- Marked completion of related tasks in TODO.md, confirming the integration of new email features and structures.
2026-01-18 18:16:09 +08:00
Max
6c45cc41be Enhance Delivery Result Structure and Update Test Cases
- Modified the DeliveryResult structure across multiple executors to include RequestID and Content fields, providing detailed summaries and bodies for dry-run, sandbox, and standard deliveries.
- Updated related test cases to reflect changes in the DeliveryResult structure, ensuring accurate validation of delivery types and content handling.
- Revised input formatting to display delivery summaries instead of types, improving clarity in execution summaries.
2026-01-18 17:21:21 +08:00
Max
ef7f32b428 Refactor Execution Record Model and Update Context Handling
- Removed RobotID from ExecutionRecord and DeliveryContext structures, emphasizing the use of MemberID as the globally unique identifier.
- Updated relevant documentation in DESIGN.md, TECHNICAL.md, and TODO.md to reflect these changes, ensuring clarity on the new context handling.
- Revised methods in ExecutionStore and Executor to align with the updated model, enhancing data management and execution tracking.
- Improved test cases to validate the new structure and ensure comprehensive coverage of execution scenarios.
2026-01-18 16:54:39 +08:00
Max
603ed69a9e Update TODO.md and run_test.go for P3 Run Implementation Completion
- Marked the P3 Run Implementation as complete in TODO.md, reflecting the successful integration of task execution and validation.
- Updated the status of tests related to the ContinueOnFailure option, indicating their completion with detailed test cases for various execution scenarios.
- Enhanced run_test.go with new tests to validate the behavior of task execution under different ContinueOnFailure configurations, ensuring robust error handling and task management.
- Revised the RunExecution method to accept configuration data, improving flexibility in execution parameters.
2026-01-18 10:35:26 +08:00
Max
e0e68393a0 Refine Multi-Turn Conversation Flow and Validation Logic
- Improved the multi-turn conversation handling in the `RunConfig`, adding parameters for better control over conversation execution.
- Enhanced the `ValidationResult` structure to better accommodate multi-turn states, ensuring accurate tracking of conversation progress.
- Updated the `ExecuteWithRetry` method to align with the new conversation flow, improving task execution reliability.
- Revised the `Validator` logic to effectively manage conversation continuation based on validation outcomes.
- Updated documentation and tests to ensure clarity and coverage of the new multi-turn capabilities and validation improvements.
2026-01-18 10:19:11 +08:00
Max
51e4c6d208 Enhance P3 Execution with Multi-Turn Conversation and Validation Improvements
- Updated the `RunConfig` to include parameters for multi-turn conversation control, such as `ContinueOnFailure`, `ValidationThreshold`, and `MaxTurnsPerTask`.
- Implemented a new multi-turn conversation flow for assistant tasks, allowing for iterative interactions until completion or maximum turns are reached.
- Enhanced the `ValidationResult` structure to support multi-turn states, including fields for `Complete`, `NeedReply`, and `ReplyContent`.
- Refined the `ExecuteWithRetry` method to accommodate the new conversation flow, ensuring proper handling of task execution and validation.
- Revised the `Validator` to include logic for determining when to continue conversations based on validation results.
- Updated documentation and tests to reflect the new multi-turn capabilities and validation mechanisms, ensuring comprehensive coverage of the changes.
2026-01-18 10:02:11 +08:00
Max
0c9bdb8000 Implement P3 Run Phase with Enhanced Validation and Execution Logic
- Completed the implementation of the P3 Run phase, integrating task execution and validation mechanisms.
- Introduced a new `RunConfig` struct to manage execution parameters such as retries and validation thresholds.
- Developed a two-layer validation system using the new `yao/assert` package, supporting both natural language and structured JSON rules.
- Enhanced the `RunExecution` method to execute tasks sequentially with progress tracking and a retry mechanism for validation failures.
- Updated task structures to include comprehensive validation rules and expected outputs, ensuring robust task management.
- Added unit tests for the new execution and validation features, achieving high test coverage across the implementation.
- Revised documentation to reflect changes in the architecture and functionality of the P3 phase.
2026-01-17 12:22:23 +08:00
Max
4bfee3b39e Enhance P1 and P2 Implementation in Robot Agent
- Marked P1 Goals and P2 Tasks as completed in TODO.md, reflecting the successful implementation of goal generation and task planning functionalities.
- Updated the input formatter to include delivery target details in the goal output, ensuring tasks are designed for appropriate delivery methods.
- Enhanced the RunTasks method to validate goals and parse tasks from agent responses, including comprehensive error handling and task validation.
- Added unit tests for new task parsing and validation features, ensuring robust coverage of task generation and execution scenarios.
- Revised documentation to clarify the integration of validation rules and expected outputs in task management.
2026-01-17 11:01:56 +08:00
Max
0c2123bb30 Enhance Input Formatting and Error Handling in Robot Executor
- Introduced a new method to format available resources, improving clarity on the tools and agents accessible to the robot.
- Updated the RunGoals and RunInspiration methods to include resource information in user prompts, ensuring achievable goals and insights.
- Revised error messages in the executor to provide more context, enhancing debugging capabilities.
- Added comprehensive tests for the new resource formatting functionality and updated existing tests to reflect changes in error handling.
- Improved documentation for robot configuration, emphasizing the importance of available resources in goal and task generation.
2026-01-16 16:57:48 +08:00
Max
2d86c9caad Enhance Goals and Delivery Structure in Robot Agent
- Introduced a structured Goals type with delivery metadata for improved task management and output handling.
- Updated the DeliveryTarget type to include additional fields for recipients, format, and options, enhancing flexibility in result delivery.
- Enhanced the Executor's RunGoals method to parse and handle delivery information from agent responses.
- Revised input formatting to include robot identity context, improving clarity in generated goals.
- Updated tests to validate the new structure and ensure comprehensive coverage of delivery functionalities.
2026-01-16 16:29:39 +08:00
Max
41e0544aba Refactor Executor Architecture and Update Documentation
- Introduced multiple executor modes (Standard, DryRun, Sandbox) to accommodate various use cases, enhancing flexibility in execution strategies.
- Updated DESIGN.md to reflect the new executor modes and their respective use cases, including detailed descriptions and configuration examples.
- Revised TECHNICAL.md to outline the new executor package structure, emphasizing the modular design for future enhancements.
- Enhanced the TODO.md to track the progress of executor mode implementations and related tasks.
- Removed outdated executor stub files and tests, streamlining the codebase for improved maintainability.
- Updated integration tests to utilize the new DryRun executor, ensuring comprehensive coverage of execution scenarios without real agent calls.
2026-01-16 15:27:46 +08:00
Max
ac5e3e484f Enhance Task Validation and Update TODO.md
- Introduced a validation mechanism for task results, including a detailed validation structure with scores and issues.
- Updated the input formatter to include validation results in the output, improving clarity on task success and validation status.
- Enhanced test cases to cover the new validation fields and ensure comprehensive testing of task results.
- Revised TODO.md to reflect the addition of validation features and the current status of the agent's development phases.
2026-01-16 10:30:37 +08:00
Max
bcb04f8677 Implement Phase 4: Agent Call Infrastructure and Update TODO.md
- Established a unified calling mechanism for agents, enabling streaming support and multi-turn conversations.
- Developed input formatters for various phases, ensuring proper data preparation for assistant prompts.
- Created test assistants for single and multi-turn interactions, along with comprehensive test cases for the AgentCaller and InputFormatter.
- Updated the TODO.md to reflect the new structure and progress of the agent call infrastructure, including future phases for assistant setup and implementation.
2026-01-16 09:52:57 +08:00
Max
de4df27364 Enhance Executor Stub Implementation and Update TODO.md
- Marked the Executor Stub Enhancement section in TODO.md as complete, detailing the enhancements made to the executor's functionality.
- Improved the Executor to simulate full execution with Job integration, including phase transitions and logging.
- Introduced a Config struct for customizable executor behavior, allowing for testing with callbacks and job integration control.
- Implemented phase-specific methods for modular execution, preparing for future real phase implementations.
- Added comprehensive tests for the executor, including smoke tests and verification of phase progression and job logs.
- Updated progress tracking in TODO.md to reflect the current status of the executor and integration testing.
2026-01-15 16:46:58 +08:00
Max
bcbb6b8024 Refactor Robot Execution and Pool Management
- Updated the Executor to implement atomic slot acquisition for robot executions, preventing race conditions and ensuring proper quota management.
- Introduced the TryAcquireSlot method in the Robot struct for atomic checks and reservations of execution slots, enhancing concurrency handling.
- Adjusted the Worker to requeue tasks when quota is exceeded, improving error handling and system stability.
- Enhanced tests for concurrent access and quota management, ensuring robust functionality under load conditions.
- Updated comments and documentation for clarity on new methods and their intended use.
2026-01-14 20:41:02 +08:00
Max
e2bad9bf52 Enhance Robot Pool and Executor Implementations
- Marked the Pool Implementation as complete in TODO.md, confirming all tasks are finished with comprehensive tests.
- Introduced a configurable worker pool with a priority queue for managing robot jobs, including graceful shutdown support.
- Enhanced the Executor with simulated execution delay and callback functionality for testing, tracking execution counts.
- Improved error handling in the pool's submission process and added methods for retrieving running and queued job counts.
- Updated tests to ensure robust functionality and performance of the pool and executor components.
2026-01-14 20:30:27 +08:00
Max
90b52eaf22 Update TODO.md to Reflect Completion of Phases 1 and 2
- Marked Phase 1: Types & Interfaces as complete with 88.4% test coverage and all tests passing.
- Updated Phase 2: Skeleton Implementation status to complete, confirming all packages compile successfully without circular dependencies.
- Checked off all tasks under both phases, indicating full implementation of types, interfaces, and skeleton structures.
2026-01-14 18:03:08 +08:00