- Added support for converting extended types (file, data) to standard LLM types (text, image_url, input_audio) in the Stream method.
- Introduced a new agentCallerWrapper to facilitate agent calls from the content package.
- Implemented ThreadID management for nested agent calls to improve concurrent stream identification.
- Enhanced message handling to include metadata for message_start and message_end events, allowing for better tracking of message states.
- Removed deprecated vision capability checks from the Assistant initialization process, streamlining the codebase.
- Added new content types (file, data) to the context types for improved message content handling.
- Updated `GetText` and `SaveText` methods to support both full content and a preview (first 2000 characters) for improved performance and usability.
- Added comprehensive tests in `manager_test.go` to validate the new functionality, including UTF-8 character handling and content retrieval scenarios.
- Modified the attachment model to include a `content_preview` field alongside the existing `content` field, ensuring efficient data management.
- Enhanced the README.md to document the new dual storage feature, providing clear examples for users on how to utilize the updated methods.
- Implemented `GetText` and `SaveText` methods in the attachment manager to handle storing and retrieving parsed text content from files.
- Enhanced the `manager_test.go` with comprehensive tests for various scenarios, including saving, updating, and retrieving text, as well as handling non-existent file IDs.
- Updated the README.md to document the new text content storage features, providing examples for saving and retrieving parsed text.
- Modified the attachment model to include a new `content` field for storing text content, improving the overall functionality of the attachment management system.
- Enhanced the GetCompletionRequest function to support custom connectors by validating the model field against existing connectors.
- If the model is a valid connector ID, it sets the ctx.Connector; otherwise, it defaults to the assistant ID behavior.
- This change improves flexibility in handling different model types while maintaining compatibility with existing functionality.
- Changed the `Optional` field in `ConnectorOptions` from a boolean to a pointer to allow for nil values, enhancing flexibility in option handling.
- Updated tests in `load_test.go`, `convert_test.go`, and `assistant_test.go` to reflect the new pointer type for `Optional`, ensuring proper assertions and error handling.
- Added new test cases to validate behavior when `Optional` is nil or false, improving test coverage and robustness of the ConnectorOptions functionality.
- Enhanced the `loadMap` function to include handling for `modes` and `default_mode` fields, allowing for flexible operational modes and a specified primary mode.
- Introduced a new `DB` field in the Assistant model to support database configuration, improving data management capabilities.
- Implemented the `ToModes` conversion function to facilitate various input types for modes, ensuring robust handling and validation.
- Added comprehensive tests for the `ToModes` function to validate its functionality across different input scenarios, enhancing overall reliability.
- Updated relevant methods to ensure consistent integration of the new fields and functionalities within the Assistant model.
- Replaced the deprecated getConnectorCapabilities method with a unified capability getter in the Assistant model, improving capability retrieval logic.
- Added a new API endpoint to retrieve essential assistant information, including fields like id, name, avatar, and connector options, enhancing the assistant's data accessibility.
- Updated the LLM management to support filtering by capabilities, allowing for more flexible provider listings based on user-defined models.
- Improved overall structure and clarity in the assistant's capabilities and API responses, ensuring better maintainability and usability.
- Introduced `modes` field to support multiple operational modes for the assistant, allowing for flexible functionality (e.g., chat, task).
- Added `default_mode` field to specify the primary mode of operation for the assistant.
- Updated the `Map`, `Clone`, and `Update` methods to handle the new fields appropriately.
- Enhanced the `ToAssistantModel` conversion function to include the new fields.
- Added tests to validate the integration and functionality of modes and default mode within the assistant model.
- Introduced a new `Database` type to encapsulate database models and options.
- Updated the `Assistant` model to include a `DB` field for database configuration.
- Enhanced the `Map`, `Clone`, and `Update` methods to handle the new `DB` field appropriately.
- Implemented the `ToDatabase` conversion function to support various input types for database initialization.
- Added comprehensive tests to validate the integration of the database functionality within the assistant model.
- Updated relevant fields and methods to ensure consistent handling of the new database configuration.
- Introduced GetStorage function for testing purposes, allowing retrieval of the current storage instance.
- Enhanced loadSource function to load scripts from the source field if present, improving assistant initialization.
- Updated comments for clarity on TypeScript handling in loadSource, ensuring better understanding of script loading mechanics.
- Introduced prompt preset selection and global prompt disabling features in the assistant's message building process.
- Updated the `buildSystemPrompts` method to prioritize prompt presets and manage global prompt settings based on context and hook responses.
- Added new fields to the `HookCreateResponse` struct for prompt configuration, allowing for dynamic adjustments during message processing.
- Refactored tests to validate the integration of prompt presets and global prompt controls, ensuring robust functionality and context-aware behavior.
- Added methods to set and retrieve global prompts, enhancing the assistant's capabilities.
- Updated the assistant's message building process to include global prompts, ensuring context-aware parsing.
- Introduced tests to validate the integration and functionality of global prompts within the assistant.
- Improved context variable handling for prompt parsing, supporting dynamic content generation.
- Introduced the `disable_global_prompts` field in the Assistant model to control the usage of global prompts.
- Updated the Load and Get methods to initialize and retrieve global prompts from the configuration.
- Refactored tests to validate the new global prompts functionality and ensure proper loading and context handling.
- Improved the overall structure and clarity of the assistant's capabilities and configurations.
- Removed the GetByConnector method from the Assistant model to streamline the retrieval process.
- Introduced new fields for connector options and prompt presets, allowing for more flexible configurations.
- Updated the Map method to include additional fields such as connector options and prompt presets.
- Enhanced the Clone method to support deep copying of new fields.
- Improved the Update method to handle updates for the new source, connector options, and prompt presets fields.
- Refactored tests to ensure comprehensive coverage of the new functionalities and maintain clarity in the assistant structure.
- 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.
- Updated the model capabilities throughout the agent to utilize the new gouOpenAI.Capabilities struct instead of the previous ModelCapabilities.
- Adjusted related methods and types to ensure compatibility with the new capabilities structure, enhancing clarity and maintainability.
- Improved context handling and message processing by directly integrating OpenAI capabilities, streamlining the overall architecture.
- Implemented traceLLMFail method to mark LLM requests as failed in the trace context.
- Updated executeLLMStream and executeLLMForToolRetry methods to call traceLLMFail on errors, enhancing error tracking and debugging capabilities.
- Improved overall error handling in LLM execution flows, ensuring failures are properly logged in the trace.
- Updated handleToolCall method to parse tool call delta data from OpenAI, improving the handling of single and multiple tool calls.
- Implemented dynamic delta actions ("append" for arguments, "merge" for static fields) to optimize message sending.
- Enhanced message structure to include appropriate DeltaAction and DeltaPath for better frontend integration.
- Improved error handling during JSON parsing to ensure robustness in tool call processing.
- Introduced a new messageMetadataStore type for managing message and block metadata with thread-safe operations.
- Added methods for setting, getting, and updating message and block metadata, enhancing concurrency handling.
- Removed redundant metadata store implementation from types.go, centralizing functionality in message.go for improved organization.
- Implemented logic to auto-generate ChunkID for messages when not provided, enhancing message tracking.
- Utilized IDGenerator if available; otherwise, fallback to message.GenerateNanoID for unique identification.
- Improved message handling consistency by ensuring ChunkID is always set for non-event messages.
- Added EndBlock method to explicitly mark the end of a message block, sending a block_end event.
- Updated message handling to include lifecycle events for message start and end, improving tracking and management of message durations.
- Enhanced message metadata structure to support chunk counting and message types, facilitating better message operations.
- Improved JSAPI documentation to include new lifecycle management features, clarifying usage for developers.
- Simplified context management by directly passing the existing context to the delegated assistant's Stream method, ensuring proper stack tracing.
- Updated comments to clarify the delegation process and the relationship between parent and delegated assistants, enhancing code readability.
- Removed deprecated API and vision components, streamlining the agent's architecture.
- Updated the Load function to utilize a new agentDSL variable, enhancing the management of assistant capabilities.
- Enhanced context handling by introducing a message metadata store for thread-safe operations, improving message tracking and management.
- Refactored context methods to eliminate deprecated fields, ensuring cleaner and more maintainable code.
- Improved documentation and comments throughout the codebase to clarify changes and enhance developer understanding.
- Introduced recordMessageMetadata and getMessageMetadata methods to manage metadata for sent messages, enabling BlockID and ThreadID inheritance in delta operations.
- Implemented new methods (Append, Merge, Set) in the context to enhance message management capabilities, allowing for more flexible message updates.
- Updated the Send method to automatically manage BlockID and ThreadID for delta operations, improving message handling consistency.
- Enhanced JSAPI documentation to reflect new methods and usage patterns, improving developer experience and clarity.
- Added error handling and logging for completion node creation in the traceAgentCompletion method, improving traceability of failures.
- Introduced a new replaceMethod in the context to allow message content replacement, enhancing message management capabilities.
- Updated documentation for sendMethod and replaceMethod to clarify usage and return values, improving developer experience.
- Updated the traceAgentOutput method to be deprecated in favor of the new traceAgentCompletion method, which creates a dedicated completion node for reporting final outputs.
- Enhanced the i18n messages to include labels and descriptions for the new agent completion functionality, improving localization support.
- Removed debug logging related to MCP tools from the buildCompletionOptions method to streamline the code and improve clarity.
- Updated the Stream method to return a flexible final response, accommodating both standard and Next hook responses.
- Introduced NextProcessContext to encapsulate context for processing Next hook responses, enhancing clarity and maintainability.
- Removed deprecated Done and Failback hooks, streamlining the hook management process.
- Enhanced error handling and logging for improved traceability during streaming operations.
- Introduced a new test case for MCP hook overrides in build_mcp_test.go, validating that hooks can successfully modify MCP server configurations.
- Updated the applyMCPTools and buildMCPTools methods to prioritize hook-provided MCP servers over assistant configurations, enhancing flexibility in tool management.
- Enhanced the HookCreateResponse struct to include MCPServers, allowing hooks to specify server configurations for requests.
- Improved error handling and logging throughout the MCP tool application process, ensuring better traceability and debugging capabilities.
- Updated the performance assertion for no-op operations in the stress test to account for slower execution times in CI environments, allowing a maximum time of 15ms instead of 5ms.
- Added comments to clarify expected performance metrics for local versus CI runs, improving test documentation and understanding.
- Updated the GenTraceID function to generate a trace ID using a combination of a date prefix and a 12-character random suffix from NanoID, enhancing collision resistance.
- Removed the timestamp-based suffix generation in favor of a more robust random approach, ensuring better uniqueness in concurrent scenarios.
- Added comments to clarify the new implementation and fallback mechanism for NanoID generation failures.
- Modified expected values in test cases to remove prefixes from assistant labels in both English and Chinese translations, ensuring consistency with the updated message structure.
- Adjusted comments to clarify the changes made to the label formats in the translation functions.
- Added detailed debug logging throughout the Stream method to trace execution flow and tool call results, improving visibility during runtime.
- Implemented error tracing with the new traceAgentFail method to capture failures in agent nodes, enhancing error handling.
- Updated MCP tools debugging to provide insights into tool application and validation processes, aiding in troubleshooting.
- Refactored output handling in traceAgentOutput for better clarity and consistency in response management.
- Renamed methods in ToolCallResult from ServerID to Server and ToolName to Tool for improved clarity and consistency.
- Updated i18n messages in builtin.go to remove redundant context, simplifying the label and description for the assistant's streaming process.
- Enhanced the Stream method to include a retry mechanism for tool calls, allowing for up to three attempts in case of errors.
- Introduced detailed logging for each retry attempt, improving traceability and debugging capabilities.
- Added a new method, buildToolRetryMessages, to construct messages for LLM retries, ensuring proper context is maintained.
- Updated the executeLLMForToolRetry method to handle streaming output during retries, providing real-time feedback to users.
- Improved error handling to differentiate between retryable and non-retryable errors, enhancing the robustness of tool call executions.
- Refactored the BuildRequest method to improve clarity and maintainability by separating the building of completion options and final messages.
- Updated the buildMessages function to include MCP samples as system messages, enhancing the message prioritization logic.
- Introduced applyMCPTools method to integrate MCP tools into completion options, improving functionality and flexibility in tool usage.
- Enhanced error handling in completion options to ensure robust application flow.
- Updated MCP server configuration to support advanced formats, including tools and resources.
- Refactored the Assistant's Stream method for improved readability and maintainability, adding clear section comments.
- Enhanced error handling and logging for better traceability during streaming operations.
- Removed deprecated methods and streamlined MCP server handling in tests to ensure robust functionality and validation.
- Simplified the Stream method by extracting capability initialization into a separate function, improving readability and maintainability.
- Enhanced error handling by centralizing trace logging for failures and history tracking.
- Removed the MCP hook implementation as it was no longer needed, streamlining the codebase.
- Updated agent trace handling to ensure consistent logging of agent output and errors.
- Added context release calls in multiple test cases to ensure proper resource cleanup and prevent memory leaks.
- Updated performance thresholds in memory leak tests, increasing acceptable growth per iteration from 10KB to 15KB to account for overhead.
- Improved validation checks in stress tests to ensure response integrity and metadata accuracy, enhancing overall test robustness.
- Refactored performance report for clarity, consolidating key metrics and findings for better readability.
- Added a check to confirm the existence of the 'mcps' directory prior to loading MCP files, enhancing error handling and preventing unnecessary attempts to load from a non-existent directory.
- Updated error handling to ensure that any issues encountered during the loading process are logged appropriately.
- Added a check to verify if the 'mcps' directory exists before attempting to load MCP files, improving error handling and preventing unnecessary operations.
- Updated the error handling in the MCP loading function to ensure robustness in the application flow.
- Cleaned up whitespace in the realworld_stress_test.go file to enhance readability.
- Updated i18n translations for MCP tool operations, ensuring consistent formatting and clarity in both English and Chinese descriptions.
- Deleted agent_test.go to streamline testing structure.
- Removed mcp package and its related fetch and search files to simplify the codebase.
- Enhanced context handling in jsapi_test.go and jsapi.go for better integration with JavaScript.
- Introduced no-op objects for Trace and Node to handle uninitialized states gracefully.
- Updated i18n translations to include new MCP-related labels and descriptions.
- Upgraded jsonschema from v0.5.2 to v0.6.1 for improved functionality.
- Updated go-json-experiment/json from a specific commit to a newer version for better compatibility.
- Added jsonpointer v0.4.6 and updated messageformat-go to v0.4.6 to ensure all dependencies are up-to-date and functioning correctly.
- Introduced safeSend method to handle context cancellation and prevent panics when sending commands to state command channel.
- Updated existing state management methods to utilize safeSend, ensuring robust handling of command sending in various states.
- Improved overall stability of state management by addressing potential race conditions and channel closure issues.
- Replaced group-related event types with message-specific types, enhancing clarity in event management.
- Updated stream handling functions to utilize new message start and end events, improving the granularity of message tracking.
- Refactored context management to integrate a context-scoped ID generator for unique message identifiers.
- Removed deprecated group handling methods and streamlined message processing logic.
- Updated tests and documentation to reflect changes in message handling and ensure proper functionality.
- Updated message structures to replace 'StreamStartData' and 'StreamEndData' with 'EventStreamStartData' and 'EventStreamEndData' for better clarity and consistency.
- Introduced 'EventMessageStartData' and 'EventMessageEndData' to represent individual message lifecycle events, enhancing the granularity of message tracking.
- Refactored the 'streamState' and 'groupTracker' to utilize the new message structures, improving the organization and handling of streaming events.
- Enhanced the context management by integrating an ID generator for unique message identifiers, facilitating better tracking of message sequences.
- Updated documentation and tests to reflect the new message structures and ensure proper functionality across the system.
- Introduced SendGroupStart and SendGroupEnd methods for better control over message grouping, allowing for automatic ID generation and event handling.
- Updated streamState structure to track group IDs, message sequences, and chunk counts, improving message organization during streaming.
- Refactored message handling to eliminate the 'done' field, signaling message completion through group_end events instead.
- Revised JSAPI documentation to reflect new methods and usage patterns, enhancing clarity for developers.
- Improved test cases to validate new group handling features and ensure proper functionality.
- Revised the JSAPI_OUTPUT.md to provide a comprehensive overview of Agent Hook functions and their usage.
- Added detailed examples for each hook function, demonstrating real-time messaging and error handling.
- Improved the structure and clarity of the documentation, ensuring users can easily understand how to implement and utilize the Context object methods.
- Removed deprecated sections and streamlined the content for better readability.