- 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.
- 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.
- 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.
- 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.
- Introduced a new message type `user_input` to handle user input specifically for frontend display.
- Defined `UserInputProps` structure to standardize the properties of user input messages, including content, role, and name.
- Implemented `NewUserInputMessage` function to facilitate the creation of user input messages.
- Updated built-in type checks to include the new user input type, ensuring compatibility across the system.
- Added Metadata field to StreamStartData and StreamEndData structs to facilitate passing additional context information.
- Updated sendAgentStreamStart and sendAgentStreamEnd methods to include new fields for better traceability and context management during streaming events.
- Enhanced the overall structure of stream data to support more comprehensive event tracking and context sharing.
- Updated the Load function and API handlers to replace 'Use' with 'Uses' for assistant configuration, enhancing consistency across the codebase.
- Modified related structures and functions to reflect the new naming convention, ensuring better alignment with the intended functionality.
- Added a new Skip struct to manage request skip configurations, improving request handling flexibility.
- Implemented tests for the GetSkip function to validate skip parameter extraction from both request body and query parameters.
- Updated the buildMessages function to include prompts at the beginning of the final message list, ensuring they take precedence over createResponse.Messages and input messages.
- Improved comments for clarity on message priority handling, enhancing maintainability and understanding of the message construction process.
- Updated the test case for force interrupts to clarify that empty messages indicate pure cancellation.
- Improved log messages to reflect the change in behavior, ensuring better understanding of context cancellation during tests.
- Updated the interrupt controller to cancel the context only for force interrupts with no messages, enhancing clarity in cancellation logic.
- Removed unnecessary debug print statements from the completion request handling, improving code cleanliness and performance.
- Allowed empty messages for force interrupts, providing flexibility in cancellation scenarios without requiring additional messages.
- Updated the completion request parsing logic to make the model field optional, allowing for better flexibility in handling requests.
- Enhanced the stream end handling by adding JSON parsing for stream end data and sending a structured message to the frontend.
- Modified the output writer to format data as Server-Sent Events (SSE) and ensured immediate flushing for real-time streaming in both CUI and OpenAI adapters.
- Added a temporary mock SID value in the handleChat, handleChatList, and handleChatLatest functions to facilitate testing.
- Commented out userID retrieval in GetChat, GetChatWithFilter, and getChatsWithFilter methods to simplify query logic during development.
- Updated GetHistory method to comment out userID usage, maintaining consistency across chat-related functionalities.
- Updated the Response struct to include ContextID, RequestID, ChatID, and AssistantID for better traceability and context management.
- Modified the Stream method to return the new fields in the response, enhancing the output for client interactions.
- Added ContextID and ChatID to the StreamStartData struct to improve event tracking during streaming requests.
- Refactored the Stream method to retrieve connector capabilities early, allowing output adapters to utilize them effectively.
- Introduced a new Info method in the Assistant to provide structured assistant information, enhancing context accessibility.
- Updated StreamStartData to include additional fields such as ChatID and Assistant info for better event tracking.
- Improved error handling in the Stream method to ensure robust management of connector retrieval failures.
- Enhanced internationalization support for stream event messages, providing localized output for different clients.
- Updated the interrupt controller to accept context IDs during initialization, improving traceability of interrupt signals.
- Enhanced logging in the Assistant's Stream method to provide detailed trace information for stream lifecycle events.
- Refactored context release logic to improve cleanup processes and added logging for context management.
- Adjusted test cases to align with the new interrupt handling and logging structure, ensuring robust functionality and traceability.
- Updated the TraceNode structure to allow multiple parent IDs, facilitating implicit joins in trace management.
- Enhanced the TraceNodeOption to include a type field for better categorization of nodes.
- Refactored related methods in the trace manager and node handling to accommodate the new parent structure and type field.
- Improved test coverage for trace node creation and retrieval, ensuring robust handling of the new multi-parent functionality.
- Integrated i18n translations for trace logging messages in the Assistant's Stream method, improving localization for user-facing messages.
- Updated logging in the OpenAI provider and CUI writer to utilize i18n for error messages, enhancing clarity and consistency across different locales.
- Added new embedded template handling in the i18n package, allowing for more flexible message formatting with variable substitutions.
- Improved test coverage for i18n functionalities, ensuring robust handling of various translation scenarios and edge cases.
- Adjusted indentation and formatting in the OpenAI provider's logging statements to enhance readability and maintainability.
- Cleaned up test files by removing unnecessary blank lines, improving overall code clarity and consistency.
- Ensured that logging for request and response details is properly structured for better debugging capabilities.
- Introduced new methods in the trace manager for retrieving events, trace info, nodes, logs, and spaces from storage, improving data access and management.
- Updated the driver implementations to support loading and unarchiving traces, ensuring robust handling of trace data.
- Enhanced error handling and logging in the OpenAI provider to facilitate better debugging and traceability of requests and responses.
- Added a new TraceSpaceData struct to encapsulate space metadata along with key-value data for improved API responses.
- Added functionality to archive traces by compressing and marking them as read-only, enhancing data management capabilities.
- Introduced methods for checking if a trace is archived and for unarchiving traces, allowing for better control over trace data.
- Updated the trace manager and driver interfaces to support archiving operations, ensuring consistency across components.
- Enhanced error handling for operations on archived traces, preventing modifications to read-only data.
- Improved trace metadata structure to include archived status and timestamp, facilitating better trace lifecycle management.
- Updated the Assistant's Stream method to set output for the agent node and conditionally close the output writer based on call depth, improving resource management.
- Integrated detailed trace logging for output closure events, distinguishing between root and nested calls to enhance debugging capabilities.
- Refactored trace creation in context to utilize authorized information for better trace context management.
- Introduced a lightweight persistNode structure for efficient storage of trace nodes, optimizing the save and load operations in local and store drivers.
- Integrated trace management into the Assistant's Stream method, allowing for detailed logging of processing steps and errors.
- Improved error handling in the OpenAI stream and post methods, adding trace logs for retries and failures.
- Enhanced CUI and OpenAI writers to log message adaptation and sending errors, improving debugging capabilities.
- Updated trace manager to use milliseconds for timestamps, ensuring consistency across the trace system.
- Refactored log methods in the trace node to streamline logging and broadcasting of events.
- Added an interrupt controller to manage user interrupts during streaming operations.
- Introduced methods for registering and unregistering contexts in a global registry to facilitate interrupt handling.
- Enhanced the Assistant's Stream method to check for force interrupts and handle them appropriately.
- Updated context creation to include unique IDs for better identification during interrupts.
- Implemented logic for graceful and force interrupts, allowing for flexible response to user signals.
- Introduced a trace manager in the context struct for lazy initialization and management of trace operations.
- Implemented the Trace method in the context to facilitate trace object creation and management within JavaScript.
- Enhanced configuration options for trace drivers, including defaults for local and store drivers, and added path and prefix settings.
- Updated related tests to verify the functionality of the new trace management features.
- Updated trace ID validation in `TestEnterStack_RootCreation` to ensure it is at least 8 digits long.
- Changed import path for the trace package in `stack.go` for consistency.
- Removed the entire `manager.go`, `node.go`, `space.go`, `subscription.go`, `trace.go`, `local/driver.go`, `store/driver.go`, and related types and events files to streamline the trace package, focusing on essential functionality.
- Introduced a global trace registry to manage active traces with thread-safe access.
- Added support for two storage drivers: Local (file-based) and Store (Gou store).
- Enhanced trace ID generation to include a date prefix and improved uniqueness.
- Implemented functions for creating, loading, and releasing traces, along with checking their existence in both the registry and persistent storage.
- Added functionality to retrieve trace metadata and list active traces, improving trace management capabilities.
- Added a new field to track the current message type (text, thinking, tool_call) in the streamState struct.
- Updated message handling methods to set the current message type appropriately.
- Modified the group end handling to use the tracked message type when sending messages, ensuring accurate type representation.
- Enhanced unit tests to verify the correct handling of group end events and their associated types.
- Changed the Vision field in ModelCapabilities from bool to interface{} to accommodate both boolean values and VisionFormat strings.
- Modified the getConnectorCapabilities function to directly assign the Vision capability based on the updated model configuration, enhancing compatibility with various vision input formats.
- Integrated Claude API keys into GitHub workflows for both unit and PR tests.
- Introduced a new VisionFormat type and constants to manage image input formats.
- Updated ModelCapabilities to support vision input, allowing for flexible handling of image formats.
- Enhanced VisionAdapter to preprocess messages and convert image URLs to base64 format for Claude compatibility.
- Improved OpenAI provider to utilize vision support in message preprocessing, ensuring better integration with vision capabilities.