- Replaced all instances of `ctx.Space` with `ctx.Memory.Context` in the context management code, ensuring a more structured approach to handling temporary request-scoped data.
- Updated related test cases to reflect the changes in context memory usage, enhancing the reliability and clarity of tests.
- Removed the deprecated `Space` references and adjusted comments and documentation to align with the new memory management strategy.
- Removed hardcoded collection IDs in `search_auth_integration_test.go` and replaced them with dynamically generated IDs to ensure uniqueness during test runs.
- Simplified the setup and cleanup processes by introducing the `authTestCollections` struct, which manages the lifecycle of test collections.
- Updated test cases to utilize the new collection management approach, enhancing test reliability and reducing potential conflicts during parallel execution.
- Removed references to Badger in the `utils.go` and `utils_test.go` files, replacing it with Xun as the primary data store.
- Updated test cases and comments to reflect the change in store preference, ensuring consistency across the codebase.
- Adjusted the testing guide to provide accurate information regarding store management and fallback options.
- Updated the cleanup process in `cleanupAuthCollections` to include a waiting mechanism for Qdrant to fully process deletions, improving reliability of test setups.
- Removed unnecessary sleep calls and added logging to warn if collections still exist after cleanup, ensuring better visibility during test execution.
- Refactored comments for clarity regarding the cleanup process in both `TestAuthSearchSetup` and `ensureAuthTestData` functions.
- Replaced Badger with Xun as the primary data store across various components, including OAuth, agent memory, and knowledge base stores, enhancing performance and flexibility.
- Updated the configuration files to reflect the new Xun store paths and removed obsolete Badger store files.
- Refactored test cases to utilize the new Xun store, ensuring compatibility and improved test reliability.
- Enhanced test setup functions to initialize the Xun store correctly, streamlining the testing process and ensuring a consistent environment.
- Introduced a new script testing mode to allow testing of agent handler scripts (hooks, tools, etc.) using a Go-like interface, enabling better unit testing of TypeScript/JavaScript code.
- Enhanced the `LoadScripts` function to skip test files during script loading, ensuring only relevant scripts are processed.
- Refactored the test context creation to support custom context configurations via a JSON file, allowing for flexible authorization and metadata management during tests.
- Updated the test runner to handle script tests, including the ability to filter tests using regex patterns and manage custom context data.
- Improved documentation to include details on script testing usage, input formats, and available assertions, enhancing developer experience and clarity.
- Updated multiple test cases in `jsapi_test.go` to utilize `testutils.Prepare` and `testutils.Clean` for better test setup and teardown, ensuring a consistent testing environment.
- Refactored the `parallelAny` and `parallelRace` methods in `search.go` to improve goroutine management and result handling, reducing unnecessary locking and enhancing performance.
- Implemented checks to prevent goroutines from executing after a successful result is found, optimizing resource usage during parallel searches.
- Removed redundant test environment initialization code and replaced it with a streamlined approach using `testutils.Prepare` for better clarity and maintainability.
- Introduced utility functions `ensureAuthTestData` and `createAuthTestData` to manage the setup of test collections and documents, ensuring that necessary data is available for tests.
- Updated multiple test cases to utilize the new data initialization methods, improving test reliability and reducing setup complexity.
- Renamed functions for consistency and clarity, changing `buildDBAuthWheres` to `BuildDBAuthWheres` and `filterKBCollectionsByAuth` to `FilterKBCollectionsByAuth`.
- Enhanced test cases to utilize the updated function names, ensuring proper authorization checks in the search functionality.
- Improved test environment initialization to streamline setup processes and ensure robust testing of authorization logic.
- Verified that search results adhere to authorization constraints, ensuring only accessible collections are queried based on user permissions.
- Enhanced the KB search handler to utilize the KB API for executing search queries, improving search accuracy and performance.
- Implemented authorization checks for collections in the search requests, ensuring only accessible collections are queried.
- Updated the search request structure to include metadata filtering capabilities, allowing for more refined search results.
- Refactored unit tests to validate new search functionalities, including threshold handling and collection initialization checks, ensuring robust test coverage.
- Adjusted the Makefile to streamline test coverage reporting and updated GitHub Actions workflows to include Codecov integration for better visibility on test coverage metrics.
- Updated the Dockerfiles and GitHub Actions workflows to reference version 1.0.0 of the Yao build environment and Go, ensuring compatibility with the latest features and improvements.
- Adjusted the Go version in the macOS workflow and updated the Dockerfile to install Go 1.25.0, enhancing the build process.
- Changed the Go version in multiple workflow files from 1.24 to 1.25, ensuring compatibility with the latest features and improvements in the Go programming language.
- Introduced a new unit test target for KB tests in the Makefile, allowing for dedicated testing of the KB module.
- Updated the test folder selection logic to exclude additional AI-related components, ensuring focused testing.
- Enhanced the GitHub Actions workflows to include KB tests, setting up necessary services like Qdrant, Neo4j, and MongoDB for a comprehensive testing environment.
- Refactored search test functions to improve data existence checks and streamline test setup processes, enhancing test reliability and maintainability.
- Updated the `GetCollection` method to first read from the database for existence and permissions, improving data integrity.
- Merged metadata from GraphRag into the result, ensuring backward compatibility and enhanced data representation.
- Refactored the `CollectionExists` method to check both the database and GraphRag for consistency, logging any mismatches for debugging purposes.
- Introduced new types and structures for search operations, including `SearchMode`, `Query`, and `SearchResult`, to support advanced search functionalities.
- Modified the `createTestContext` function to use `context.Background()` for improved context management in tests.
- Updated the URL in the `TestAddURL` function to point to the correct Yao Agent Caller resource, ensuring accurate test assertions for added URLs.
- Changed the query in the `TestSerpAPIProviderWithAssistantConfig` from "Yao App Engine" to "golang programming language" to align with updated test expectations.
- Updated the expected result assertion to match the new query, ensuring the test accurately verifies the functionality of the search handler.
- Modified the 'Type' field in the serpAPIKnowledge struct to use an interface{}, enabling it to accept either a string or an object based on the query context.
- This change enhances the flexibility of the knowledge graph data representation in the search handler.
- Improved the `Job` struct to support dynamic function execution with the `AddFunc` method, allowing for flexible job management.
- Enhanced the `Goroutine` struct with the `ExecuteFunc` method to manage function execution, including robust error handling and context management.
- Updated unit tests for `AddFunc` to ensure proper function registration and execution, including memory cleanup verification.
- Revised documentation to reflect the new function execution capabilities within the job system.
- Introduced `AddFunc` method to the `Job` struct for adding Go functions as job executions, allowing for dynamic execution of functions with specified arguments.
- Enhanced internal execution handling to register functions in a global registry, ensuring proper cleanup after execution.
- Implemented `ExecuteFunc` method in the `Goroutine` struct to handle the execution of registered functions, including error handling and context management.
- Added comprehensive unit tests for `AddFunc`, verifying function registration, execution, and memory cleanup post-execution.
- Updated related documentation to reflect the new functionality and usage patterns for adding and executing Go functions within the job system.
- Added a `Results` field to the `SearchExecutionResult` struct to store raw search results, facilitating the extraction of DSL from database searches.
- Implemented logic in the `saveSearch` method to extract and store the first DSL from DB search results, improving data retention for search operations.
- Introduced a `dslToMap` method in the DB handler to convert QueryDSL to a map format for storage, enhancing the flexibility of result handling.
- Updated the `Result` struct to include a `DSL` field for generated QueryDSL, ensuring comprehensive data representation for database search results.
- Updated the search handling to incorporate keyword extraction with weights, improving the relevance of search results.
- Refactored the `shouldAutoSearch` method to return a `SearchIntent` struct, allowing for more nuanced control over search execution based on context.
- Enhanced the `buildSearchRequests` function to utilize extracted keywords, optimizing search queries based on user input.
- Improved the handling of search types and conditions, ensuring that the system can dynamically adjust search behavior based on intent and configuration.
- Updated documentation and prompts to reflect changes in keyword extraction and search intent classification, providing clearer guidelines for usage.
- Updated the AgentReporter to handle *context.Response directly instead of using type assertions, simplifying the response extraction process.
- Enhanced the extractContent method to prioritize accessing the Next field and completion content, improving robustness in data retrieval.
- Improved code readability by streamlining the response handling logic, aligning with recent refactorings in the agent's response processing.
- Updated the agent's Stream and response processing methods to return and handle *context.Response directly, eliminating the need for type assertions.
- Simplified test cases by removing unnecessary type conversions and directly accessing response fields.
- Enhanced the extraction of data from Next hook responses, ensuring more robust handling of custom data structures.
- Improved overall code readability and maintainability by streamlining response handling logic across various components.
- Updated the buildRequestMessage function to construct a JSON object for structured communication with the agent, replacing the previous string formatting approach.
- Enhanced the handling of extra parameters, scenarios, and retry context by incorporating them into the JSON structure.
- Improved the parseResult function to extract additional fields such as explain and warnings from the response, ensuring comprehensive result handling.
- Streamlined the code for better readability and maintainability while preserving existing functionality.
- Introduced new test cases to validate the behavior of the search handler when querying with nonexistent models, ensuring it returns appropriate error messages without panicking.
- Added a test for scenarios where only some of the requested models exist, confirming that the search can still succeed with valid models while handling errors gracefully.
- Updated the search handler to improve error handling by checking for model existence before proceeding with the search, enhancing robustness in search operations.
- Reorganized import statements in test files to improve clarity and consistency.
- Updated comments in test cases to provide more detailed descriptions of the test environment initialization process.
- Enhanced the `Prepare` function in the test utilities to include registration of the default query engine, ensuring proper setup for database searches.
- Improved error handling during the loading of the knowledge base and query engine, enhancing robustness in test setups.
- Bumped the version of the expr-lang/expr package from v1.17.3 to v1.17.7 to incorporate the latest features and fixes.
- Updated the go.sum file to reflect the new dependency version and its associated checksums.
- Refactored the Search method to support context-aware execution, allowing handlers to utilize context when performing searches.
- Introduced a new SearchWithContext method in the handler interface to facilitate context-based search operations.
- Updated the DB handler to implement the context-aware search, ensuring proper QueryDSL generation and execution.
- Enhanced test cases to validate the new context requirements and scenarios for database searches, improving error handling and robustness.
- Added scenario type support for QueryDSL generation, allowing for more complex query handling.
- Updated documentation to reflect the new context handling and scenario features in search operations.
- Added support for a new `Metadata` field in the `Options` struct to allow passing custom data to hooks, enhancing flexibility in context management.
- Updated the `ToMap` and `OptionsFromMap` methods to include serialization and deserialization of the `Metadata` field.
- Enhanced the test case structure to include an `Options` field, allowing for per-test-case configuration, including metadata and skip options.
- Updated documentation to reflect the new `options` and `metadata` fields, providing clear examples for users on how to utilize these features in test cases.
- Updated the keyword extraction and QueryDSL generation processes to require a context parameter, enhancing the robustness of the extraction methods.
- Replaced the previous frequency-based extraction with a system agent approach, utilizing the __yao.keyword and __yao.querydsl agents for improved accuracy and context awareness.
- Removed obsolete builtin extraction implementations and tests, streamlining the codebase.
- Enhanced test cases to validate the new context requirements, ensuring proper error handling when context is not provided.
- Updated documentation to reflect changes in the extraction methods and their dependencies on context.
- Updated the search intent classification prompt for the Need Search agent to provide clearer instructions and rules for classifying user queries.
- Revised the output format to specify JSON structure requirements, ensuring consistency in responses.
- Expanded classification rules to include additional categories and examples, improving the agent's ability to accurately determine the need for external searches.
- Enhanced clarity in the prompt content to facilitate better understanding and implementation by users.
- Introduced an `assert` field in the test case structure to allow for custom assertion rules, providing flexibility in output validation.
- Defined various assertion types, including `equals`, `contains`, `not_contains`, `json_path`, `regex`, and `script`, to cater to different validation needs.
- Updated the test runner to utilize the new assertion mechanism, replacing the previous expected output validation with a more robust asserter.
- Enhanced documentation in DESIGN.md to include detailed examples and explanations of the new assertion capabilities, improving clarity for users.
- Added a `noop` check in multiple logging methods (`LLMComplete`, `ToolStart`, `ToolComplete`, `HookStart`, `HookComplete`, and `HistoryLoad`) to prevent logging when the logger is in no-operation mode.
- Improved command handling in `root.go` by removing minimum argument requirements for commands and providing help output when no arguments are given.
- Introduced an `agent` command for better organization of agent-related functionalities in the CLI.
- Implemented automatic detection of the application root directory in `run.go` to streamline the application startup process.
- Cleaned up debug print statements in `config.go` to reduce clutter in the output.
- Replaced `json.Parse` with `text.ExtractJSON` in the `Next` function of both the `keyword` and `needsearch` assistants for improved fault-tolerant JSON extraction from LLM output.
- Simplified content handling by removing unnecessary markdown code block processing, enhancing clarity and efficiency in keyword extraction.
- Updated comments to reflect the changes in the extraction method, ensuring better understanding of the functionality.
- Changed the expected names of system agents in the load test to reflect recent updates: "Keyword Extraction" to "Keyword Extractor," "QueryDSL Generator" to "Query Builder," and "Need Search" to "Reference Checker."
- Ensured that test assertions align with the latest naming conventions for improved clarity and consistency in the assistant's functionality.
- Renamed several assistant packages for clarity, including "Entity Extraction" to "Entity Extractor" and "Keyword Extraction" to "Keyword Extractor."
- Revised descriptions for various assistants to enhance understanding of their functionalities, such as changing "Extract keywords from text content" to "Extract search keywords."
- Added a "uses" field with "search" set to "disabled" in the configuration of each assistant, standardizing their setup.
- Updated the "Prompt Optimizer" description to "Optimize prompts for better results" and modified the "QueryDSL Generator" to "Query Builder" for improved clarity.
- Ensured consistent naming conventions and descriptions across all assistant packages to enhance user experience and documentation clarity.
- Updated the `shouldAutoSearch` method to include additional parameters for improved intent detection, allowing for better decision-making on whether to execute auto search.
- Introduced a new `checkSearchIntent` method to utilize the `__yao.needsearch` agent for determining the necessity of a search based on user input.
- Implemented a `ClearExcept` method in the cache to selectively clear non-system agents while preserving essential system agents during cache management.
- Updated the `LoadBuiltIn` function to maintain system agents in the cache, ensuring they remain available for use.
- Enhanced test coverage for loading system agents and validating search intent detection, ensuring robustness in the assistant's search capabilities.
- Revised localization files to include new messages for search intent feedback, improving user experience during search operations.
- Added configuration support for system agents in the assistant initialization process, allowing for custom connectors for agents like __yao.keyword and __yao.querydsl.
- Implemented the loading mechanism for system agents from bindata, ensuring that essential agents are available during runtime.
- Updated the LoadBuiltIn function to exclude system agents from being removed, enhancing the management of built-in and system agents.
- Enhanced test coverage by introducing tests for loading system agents, verifying their presence and correctness in the cache.
- Updated documentation to reflect the new system agents configuration and loading processes.
- Added retry logic to the Generate method in both AgentProvider and MCPProvider to handle failures in QueryDSL generation.
- Integrated lint validation to ensure generated QueryDSL meets required standards, with detailed error reporting for invalid DSL.
- Enhanced test coverage by introducing new tests for retry behavior in both agent and MCP contexts, ensuring robustness against lint failures.
- Updated documentation to reflect changes in QueryDSL generation processes and error handling mechanisms.
- Updated the executeAutoSearch method to improve the handling of search results, ensuring better data capture and processing.
- Enhanced the Search type to include additional metadata for improved debugging and user feedback.
- Revised related tests to align with the new search execution logic and ensure comprehensive coverage of changes.
- Updated documentation to reflect modifications in search result handling and execution processes.
- Updated the TestGPT5Vision function to support various content types in responses, including strings and slices of ContentPart.
- Implemented logic to concatenate text from multimodal responses, improving the robustness of image description handling.
- Added logging for cases where content is nil or of unexpected types, enhancing test feedback and debugging capabilities.
- Updated the CitationGenerator to produce simple integer IDs instead of formatted strings, improving clarity and consistency in citation references.
- Enhanced the executeAutoSearch method to save both successful and failed search results, capturing detailed execution data for better traceability.
- Introduced a new SearchExecutionResult type to structure search result data, including query, keywords, configuration, duration, and error information.
- Updated related tests to reflect changes in citation ID format and ensure proper functionality of the new storage mechanisms.
- Revised documentation to clarify the new citation format and search result handling processes.
- Introduced a new `Search` type to store intermediate processing results, including extracted keywords, entities, relations, and generated QueryDSL for improved debugging and citation support.
- Updated the `executeAutoSearch` method to populate the new `Search` structure, ensuring all relevant data is captured during search execution.
- Implemented methods for saving and retrieving search records in MongoDB and Redis, enhancing data persistence across sessions.
- Revised localization files to include new keys for search-related messages, improving user experience.
- Updated DESIGN.md to reflect changes in the search result structure and data flow, ensuring comprehensive documentation of the new features.
- Implemented loading and result messaging in the executeAutoSearch method to improve user experience during search operations.
- Added methods to send loading, result, and completion messages, providing real-time feedback to users.
- Integrated trace node creation and completion for search operations, enhancing transparency and debugging capabilities.
- Updated localization files to include new messages for search status updates in both English and Chinese.
- Revised DESIGN.md to document the new output flow and trace integration for search operations.
- Renamed the ID generation function to `aigcID` for clarity and added a new function to parse AIGC IDs from file paths.
- Implemented special handling for `.ai.yml` and `.ai.yaml` extensions to correctly format the AIGC ID by removing the "_ai" suffix, improving ID accuracy in the loading process.
- Added the `OPENAI_API_KEY` environment variable to both `pr-test.yml` and `unit-test.yml` workflows for improved API access.
- Introduced a step to set up the Apple Private Key in both workflows, enhancing security for Apple-related operations.
- Integrated Redis service setup in both workflows to support caching and improve test performance.
- Added a MongoDB service to both `pr-test.yml` and `unit-test.yml` workflows to support database testing.
- Configured MongoDB with necessary environment variables for root credentials and database name, improving the test environment setup.
- Introduced a MongoDB service in both `pr-test.yml` and `unit-test.yml` workflows to facilitate database testing.
- Configured MongoDB with environment variables for root username, password, and database name, enhancing test environment setup.
- Updated `.gitignore` to exclude job logs for search agents, ensuring cleaner repository management.
- Increased the timeout for AI unit tests from 20 minutes to 20 minutes and for memory leak tests from 60 seconds to 5 minutes, improving test execution reliability.
- Adjusted test commands to ensure proper handling of long-running tests, enhancing overall testing efficiency.
- Introduced a new step in both `pr-test.yml` and `unit-test.yml` workflows to set up environment variables for database configuration.
- Enhanced the environment setup to conditionally configure database connection strings based on the selected database driver, improving test reliability and flexibility.
- Created necessary directories for SQLite database storage when not using MySQL, ensuring proper environment preparation for tests.