-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Area/AIIssues related to general AI features, except AI ArtifactsIssues related to general AI features, except AI ArtifactsType/Improvement
Description
Current Limitation
Currently, the TaskWrite tool allows tasks to be marked as completed without enforcing diagnostic checks for compilation errors. While the system prompt instructs the agent to use the diagnostics tool before marking tasks as completed, this is only a recommendation and not enforced programmatically.
Current behavior:
- System prompt instructs: "Before marking the task as completed, use the diagnostics tool to check for compilation errors and fix them"
- Agent may or may not follow this instruction
- Tasks can be marked as completed even with compilation errors present
- No validation guard exists in the task completion flow
Location:
- File:
workspaces/ballerina/ballerina-extension/src/features/ai/service/libs/task_write_tool.ts - Function:
handleTaskCompletion(line 304)
Suggested Improvement
Add a validation guard in the handleTaskCompletion function that:
- Automatically runs diagnostic checks before allowing task completion
- Blocks task completion if compilation errors are detected
- Returns feedback to the agent indicating errors must be fixed before proceeding
- Optionally creates a subtask to fix errors if the agent attempts to complete with errors
Implementation approach:
- Insert validation after line 313 (after detecting newly completed tasks)
- Before integration (line 315), call the diagnostics tool
- If errors found, return error result to agent with error details
- Only proceed with integration if no compilation errors exist
Benefits:
- Prevents incomplete implementations from being marked as done
- Enforces code quality at the task level
- Makes diagnostic checking mandatory rather than optional
- Provides clear feedback loop for error resolution
Version
No Version
Metadata
Metadata
Assignees
Labels
Area/AIIssues related to general AI features, except AI ArtifactsIssues related to general AI features, except AI ArtifactsType/Improvement