Commit graph

3370 commits

Author SHA1 Message Date
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
00851c442e Enhance Integration Tests with Cache Verification
- Added assertions in multiple integration tests to verify that robots are correctly loaded into the cache during various execution scenarios.
- Updated tests for clock triggers, concurrent executions, control tests, event triggers, and human interventions to ensure comprehensive coverage of cache functionality.
- Improved test reliability by confirming the presence of expected robots in the cache, enhancing overall test robustness.
2026-01-15 17:39:03 +08:00
Max
237f193e9e Update TODO.md and Enhance Integration Tests for Scheduling System
- Marked Phase 3 of the scheduling system as complete in TODO.md, highlighting the successful implementation of all sub-tasks and the passing of over 80 integration tests.
- Updated the integration test section to reflect completed tests for various triggers and execution scenarios, ensuring comprehensive coverage of the scheduling pipeline.
- Added new test files for core scheduling flow, clock trigger modes, human intervention, event triggers, concurrent executions, and control tests, enhancing overall test coverage and stability.
- Improved assertions in existing tests to utilize the Eventually pattern for better handling of timing variations in CI environments.
2026-01-15 17:33:19 +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
a5a925f789 Enhance Log Retrieval Functionality in Job Logs
- Added error handling for missing 'data' field in the ListLogs result, improving robustness.
- Implemented handling for nil data, returning an empty log slice as needed.
- Expanded data type handling to include generic []interface{}, ensuring compatibility with various log formats.
- Enhanced logging structure by extracting message, level, and job_id fields from different data types, improving log consistency and usability.
2026-01-15 16:20:08 +08:00
Max
8ce81d4b9b Complete Job Integration and Enhance Job Management Functionality
- Marked the Job Integration section in TODO.md as complete, detailing the implementation of job creation, execution lifecycle, and logging functionalities.
- Introduced a new Options struct for job creation, allowing for extensibility with fields like Priority, MaxRetryCount, and Metadata.
- Implemented methods for job status updates, including handling for completed, failed, and cancelled states, with corresponding updates to job configurations.
- Enhanced localization support for job names and logs, ensuring better usability across different languages.
- Updated tests for job creation, execution tracking, and logging, achieving full test coverage with all tests passing.
- Reflected changes in the job model to include new statuses and improved handling of job execution states.
2026-01-15 16:16:36 +08:00
Max
12386ddb8b Refactor Cache Auto-Refresh Tests for Stability and Clarity
- Updated the auto-refresh tests in cache_test.go to utilize fresh cache instances for each test, ensuring isolation and reliability.
- Improved assertions to verify cache stability after stopping auto-refresh and confirmed that multiple start calls replace previous ones without leaking goroutines.
- Added tests to check for safe behavior during rapid start/stop cycles and ensured that stopping without starting does not cause panics.
- Enhanced overall test coverage and clarity, contributing to better maintainability and understanding of the cache's auto-refresh functionality.
2026-01-15 11:00:28 +08:00
Max
d0d70814f5 Enhance Manager and Trigger Functionality
- Integrated trigger handling directly into the Manager, consolidating the logic for clock, human intervention, and event triggers.
- Updated the Manager to include methods for processing human interventions and event triggers, ensuring robust execution control.
- Refactored the trigger package to provide validation and utility functions, enhancing the overall structure and clarity of trigger-related logic.
- Improved documentation and comments throughout the Manager and trigger implementations for better understanding and maintainability.
- Updated tests to cover new functionalities, ensuring comprehensive validation of the Manager's behavior with various trigger types.
2026-01-15 10:43:44 +08:00
Max
c3eb73a9a1 Refine Timezone Deduplication Test Logic
- Simplified comments and assertions in the timezone deduplication test for the Manager to enhance clarity and focus on the expected behavior of the times robot.
- Ensured that the test accurately verifies that the times robot does not trigger multiple times within the same minute, while allowing for daemon and interval robots to operate as expected.
- Improved the overall readability of the test code by removing redundant comments and emphasizing key assertions.
2026-01-15 10:13:39 +08:00
Max
addda7f455 Refine Timezone Deduplication Test for Manager
- Enhanced the test for the Manager's timezone deduplication functionality to ensure the times robot does not trigger multiple times within the same minute on the same day.
- Added detailed assertions to clarify expected behavior and improve test accuracy, particularly regarding the interaction between the times, daemon, and interval robots.
- Updated comments to provide better context and understanding of the test logic and expected outcomes.
2026-01-15 10:07:08 +08:00
Max
4a36090d8f Add Timezone Deduplication Tests for Manager
- Introduced comprehensive tests for the Manager's timezone deduplication functionality, ensuring correct behavior across different timezones.
- Verified that the robot does not trigger multiple times within the same minute on the same day and correctly triggers on different days.
- Added tests for handling cross-timezone day boundaries and comparisons between UTC and local timezones, enhancing the robustness of the time management logic.
- Updated the shouldTriggerTimes method to utilize the correct timezone for LastRun comparisons, improving accuracy in execution triggers.
2026-01-15 10:01:39 +08:00
Max
5947773dc5 Enhance Manager Implementation and Update TODO.md
- Completed the Manager implementation, including methods for starting, stopping, and managing clock triggers for robot executions.
- Integrated context handling for background operations and added synchronization to ensure thread safety.
- Updated the TODO.md to reflect the completion of the Manager implementation and outlined the next steps for the Trigger and Dedup functionalities.
- Enhanced the Tick method to process clock triggers and submit jobs to the pool based on robot configurations.
- Added detailed comments and documentation for clarity on the Manager's functionality and its components.
2026-01-15 09:48:05 +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
a490617563 Add Auto-Refresh Tests for Cache Functionality
- Implemented comprehensive tests for the auto-refresh feature in the cache, ensuring it operates without leaking goroutines.
- Verified that multiple start calls do not accumulate goroutines and that stopping the refresh does not panic.
- Included tests for concurrent start and stop operations to ensure thread safety and reliability in the cache's behavior.
- Enhanced overall test coverage for the cache module, contributing to improved stability and performance assurance.
2026-01-14 19:01:16 +08:00
Max
f330a92a2b Enhance Robot Cache Implementation and Documentation
- Marked the Cache Implementation as complete in TODO.md, confirming all tasks are finished with comprehensive integration tests.
- Updated cache.go to provide a thread-safe in-memory cache for Robot instances, improving performance and reliability.
- Enhanced the Load method to include pagination and configurable model name, ensuring efficient data handling.
- Added detailed comments and structured code for better readability and maintainability across the cache implementation.
- Improved validation and error handling in various utility functions to ensure robustness in data processing.
2026-01-14 18:54:18 +08:00
Max
435cb8b934 Enhance Type Definitions and Error Handling Documentation
- Added descriptive comments for constants in enums.go to clarify their purpose and improve code readability.
- Updated error definitions in errors.go with comments to specify the meaning of each error, enhancing understanding of error handling in the codebase.
2026-01-14 18:19:36 +08:00
Max
7bf61eb92e Enhance Robot Execution Logic and Documentation
- Added a check for nil configuration in the CanRun method to ensure default behavior is maintained when no config is provided.
- Standardized comments in the Goals struct for improved clarity and consistency in task objectives.
- Updated the Execution struct's field formatting for better readability.
2026-01-14 18:15:43 +08:00
Max
4ceb74da9e Refactor Structs for Consistency and Enhanced Readability
- Standardized field formatting in TriggerResult and Execution structs for improved code clarity.
- Added test cases in robot_test.go to ensure Robot can run with nil config and quota, verifying default behavior.
- Enhanced comments in the Goals struct to clarify task objectives and improve documentation consistency.
2026-01-14 18:08:19 +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
Max
d7b288410d Refactor Task and TriggerRequest Structures for Enhanced Input Handling
- Updated the Task struct in DESIGN.md to replace the Messages field with a new Input field, allowing for more flexible user input options.
- Revised the TriggerRequest struct in TECHNICAL.md to incorporate the new Input field, improving clarity on user interactions.
- Enhanced related code examples and documentation to reflect these changes, ensuring consistency in task management and execution processes.
2026-01-14 17:41:02 +08:00
Max
d0bbd87aa0 Refactor Task and TriggerRequest Structures for Rich Input Support
- Updated the Task struct in DESIGN.md to replace the Input field with Messages, allowing for rich content input (text, images, files, audio).
- Revised the TriggerRequest struct in TECHNICAL.md to utilize Messages instead of Input, enhancing the flexibility of user interactions.
- Improved related code examples to demonstrate the new Messages structure, ensuring consistency and clarity in task management and execution processes.
2026-01-14 17:18:50 +08:00
Max
822cccd189 Refactor TriggerRequest and InterveneRequest Structures in TECHNICAL.md
- Updated the TriggerRequest and InterveneRequest structs to replace the Description field with an Input field, enhancing clarity on user input for task actions.
- Revised related code examples to reflect the new Input field, ensuring consistency across the implementation.
- Improved documentation comments for better understanding of the changes and their impact on task management.
2026-01-14 16:10:39 +08:00
Max
27bb499fbc Update Task and Execution Structures for Enhanced Traceability
- Revised the Task struct in DESIGN.md to include an Input field for natural language descriptions and a Source field to indicate task origin (auto, human, event).
- Updated the Execution struct in TECHNICAL.md to add an Input field for storing original trigger input, improving traceability of task execution.
- Enhanced documentation for both structs to clarify their roles and improve overall understanding of the agent's task management and execution processes.
2026-01-14 15:56:08 +08:00
Max
0cf0671503 Enhance Robot Design and Technical Documentation
- Updated DESIGN.md to improve the structure of the InspirationReport and Goals, clarifying their roles in the agent's execution process.
- Revised the Task struct to include a reference to the goal in markdown, enhancing task management.
- Enhanced TECHNICAL.md by introducing new types for RobotStatus, ClockMode, and EventSource, improving type safety and clarity.
- Updated various structs and interfaces to reflect new types and improve documentation consistency across the codebase.
2026-01-14 15:47:45 +08:00
Max
f7f300549d Refactor Robot Configuration and Documentation
- Updated the DESIGN.md and TECHNICAL.md files to consolidate the knowledge base (KB) and database (DB) configurations into a unified structure, enhancing clarity on shared resources.
- Removed the PrivateKB and SharedKB fields, replacing them with a single KB field that includes collections and options for better organization.
- Introduced a new DB struct to define shared database models, streamlining the configuration process.
- Enhanced the Learn struct to clarify its purpose for the robot's private knowledge base, including comments for better understanding.
- Removed the Monitor and related types from the configuration, simplifying the overall structure and focusing on essential components.
2026-01-14 15:35:20 +08:00
Max
3915ac493c Enhance Robot Execution Management and Documentation
- Updated the DESIGN.md to clarify the relationship between robots and executions, emphasizing that each trigger creates a new execution mapped to a job.Job for monitoring.
- Revised the RobotState struct to include fields for tracking multiple running executions and their IDs, improving concurrency management.
- Enhanced the TECHNICAL.md to reflect the global robot object for static methods, streamlining the API usage for robot management.
- Improved TypeScript interfaces to align with the new execution tracking structure, ensuring consistency across documentation.
- Added detailed comments and examples for job creation and execution handling, clarifying the integration of the job system within the robot's functionality.
2026-01-14 15:21:05 +08:00
Max
8bcf7d2303 Enhance TriggerRequest Structure and Documentation in TECHNICAL.md
- Updated the TriggerRequest struct to include new fields: InsertAt and AtIndex for improved task insertion control.
- Revised action descriptions for clarity, changing terms to better reflect their functionality.
- Added detailed comments and examples for the robot.Trigger method to clarify usage for human and event triggers.
- Introduced new types and constants for task insertion positions and sources, enhancing the overall structure and readability of the documentation.
2026-01-14 10:53:05 +08:00
Max
5db9196804 Remove Technical and Design Documentation for Autonomous Agent
- Deleted the DESIGN.md and TECHNICAL.md files to streamline the documentation structure and eliminate redundancy.
- This change reflects a shift towards a more concise documentation approach, focusing on essential information and reducing clutter for better usability.
2026-01-14 10:46:48 +08:00
Max
f6b56ac6cc Refactor Technical Documentation to Remove Redundant Sections and Streamline Content
- Removed extensive sections on Manager and Executor implementations to focus on high-level concepts and integration points.
- Consolidated error handling and global singleton sections for clarity and brevity.
- Updated the structure of the document to enhance readability and ensure a more cohesive presentation of the autonomous agent's functionality.
2026-01-14 09:46:56 +08:00
Max
3283bc027d Update Autonomous Agent Design Document to Enhance Clarity on Execution Phases and Triggers
- Revised sections to improve clarity on execution phases, specifically detailing the roles of clock triggers and their impact on agent operations.
- Updated flowcharts and diagrams to accurately represent the new execution structure, ensuring a clear understanding of the agent's decision-making processes.
- Enhanced documentation for each phase, providing clearer guidance on input and output expectations, particularly in relation to trigger types.
2026-01-14 09:42:44 +08:00
Max
01e64b9d29 Add Yao Agents Section to README
- Introduced a new section highlighting Yao Agents, providing a link to the related GitHub repository for further exploration.
- Enhanced the README to better inform users about the capabilities and resources available for Yao Agents, improving overall documentation clarity.
2026-01-13 15:30:51 +08:00
Max
da3a932e71 Update Autonomous Agent Design Document to Reflect Go API Changes and Execution Flow Enhancements
- Introduced a new section detailing Go APIs for job management, replacing previous API references for clarity and consistency.
- Updated job creation and execution handling examples to utilize the new job package methods, improving code clarity and structure.
- Enhanced query examples for listing jobs, executions, and logs, providing clearer guidance on usage within the autonomous agent context.
- Revised the document to align with recent changes in job management and execution processes, ensuring accurate representation of the agent's functionality.
2026-01-13 10:26:47 +08:00
Max
d7d6f1b77b Refactor Autonomous Agent Design Document to Update Terminology and Structure
- Replaced references to "AI Members" with "Robot Members" and "Human Members" with "User Members" for clarity.
- Updated the `team_members` table description to reflect the use of the `__yao.member` model, enhancing consistency in terminology.
- Revised key fields and examples in the document to align with the new member structure, improving overall understanding of the agent's configuration and operational context.
- Enhanced flowcharts and diagrams to accurately represent the updated member types and their roles within the team structure.
2026-01-13 10:16:58 +08:00
Max
b19597808d Refactor Execution Status and Agent State Enums in Design Document
- Renamed the `Status` type to `ExecStatus` for clarity in execution status representation.
- Introduced a new `AgentState` type to define the operational states of the agent, enhancing the structure of the design document.
- Updated relevant sections to reflect these changes, improving overall readability and understanding of the agent's execution and operational context.
2026-01-13 10:05:46 +08:00
Max
e318455bc2 Add Execution Phases and Enums to Autonomous Agent Design Document
- Introduced new enums for execution phases, clock modes, delivery types, and statuses to enhance clarity and structure.
- Updated the `Clock` struct to use the new `ClockMode` type, improving type safety and readability.
- Revised the `Resources` struct to utilize a map for phases, allowing for more flexible resource management.
- Enhanced the `Delivery` struct to incorporate the new `DeliveryType` enum, clarifying output options.
- Updated the design document to reflect these changes, improving overall organization and understanding of the agent's operational context.
2026-01-13 10:02:55 +08:00
Max
0a58bfdddf Update Autonomous Agent Design Document to Clarify Daemon Mode and Terminology
- Revised the description of the daemon mode to reflect its use cases as "research analyst" and "market monitor."
- Updated configuration examples to align with the new terminology, enhancing clarity on the agent's operational context.
- Corrected terminology for keywords in the P0 and P1 phases to improve consistency and understanding of the target audience.
- Added a new execution phase (P3) detailing the article's execution and publication process, providing a clearer overview of the agent's tasks.
2026-01-13 09:46:30 +08:00
Max
00517c64bd Update Autonomous Agent Design Document to Replace Schedule with Clock Trigger
- Changed terminology from "Schedule" to "Clock" throughout the document to reflect the new trigger type.
- Revised flowcharts and diagrams to incorporate the clock context, clarifying the agent's operational phases based on time.
- Updated configuration examples and descriptions to align with the new clock trigger settings, enhancing clarity on how agents operate under different timing modes.
- Improved documentation for the Inspiration phase to specify its reliance on clock context, ensuring better understanding of the agent's decision-making process.
2026-01-13 09:36:51 +08:00
Max
81cc25c6bb Update Execution Flow in Autonomous Agent Design Document to Include Trigger Decision Point
- Added a decision point for triggers in the execution flow diagram, clarifying the paths for schedule and human/event triggers.
- Revised the connections in the flowchart to reflect the new structure, ensuring a clear distinction between the Inspiration phase and goal generation based on trigger types.
- Enhanced the overall clarity of the document by improving the representation of the agent's operational phases.
2026-01-13 09:13:24 +08:00
Max
a9c1eb9bf5 Update Autonomous Agent Design Document to Clarify Execution Flow and Trigger Handling
- Revised the execution flow diagrams to clearly differentiate between schedule and human/event triggers, enhancing understanding of the agent's operational phases.
- Updated the P0: Inspiration phase to specify it operates under a schedule-only context, while human/event triggers directly generate goals.
- Improved the documentation for each phase, adding clarity on input and output expectations, particularly for the Inspiration phase.
- Enhanced the overall structure of the document to better reflect the distinct paths of execution based on trigger types.
2026-01-13 09:08:57 +08:00
Max
46d815affc Refactor Autonomous Agent Design Document for Improved Clarity and Structure
- Revised the document to enhance clarity by updating section titles and terminology, such as changing "Overview" to "What is it?" and "Key Characteristics" to "Key points."
- Streamlined the architecture section, renaming components for consistency and clarity, including changes to trigger sources and agent management terminology.
- Updated execution flow diagrams and descriptions to reflect the new structure, improving understanding of the agent's operational phases.
- Enhanced the configuration section to provide a clearer overview of triggers, scheduling, and resource management, ensuring better organization throughout the document.
2026-01-13 08:58:19 +08:00
Max
1d5881fe5f Refactor Autonomous Agent Design Document for Clarity and Structure
- Revised the document to enhance clarity by reorganizing sections and improving terminology, such as changing "Core Features" to "Key Characteristics."
- Introduced a new architecture section detailing the system's trigger sources and their integration with the agent manager.
- Updated the execution flow and lifecycle diagrams to reflect the new structure and added detailed descriptions for each phase of the agent's operation.
- Enhanced the configuration section to include a comprehensive overview of triggers, scheduling, and resource management, improving the overall organization of the document.
2026-01-13 08:52:59 +08:00
Max
ce7996b982 Enhance Design Document with Trigger Sources Configuration
- Added a new section detailing the configuration of trigger sources for AI members, including default settings and an example YAML configuration.
- Updated the execution flow diagram to reflect the configurable nature of trigger sources, incorporating a check for trigger enablement.
- Refactored the AI member configuration structure to include a dedicated triggers section, improving clarity and organization of the configuration options.
2026-01-13 08:47:54 +08:00
Max
f7b8e970b2 Refactor Logging in Request Render Method
- Removed the dependency on the color package for logging warnings about uncached pages.
- Simplified the logging statement to directly use the log package, improving code clarity and reducing unnecessary imports.
2026-01-12 11:02:15 +08:00
Max
588f40df25 Add Execution Flow and Lifecycle Diagrams to Design Document
- Introduced detailed execution flow and sequence diagrams using Mermaid to illustrate the autonomous agent's operational phases.
- Added a comprehensive AI member lifecycle diagram, outlining the states and transitions of AI members within the system.
- Enhanced the design document to improve clarity and understanding of the agent's execution process and lifecycle management.
2026-01-10 21:09:26 +08:00
Max
117e16b827 Update Design Document and Refactor Execution Phases
- Revised the design document to improve clarity in the deduplication timing table format.
- Updated the `Resources` struct to include a new `Inspiration` phase and adjusted the descriptions for existing phases.
- Enhanced the `ExecutionPhase` constants to reflect the new phase structure, adding a `PhaseLearning`.
- Improved the documentation for the private knowledge base categories and the Activity Monitor API features for better readability.
- Introduced new types for alert rules and actions in the monitoring configuration, expanding the alerting capabilities.
2026-01-10 20:07:47 +08:00
Max
b7ca0ab5b8 Enhance Knowledge Base Document Retrieval and Initialization
- Improved the asynchronous initialization of the knowledge base (KB) collection post user login, ensuring a smoother user experience.
- Refined the GetDocumentsContent method to enhance document retrieval capabilities, supporting various file types and improving overall efficiency.
- Updated related API interfaces to reflect these enhancements, ensuring consistency across document management functionalities.
2026-01-10 20:05:44 +08:00
Max
edc6b89c17 Refactor Chat Test Cases for Knowledge Base Initialization
- Removed dependency on KB configuration in tests, as KB collections are now created during user login.
- Updated test cases to reflect new initialization scenarios, ensuring they handle various conditions gracefully.
- Renamed test functions for clarity, emphasizing the focus on initialization rather than collection creation.
2026-01-10 13:00:58 +08:00
Max
d95b911934 Update Auth Scope Handling in User KB Collection Preparation
- Added a comment to clarify that the __yao_created_by field is only set for create operations, ensuring consistency with the WithCreateScope function.
- Removed the __yao_updated_by field from the auth scope, streamlining the user knowledge base collection preparation process.
2026-01-10 12:48:15 +08:00
Max
4ba62600dc Refactor Knowledge Base Collection Initialization and Document Retrieval
- Removed the synchronous preparation of the knowledge base (KB) collection from the InitializeConversation method, now initializing it asynchronously after user login.
- Introduced a new method, GetDocumentsContent, to retrieve content for multiple documents by their IDs, supporting text-based files and improving document handling.
- Updated the API interface to include the new GetDocumentsContent method, enhancing the document management capabilities.
- Enhanced locale handling in the login context to support user preferences during KB collection creation.
2026-01-10 12:38:42 +08:00