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
- Sending Follow-ups While Running
- Advanced Features
- Viewing Codex-generated Visualizations
- Cleaning Stale Runtimes
- 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: Open the Code Entryβ
- Click "Code" in the left navigation bar to enter coding mode at
/chat?agent=code - 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 a ClaudeCode 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
When you switch to a different model in an existing Wework conversation, Wework asks for confirmation first. Different models may interpret existing context differently and may vary in tool support, response style, and task continuity. After confirmation, the new model is used for the next message; a response already in progress continues with the previous model. No warning is shown when selecting a model for a new conversation or reselecting the model that is already chosen.
Friendly Titlesβ
You can enable Use friendly titles under Settings > General > Runtime. It is off by default, and enabling it requires a title-generation model:
- Same as task: The default option. Each new task uses the model actually selected for that task to generate its title.
- A specific model: Used only to generate the title asynchronously; it does not change the model used by the task itself.
Title generation never blocks task submission. If a selected title model is no longer available, Wework skips title generation and still creates the task normally.
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
- Add attachments (optional) - Use the attachment button, or drag files from Finder directly into the Wework input box
- 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
After the retry request is accepted, the failed message turn is removed from the conversation. When the retry succeeds, the conversation keeps the original user message and the new successful response without retaining the old failure card or leaving an empty response turn. Wework applies the same rule when the task is reopened.
Sending Follow-ups While Runningβ
While a Wework task is running, you can choose among three send modes:
- Send after current response: queues the message until the current turn finishes. Press
Enter. - Guide current response: keeps the current turn running and lets Codex apply the instruction at its next safe input boundary. Press
Command/Ctrl + Enter. - Interrupt and send now: stops the current turn and immediately sends the message as a new turn in the same conversation. Press
Command/Ctrl + Shift + Enter.
After entering a message, use the down arrow on the right side of the send button to open the menu. The clock means wait for the current response, the turning arrow means guide the current response, and the lightning bolt means interrupt and send immediately. Interrupting does not roll back file changes or other tool side effects that already occurred. Regular queued messages remain queued.
The queue sends messages from top to bottom. When several messages are queued, drag the handle on the left of a message to reorder the list with live feedback. Stopping the current response also pauses the queue instead of immediately sending the next message. Selecting Continue sending restores the guidance state and sends the first queued message immediately.
If you submit new composer text while the queue is paused, Wework asks how to handle the existing queue:
- Keep and continue: sends the new composer message first, then continues the preserved queue; the composer is cleared after submission.
- Clear queue: removes the existing queue and sends only the new composer message.
- Cancel: sends nothing and preserves both the composer and the queue.
The temporary sidebar conversation supports automatic queueing, cancellation, and editing: a message submitted while the current response is running appears in the pending queue and is sent automatically after the current response finishes. The sidebar does not surface βtask is already runningβ as a send failure while a message is queued; you can cancel or edit the pending message from its queue card.
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
- Tool Duration: Each command or tool row shows its own precise duration; the tool-group header does not count the turn's reasoning and waiting time as tool duration
- Reasoning Summary: Shows the latest model-provided reasoning summary while work is active and keeps it expandable after completion
- 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
Viewing Codex-generated Visualizationsβ
When Codex creates an HTML visualization in the task workspace and references it in its response, Wework displays the chart or interactive page directly in that response. You do not need to copy a file path or open a separate browser.
- Wework loads only HTML files created or modified in the current response's file changes. Deleted, reverted, or unlisted files are never loaded inline.
- The visualization runs in a script-isolated iframe and cannot access the Wework page.
- Only relative workspace paths ending in
.html,.htm, or.xhtmlare accepted. Parent traversal, absolute paths, and directives inside code fences remain normal text. - A Codex visualization directive may reference only the file name. Wework resolves a unique matching file from the current response's file changes, including fragments organized by date and thread under
.codex/visualizations/. - Wework wraps HTML fragments in a UTF-8 visualization host, supplies the Codex visualization theme variables, and automatically sizes the iframe to the fragment content.
Cleaning Stale Runtimesβ
Admins can manually clean up code task runtimes that have not been updated for a long time to release execution container resources. Cleanup only deletes runtime Pods or containers. It does not delete Task records, conversation history, or code changes.
Use this when:
- A task has stopped or finished, but its execution environment still consumes resources
- A runtime has had no activity for a long time and should be reclaimed by Task ID
- You want to run a dry run first, then perform the actual cleanup
Cleanup rules:
- Cleanup targets one Task ID at a time and is not a full cleanup action from the user interface
- Runtimes newer than the configured inactive duration are not deleted
- Tasks with
preserveExecutorenabled are not cleaned up - Device executors are not deleted by this cleanup entrypoint
- Task history remains available after cleanup, but rerunning work allocates a new runtime
For API details, see Runtime Cleanup in the developer documentation.
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! π