- Update start command to check if the current directory is a Yao app root or a subdirectory, providing clearer error messages for users.
- Modify installation logic to handle empty directories more effectively, ensuring the init app is installed only when appropriate.
- Improve welcome message formatting and update links for documentation and community resources.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace the existing NanoID generation in generateContextID with UUID for improved uniqueness.
- Update RequestID method to return the context ID directly instead of generating a new NanoID.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Refactor BuildCommand to support session continuation using --continue flag.
- Introduce BuildCommandWithContinuation to handle both initial and continuation requests.
- Add BuildLastUserMessageJSONL for generating JSONL from the last user message in continuation scenarios.
- Enhance Executor to check for existing sessions and adjust command building accordingly.
- Update environment setup to ensure session data is stored correctly for persistence.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Implement secure config file location (/tmp/.yao/proxy.json) instead of user-visible /workspace/
- Add generic options map support for backend-specific parameters (e.g., thinking for Volcengine GLM-4.7)
- Add secrets support for passing sensitive env vars (e.g., GITHUB_TOKEN) to sandbox container
- Remove excessive debug logs, keep critical ones with log.Printf("[Sandbox]...")
- Fix test assertions for system prompt passing via CLI args instead of env var
- Update i18n messages for sandbox loading states
Co-authored-by: Cursor <cursoragent@cursor.com>
- Send ChunkMessageStart before ChunkText in parseStream
- This initializes stream state (inGroup=true) required for Buffer.AddAssistantMessage
- Only send ChunkMessageEnd if message was started
Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix Claude CLI output parsing: only extract content from final
assistant message (with stop_reason) to avoid duplicate content
- Remove trailing "..." from sandbox loading message
Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix missing SystemPrompt field in sandbox executor options conversion
(was causing Claude CLI to be skipped even when prompts were configured)
- Rewrite parseStream to handle Claude CLI stream-json output format:
- system: initialization message
- assistant: message with content array (text, tool_use)
- result: final result with verification string
- Add comprehensive E2E tests via caller for sandbox integration:
- TestSandboxE2E_ClaudeCLIExecution: verify command execution
- TestSandboxE2E_FileCreation: verify file operations
- TestSandboxE2E_HookOnlyMode: verify Claude CLI skip logic
- TestSandboxE2E_StreamingResponse: verify streaming works
- Add real_e2e_test.go for direct Claude CLI execution testing
Co-authored-by: Cursor <cursoragent@cursor.com>
- Update TestClaudeCommandBuilding to expect new command format
- Rename TestClaudeCCRConfigBuilding to TestClaudeProxyConfigBuilding
- Update assertions for claude-proxy env vars instead of CCR
- Apply gofmt formatting to proxy/types.go
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add --input-format stream-json, --output-format stream-json, --verbose flags
- Use heredoc to pass messages via stdin (no CLI length limit)
- Add BuildInputJSONL function for message conversion
- Add shouldSkipClaudeCLI logic to skip when no prompts/skills/mcp
- Update executor to conditionally start claude-proxy only when needed
- Add SystemPrompt field to Options for skip logic
- Add E2E tests for skip mode and command building
- Fix tests to reflect new command structure
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add claude-proxy: lightweight Go proxy to translate between Anthropic
and OpenAI-compatible APIs with full streaming and tool-calling support
- Update Dockerfile to include claude-proxy binary (multi-arch)
- Add auto-start proxy via entrypoint when env vars are set
- Update executor.go to write proxy config and start proxy
- Simplify command.go to use direct Claude CLI with proxy
- Support both docker run -e and config file for proxy settings
Co-authored-by: Cursor <cursoragent@cursor.com>
- Adjusted assertions in the command test to verify the updated command structure, which now begins with "bash" and includes specific flags for executing CCR commands.
- Enhanced the test to ensure the user prompt is correctly included in the command, improving the accuracy of the test verification.
- Modified the command verification in the sandbox integration test to assert the new command structure, which now starts with "bash" and includes specific arguments for executing CCR commands.
- Enhanced assertions to check for the presence of required command components, improving the robustness of the test.
- Added functionality to build and manage MCP configuration for sandbox environments, allowing for dynamic tool execution.
- Enhanced the Assistant's Stream method to skip MCP tool calls in sandbox mode, with internal handling by Claude CLI.
- Introduced unit tests for MCP configuration building and skills directory resolution, ensuring robust integration.
- Updated sandbox manager to create IPC sessions and manage tool exposure dynamically, improving interaction with external agents.
- Enhanced documentation to reflect new features and integration points for MCP and skills within the sandbox.
- Updated the sandbox integration test to verify JSON fields using snake_case for CCR configuration.
- Added detailed documentation for the sandbox API, including properties, methods, and use cases for file operations and command execution.
- Enhanced context API documentation to include sandbox operations, improving clarity on available features when sandbox is configured.
- Added steps to pull necessary Docker images for sandbox testing in both CI workflows.
- Updated the AI test execution to utilize sandbox configurations, ensuring proper environment setup.
- Introduced sandbox initialization in the Assistant's Stream method, allowing for execution of coding agents like Claude and Cursor.
- Enhanced context management to support sandbox execution, improving flexibility in handling agent operations.
- Introduced an `OnCompleteCallback` type and updated the `Pool` struct to include an optional callback for execution completion.
- Implemented `SetOnComplete` method to allow setting the completion callback.
- Enhanced worker execution logic to notify the completion callback with the execution status (success, failure, or cancellation) after each execution, improving tracking and management of execution states.
- Updated execution control methods (`PauseExecution`, `ResumeExecution`, `StopExecution`) to include error handling and database status updates for paused, running, and cancelled states.
- Introduced `ExecuteWithControl` method in the Executor interface to manage execution with pause/resume capabilities, allowing for better control during execution.
- Enhanced the `Execute` methods across different executors (DryRun, Sandbox, Standard) to support pre-generated execution IDs and control mechanisms.
- Improved error messages in the execution handling API to provide clearer feedback on execution status and errors.
- Added support for a new execution status `ExecPaused` in the execution model, enhancing the tracking of execution states.
- Updated the expected default email channel in the `TestDefaultEmailChannel` test from "email" to "default" to align with recent configuration changes, ensuring accurate test validation.
- Updated the `buildEmailSubject` function to include the robot's display name in the email subject line, improving clarity and personalization.
- Modified the function signature to accept a `robot` parameter, allowing for dynamic subject prefixes based on the robot's identity.
- Ensured that the email subject reflects the robot's name when using template-based or summary-based subjects, enhancing user experience.
- Added new indirect dependencies: `github.com/JohannesKaufmann/dom` and `github.com/JohannesKaufmann/html-to-markdown/v2` for improved HTML processing.
- Updated `github.com/sergi/go-diff` to version 1.4.0 for enhanced diff functionality.
- Modified the `buildEmailBody` function to return both HTML and plain text versions of the email body, improving email formatting capabilities.
- Adjusted the default email channel name in configuration to "default" for better clarity.
- Implemented HMAC-SHA256 signature generation and verification for webhook requests to enhance security.
- Updated the Delivery Center to include the computed signature in the request headers when a secret is configured.
- Added utility functions for computing and verifying HMAC signatures, ensuring integrity of webhook payloads.
- Improved documentation for the new signature handling process to assist developers in implementing secure webhooks.
- Introduced manager ID and email fields in the Robot struct to facilitate mandatory delivery to managers.
- Updated delivery routing logic to ensure manager email is always included if manager ID is set, improving delivery reliability.
- Added JSON serialization handling in the Delivery Center to ensure compatibility with various data types.
- Enhanced context ID generation by replacing time-based IDs with NanoID for improved uniqueness and consistency.
- Introduced tests for validating MCP task output, ensuring only structure validation is performed without semantic checks.
- Implemented the `validateMCPOutput` function to validate MCP task outputs, checking for non-empty results and expected structure.
- Updated the `ExecuteWithRetry` method to incorporate MCP-specific validation logic, improving error handling and output validation for MCP tasks.
- Enhanced test coverage for various output scenarios, including nil, empty string, empty map, and empty array cases, to ensure robust validation behavior.
- Updated MCP task executor ID format to use "mcp_server.mcp_tool" for better clarity and consistency.
- Added required MCP-specific fields (`mcp_server` and `mcp_tool`) to the Task struct and validation logic.
- Enhanced documentation in DESIGN.md and TECHNICAL.md to reflect changes in MCP task structure and requirements.
- Improved error handling in ExecuteMCPTask to ensure proper validation of MCP task fields before execution.
- Updated database queries to include 'agents' and 'mcp_servers' fields in robot data retrieval.
- Enhanced the robot configuration structure to merge agents and MCP servers from the member table into the robot's resources.
- Improved the input formatter to display time markers with check/cross indicators for better context awareness.
- Added tests to validate the new functionality and ensure proper formatting of robot identity when identity is nil.
- Updated README files to include new commands for running tests and extracting results for review.
- Introduced the `yao agent extract` command to facilitate extraction of test results from JSONL files into Markdown or JSON formats.
- Enhanced the `FormatAvailableResources` function to support localization and detailed information for agents and MCP tools.
- Improved output formatting for better readability and usability in test result documentation.
- Added calls to CloseSafeWriter in multiple test cases to ensure all asynchronous writes are completed before verifying output.
- Improved test reliability by ensuring that the SafeWriter's buffer is properly flushed, preventing potential race conditions in output verification.
- Introduced mechanisms to handle agent-to-agent (A2A) calls, including automatic history skipping for forked calls and proper source tracking.
- Enhanced context management with the addition of ForkParentInfo to facilitate child stack creation without race conditions.
- Updated JSAPI methods to ensure correct handling of sub-agent calls, maintaining output isolation and preventing history pollution.
- Improved documentation to clarify the behavior of A2A calls and context management in concurrent scenarios.
- Implemented automatic disabling of SSE output for sub-agent calls to prevent message corruption and client disconnection.
- Introduced a `forceSkipOutput` method to ensure `skip.output` is set to true for all sub-agent requests.
- Updated the `Fork` method in the context to create independent Memory instances, preventing state sharing during concurrent executions.
- Enhanced documentation to clarify the behavior of SSE output and context management in batch operations.
- Introduced new methods `All`, `Any`, and `Race` to the MCP JavaScript API for concurrent tool calls across multiple MCP servers, enabling improved flexibility and performance.
- Updated existing methods to return parsed results directly, simplifying the response handling for developers.
- Enhanced documentation to include detailed descriptions and examples for the new cross-server operations, improving developer guidance and usability.
- Introduced `ctx.agent` and `ctx.llm` objects in the context API for improved agent-to-agent (A2A) and direct LLM calls.
- Added methods for single and parallel agent calls, including `Call`, `All`, `Any`, and `Race`, enabling flexible communication between agents.
- Enhanced documentation with detailed method summaries, parameters, and examples for better developer guidance on using the new APIs.
- Updated `logrus` dependency from v1.9.3 to v1.9.4 and `golang.org/x/sys` from v0.38.0 to v0.40.0 for improved functionality and security.
- Introduced a `Fork` method in the agent context to create child contexts for concurrent agent and LLM calls, preventing race conditions on shared state during batch operations.
- Enhanced the `Orchestrator` methods to utilize forked contexts, ensuring independent execution of agent calls without interference.
- Added initialization for the Agent JSAPI factory to support ctx.agent.* methods, improving agent interaction capabilities.
- Introduced a new agent object in the JSAPI context for calling other agents, enhancing modularity.
- Implemented an OnMessage callback in the context options to handle messages sent via ctx.Send(), allowing for more flexible message processing.
- Eliminated debug print statements for the "thinking" parameter and the full request body in the OpenAI provider, streamlining the request construction process.
- Maintained the functionality of including the "thinking" parameter for models that support reasoning/thinking mode, ensuring improved performance without unnecessary logging.
- Added support for a new "thinking" parameter in the request body for models that support reasoning/thinking mode, improving functionality.
- Updated the request body construction to include debugging output for the full request body, aiding in troubleshooting and development.
- Ensured that the model and other settings are retrieved from the connector, maintaining consistency in configuration handling.
- 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.
- 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.
- Enhanced the `extractGoalName` function to skip empty lines, markdown headers, and horizontal rules while extracting the first meaningful line as the goal name.
- Implemented a new `stripMarkdownFormatting` function to remove various markdown formatting elements, including bold, italic, inline code, and link syntax.
- Added comprehensive unit tests for both `extractGoalName` and `stripMarkdownFormatting` to ensure correct functionality across various markdown scenarios.
- Introduced a new `Description` field in the `Task` struct for a human-readable task description, improving UI clarity.
- Updated the `ParseTask` function to save the description from input data and convert it to a message if no explicit messages are provided.
- Enhanced the `Executor` to update UI fields with localized messages during task execution phases, ensuring better user feedback.
- Implemented a new method in the `ExecutionStore` to persist task status updates, allowing real-time UI updates.
- Added unit tests to validate the new task description handling and UI updates during execution phases.
- Refactored failure message construction to use concise phase names instead of full error messages, improving clarity in UI feedback.
- Updated localization support for failure messages, ensuring accurate translations for various phases in both English and Chinese.
- Added unit tests to validate the new failure message format and localization functionality.
- 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.
- Updated the ListRobots function to enhance caching behavior by explicitly requiring the autonomous_mode filter to be true when using cached results.
- Improved comments for clarity on caching conditions and the implications of autonomous_mode filtering.
- Ensured that when autonomous_mode is not specified or set to false, the database is queried to include all robots, maintaining comprehensive results.
- Added a new `Types` field to the `AssistantFilter` struct to allow filtering by multiple types using an IN query.
- Updated the `GetAssistants` function to apply the new multi-type filter alongside the existing single type filter.
- Modified the OpenAPI endpoint to support the new `types` query parameter for better flexibility in assistant retrieval.
- Ensured backward compatibility by setting a default type when neither `type` nor `types` is specified.
- Updated related documentation and tests to reflect the changes in filtering capabilities.
- Added support for a new `RobotPrompt` field in the `Uses` struct to allow for custom robot system prompts.
- Updated the `Load` function to initialize `RobotPrompt` with a default value if not provided.
- Modified the `SystemConfig` struct to include a connector for the new `RobotPrompt` agent.
- Enhanced the asset binding to include new files related to the `robot_prompt` assistant.
- Updated related documentation and tests to reflect the addition of the `RobotPrompt` functionality.
- Removed the job system integration from the robot execution flow, transitioning to a dedicated ExecutionStore for managing execution records.
- Updated the design documentation to reflect the new architecture, emphasizing the relationship between robots and concurrent executions.
- Revised the API to return execution IDs instead of job IDs, ensuring clarity in execution tracking.
- Enhanced logging mechanisms to utilize the kun/log package for better traceability of execution phases.
- Updated tests and documentation to align with the removal of job-related structures and the introduction of execution management.
- Updated the CreateRobot API to auto-generate the member_id if not provided, enhancing usability and ensuring unique identifiers.
- Revised CreateRobotRequest structure to make member_id optional, aligning with the new auto-generation logic.
- Added a new function for generating unique member IDs with collision detection, ensuring compliance with existing ID patterns.
- Enhanced unit tests to validate the new behavior, ensuring robust error handling and proper ID generation.
- Updated related OpenAPI documentation to reflect changes in request structure and behavior.
- 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.
- 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.
- Added a `Bio` field to the `Robot` structure, allowing for a description of the robot.
- Updated the `cleanupAPITestRobots` function to delete robots with member IDs starting with both "robot_api_" and "api_robot_".
- Implemented new API functions for creating, updating, and removing robots, ensuring proper validation and cache management.
- Enhanced request and response types in `api/types.go` to include the new `Bio` field.
- Added comprehensive tests for the new CRUD operations in `robot_test.go`, ensuring robust validation and error handling.