Commit graph

20 commits

Author SHA1 Message Date
Max
d43b637ad4 feat(assistant): enhance sandbox handling and improve assistant tag filtering
- Added support for sandbox configuration in the LoadPath function, allowing for better management of sandbox settings.
- Updated tests to validate the retrieval of assistant tags with type filters, ensuring accurate responses for both assistant and robot types.
- Enhanced the assistant model to differentiate between sandbox versions, improving the handling of sandbox data in the database.
- Improved API responses to include computer filter details for V2 sandboxes, enhancing the information returned to clients.
2026-03-24 19:19:04 +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
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
b4ded8a3ed Enhance Assistant model with capabilities and sandbox configuration
- Introduce `Capabilities` and `Sandbox` fields in the Assistant model, allowing for detailed descriptions of assistant capabilities and sandbox configurations.
- Update loading and conversion functions to handle the new fields, ensuring they are correctly parsed and stored.
- Modify filtering and response handling to include the new fields, providing better integration with the API.
- Add comprehensive tests to validate the functionality of the new fields, ensuring they are correctly processed in various scenarios.
2026-02-24 10:50:10 +08:00
Max
6fa808c875 Enhance ListRobots API to Include Runtime Status
- Added concurrent fetching of runtime status for each robot in the ListRobots function, improving response efficiency.
- Updated the Response struct to include new fields for runtime status: Running, MaxRunning, LastRun, and NextRun, optimizing dashboard display.
- Implemented unit tests to verify the inclusion of runtime status fields in the ListRobots response, ensuring accurate data representation for users.
2026-01-24 18:49:39 +08:00
Max
3ef536c1e7 Add Activity Type Filtering to ListActivities API
- Introduced a new `Type` field in the `ActivityQuery` struct to allow filtering activities by type (e.g., execution.started, execution.completed, execution.failed, execution.cancelled).
- Updated the `ListActivities` method in `ExecutionStore` to handle the new type filter, mapping it to corresponding execution statuses.
- Enhanced unit tests in `execution_test.go` to validate filtering by activity type, including tests for valid and invalid type scenarios.
- Modified OpenAPI definitions and related types to support the new type filter in the activities endpoint, improving API usability and flexibility.
2026-01-24 18:28:16 +08:00
Max
2f040196ec Add Results and Activities Functionality to ExecutionStore
- Implemented `ListResults` and `CountResults` methods in `ExecutionStore` to retrieve and count completed executions with delivery content, supporting filtering by member ID, team ID, trigger type, and keyword.
- Developed `ListActivities` method to derive activities from execution status changes, allowing retrieval of recent activities for a team.
- Created corresponding unit tests in `execution_test.go` to validate the functionality of results and activities listing, ensuring accurate filtering and pagination.
- Updated OpenAPI routes and types to include new endpoints for listing results and activities, enhancing the API's capabilities for managing execution data.
2026-01-24 17:57:58 +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
bb7638f1e5 Implement Autonomous Mode Filtering in Robot API
- Added support for filtering robots by `autonomous_mode` in the ListRobots API.
- Enhanced ListQuery structure to include an optional `AutonomousMode` field.
- Updated listRobotsFromDB function to apply the autonomous mode filter based on the query.
- Created new test cases to validate the filtering functionality for both autonomous and on-demand robots.
- Revised related OpenAPI endpoints and frontend integration to accommodate the new filtering options.
2026-01-22 16:14:59 +08:00
Max
64b5ffd154 Enhance Robot API with Permission Fields and Status Management
- Added `YaoCreatedBy` and `YaoTeamID` fields to `RobotState` and `RobotResponse` for improved access control.
- Updated `GetRobotStatus` to retrieve permission fields from the store and populate the robot state.
- Modified `robotFields` in the store to include new Yao permission fields for better management of access control.
- Enhanced OpenAPI integration by registering robot routes and ensuring proper permission checks in handlers.
- Updated documentation in TODO.md to reflect the completion of permission logic and API enhancements.
2026-01-22 12:21:44 +08:00
Max
339a486eb4 Refactor assistant capabilities and update data handling
- Enhanced the getConnectorCapabilities method to prioritize model capabilities and connector settings, improving capability retrieval logic.
- Deprecated the tools field in the Assistant model, transitioning to MCP for tool management, and updated related methods accordingly.
- Introduced new fields for connector options and prompt presets in the Assistant model, allowing for more flexible configurations.
- Updated the GetAssistant method to support field selection, improving data retrieval efficiency and flexibility.
- Refactored tests and documentation to reflect changes in the assistant structure and capabilities, ensuring clarity and maintainability.
2025-12-02 12:36:47 +08:00
Max
44d2ba4210 Refactor logging in model tests for consistency
- Updated log formatting in TestListModels, TestGetModelDetails, and TestModelIDFormat to ensure consistent output structure.
- Removed unnecessary blank lines to enhance code readability and maintainability in the test suite.
2025-11-11 16:42:01 +08:00
Max
8b690d37bc Refactor completion request handling in context tests
- Renamed and restructured the TestNewOpenAPI function to TestGetCompletionRequest for clarity.
- Updated test cases to validate completion requests using a structured request body instead of query parameters.
- Enhanced error handling and assertions to ensure comprehensive coverage of various scenarios, including metadata handling and expected outputs.
- Removed the obsolete openapi_chat_test.go file to streamline the test suite.
2025-11-11 16:23:22 +08:00
Max
2099921cf4 Refactor test cases for assistant updates to improve consistency
- Standardized formatting in TestUpdateAssistant and assistant_update_test.go to enhance readability.
- Ensured comments clearly indicate which fields are ignored during updates, maintaining clarity in test intentions.
2025-11-08 16:22:29 +08:00
Max
fa5b98f5bf Add UpdateAssistant method for modifying assistant fields
- Implemented UpdateAssistant method in Mongo, Redis, and Xun stores to allow partial updates of assistant fields.
- Updated Store interface to include the new UpdateAssistant method, enhancing the flexibility of assistant management.
- Added comprehensive tests for UpdateAssistant functionality, covering various scenarios including single and multiple field updates, JSON field handling, and error cases.
- Updated API routes to support PUT requests for updating assistants, ensuring proper permission checks and response handling.
2025-11-08 16:21:35 +08:00
Max
90386ddb70 Refactor response handling in GetAssistant and ListAssistantTags functions
- Simplified the response structure by directly returning the assistant and tags objects instead of wrapping them in a "data" field.
- Updated corresponding tests to reflect the new response format, ensuring accurate assertions and improved readability.
2025-11-08 15:17:56 +08:00
Max
0f17db74ca Implement GetAssistant endpoint with permission verification
- Added a new GetAssistant function to retrieve assistant details by ID, incorporating permission checks to ensure authorized access.
- Updated the assistant route to use the new GetAssistant handler, enhancing security by verifying user permissions before returning assistant data.
- Introduced a FilterBuiltInAssistant function to clear sensitive fields for built-in assistants, ensuring compliance with data protection standards.
- Enhanced test coverage for the GetAssistant functionality, including tests for successful retrieval, permission filtering, and error handling scenarios.
2025-11-08 13:46:29 +08:00
Max
42b5e17d78 Fix formatting in TestListAssistantTags to improve readability
- Removed unnecessary blank lines in the test function, enhancing code clarity and maintainability.
2025-11-08 11:44:19 +08:00
Max
46e0f30599 Implement filtering for assistant tags retrieval
- Enhanced the HandleAssistantTags function to support multiple filtering options including type, connector, built-in status, mentionable status, automated status, and keywords.
- Updated the GetAssistantTags method in the store interfaces to accept a filter parameter, allowing for more granular tag retrieval.
- Refactored the Xun, Mongo, and Redis implementations of GetAssistantTags to utilize the new filtering capabilities.
- Added comprehensive tests for the new filtering functionality, ensuring correct behavior across various scenarios.
- Updated API endpoint documentation to reflect the new filtering options for assistant tags.
2025-11-08 11:14:08 +08:00
Max
bed36b754f Enhance assistant model and query handling
- Added permission fields (YaoCreatedBy, YaoUpdatedBy, YaoTeamID, YaoTenantID) to the AssistantModel for better tracking of ownership and access control.
- Introduced a custom QueryFilter in the AssistantFilter struct to allow for flexible permission-based filtering of assistants.
- Updated the GetAssistants method to apply the custom query filter, improving the retrieval logic based on user permissions.
- Enhanced test coverage for the new QueryFilter functionality, ensuring accurate filtering of assistants based on various criteria.
2025-11-08 10:25:28 +08:00