Managing Code Tasks
This guide explains how to create, execute, and manage code-type tasks in Wegent.
Table of Contentsβ
- What is a Code Task
- Creating a Code Task
- Task Execution Flow
- Task Status Management
- Advanced Features
- Common Issues
What is a Code Taskβ
A code task is a task type in Wegent specifically designed for software development. Unlike regular chat tasks, code tasks connect to Git repositories, allowing AI agents to make code changes directly in the repository.
Core Concept:
Code Task = User Prompt + Code Agent + Git Repository + Branch
Code Tasks vs Chat Tasksβ
| Feature | Code Task | Chat Task |
|---|---|---|
| Git Repository | Required | Optional |
| Code Execution | Runs in Docker container | No code execution |
| Workbench | Shows file changes, commit history | Not displayed |
| Branch Management | Auto-creates feature branches | None |
| Use Cases | Development, refactoring, bug fixes | Q&A, analysis, documentation |
Creating a Code Taskβ
Step 1: Navigate to Code Pageβ
- Click "Code" in the left navigation bar
- The system displays the code task list and input area
Step 2: Select a Code Agentβ
Above the input area, click the agent selector:
- Click the agent dropdown - Shows available agents
- Select a code-type agent - Choose an agent configured with ClaudeCode or Agno Shell
β οΈ Only agents configured with a code-type Shell can execute code tasks
Step 3: Select Code Repositoryβ
- Click the repository selector - Shows repositories you have access to
- Select target repository - Choose the repository for code changes
- Select branch - Choose the base branch (AI will create a new branch from this)
Step 4: Configure Task Options (Optional)β
Model Selectionβ
Click the model selector to override the agent's default model:
- Select model: Choose from the dropdown list
- Force override: When enabled, uses your selected model even if the agent has a configured model
Knowledge Base Contextβ
Click the context button to add knowledge bases:
- Click the "#" button - Opens the context selector
- Select knowledge bases - Check the ones to add
- Confirm selection - Knowledge bases appear as tags
Skill Selectionβ
If the agent supports skills:
- Click the skill button - Opens skill selector
- Select skills - Check the needed skills
- Or use "/" command - Type
/in the input box to trigger skill selection
Step 5: Enter Task Description and Sendβ
- Type your task description in the input box - Clearly describe your requirements
- Press Enter to send - Or click the send button
- Wait for response - Agent starts processing and streams results
Task Execution Flowβ
Execution Stagesβ
1. Task Initializationβ
- System creates task record
- Allocates execution container
- Clones target repository into container
2. Code Analysisβ
- AI analyzes repository structure
- Understands existing code patterns
- Plans implementation approach
3. Code Implementationβ
- AI uses tools to read, edit, create files
- Executes necessary commands (e.g., install dependencies, run tests)
- Shows progress in real-time in the Workbench
4. Code Commitβ
- AI creates feature branch
- Commits code changes
- Generates commit messages
5. Task Completionβ
- Generates task summary
- Shows file change statistics
- Provides option to create PR
Task Status Managementβ
Task Statesβ
| Status | Description | Actions |
|---|---|---|
| PENDING | Waiting to execute | Can cancel |
| RUNNING | Currently executing | Can stop |
| COMPLETED | Execution finished | Can view results, create PR |
| FAILED | Execution failed | Can retry |
| CANCELLED | Was cancelled | Can recreate |
Stopping a Taskβ
If you need to stop a running task:
- Click the stop button - In the input area or task details
- Confirm stop - Task will be marked as cancelled
- View partial results - Completed code changes are preserved
Retrying a Taskβ
If a task fails:
- View error message - Understand the failure reason
- Click retry button - Re-execute the task
- Or modify and retry - Adjust task description and resend
Advanced Featuresβ
Continue Conversationβ
After task completion, you can continue chatting with the agent:
- Send new message in the same task - Agent continues working with previous context
- Request modifications - e.g., "Please rename the function to createUser"
- Request additions - e.g., "Please add unit tests"
View Execution Detailsβ
View detailed execution information in the Workbench:
- Execution Timeline: See tools used by AI and execution order
- Commit History: View all code commits
- File Changes: See specific modifications for each file
Create Pull Requestβ
After task completion, you can directly create a PR:
- Click "Create PR" button - In the Workbench or task menu
- Fill in PR information - Title, description, etc.
- Submit PR - System creates PR in GitHub/GitLab
Export Taskβ
Export task conversation history and code changes:
- Click export button - In the task menu
- Choose format - Markdown or JSON
- Download file - Save to local
Common Issuesβ
Q1: Task stuck in PENDING status?β
Possible causes:
- No available execution containers
- Repository access permission issues
- Git token expired
Solutions:
- Check if system resources are sufficient
- Verify Git token is valid
- Check repository access permissions
Q2: Code commit failed?β
Possible causes:
- Branch protection rules
- Insufficient permissions
- Network issues
Solutions:
- Check target branch protection rules
- Confirm Git token has write permissions
- Retry the task
Q3: AI modified the wrong files?β
Solutions:
- Explicitly specify file paths to modify in the task
- Provide more detailed context information
- Use knowledge base to provide project structure documentation
Q4: How to make AI follow project coding standards?β
Solutions:
- Add
.cursorrulesor.windsurfrulesfile in repository root - Explicitly state coding standards in task description
- Use knowledge base to provide coding standards documentation
Q5: Task execution taking too long?β
Possible causes:
- Task scope too large
- Need to install many dependencies
- Network latency
Solutions:
- Split large tasks into smaller ones
- Use pre-configured base images
- Check network connection
Related Resourcesβ
- Overview - AI Coding feature overview
- Spec Clarification - Requirement clarification feature
- Agent Settings - Configure code agents
Efficiently manage your code tasks and let AI be your programming assistant! π