Add intelligent image selection for development environments
Integrate chorus-dev-images repository with automatic language detection and appropriate development container selection. New features: - ImageSelector for automatic language-to-image mapping - Language detection from task context, description, and repository - Standardized workspace environment variables - Support for 7 development environments (Rust, Go, Python, Node, Java, C++) Changes: - pkg/execution/images.go (new): Image selection and language detection logic - pkg/execution/engine.go: Modified createSandboxConfig to use ImageSelector This ensures agents automatically get the right tools for their tasks without manual configuration. Related: https://gitea.chorus.services/tony/chorus-dev-images 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -395,15 +395,25 @@ func (e *DefaultTaskExecutionEngine) executeSandboxCommands(ctx context.Context,
|
||||
|
||||
// createSandboxConfig creates a sandbox configuration from task requirements
|
||||
func (e *DefaultTaskExecutionEngine) createSandboxConfig(request *TaskExecutionRequest) *SandboxConfig {
|
||||
// Use image selector to choose appropriate development environment
|
||||
imageSelector := NewImageSelector()
|
||||
selectedImage := imageSelector.SelectImageForTask(request)
|
||||
|
||||
config := &SandboxConfig{
|
||||
Type: "docker",
|
||||
Image: "alpine:latest",
|
||||
Image: selectedImage, // Auto-selected based on task language
|
||||
Architecture: "amd64",
|
||||
WorkingDir: "/workspace",
|
||||
WorkingDir: "/workspace/data", // Use standardized workspace structure
|
||||
Timeout: 5 * time.Minute,
|
||||
Environment: make(map[string]string),
|
||||
}
|
||||
|
||||
// Add standardized workspace environment variables
|
||||
config.Environment["WORKSPACE_ROOT"] = "/workspace"
|
||||
config.Environment["WORKSPACE_INPUT"] = "/workspace/input"
|
||||
config.Environment["WORKSPACE_DATA"] = "/workspace/data"
|
||||
config.Environment["WORKSPACE_OUTPUT"] = "/workspace/output"
|
||||
|
||||
// Apply defaults from engine config
|
||||
if e.config.SandboxDefaults != nil {
|
||||
if e.config.SandboxDefaults.Image != "" {
|
||||
|
||||
Reference in New Issue
Block a user