Analyzes a provided log file for errors and attempts to fix them in the codebase without executing commands. Performs one-pass analysis and fix generation.
{
"task_type": "SingleFix",
"logFile": "build/logs/compilation_errors.log",
"task_description": "Fix compilation errors",
"task_dependencies": ["CompileTask"],
"state": "pending"
}
Analyzed log file: build/logs/compilation_errors.log
Found 3 errors and generated fixes.
Transcript: SingleFixTask_full_report_20240115143022.md
| Field Name | Type | Default | Description |
|---|---|---|---|
| logFile Required | String | — |
The path to the log file containing errors to analyze and fix. |
| task_description | String | null |
Optional description of the task for context and logging. |
| task_dependencies | List<String> | [] |
List of task names that must complete before this task executes. |
| state | TaskState | pending |
Current execution state of the task (pending, running, completed, failed). |
The task generates a markdown transcript file containing:
Static settings defined when the task is registered:
class SingleFixTaskTypeConfig(
name: String? = "SingleFix",
model: ApiChatModel? = null
) : TaskTypeConfig(name, name, model)
Dynamic parameters provided at execution time:
class SingleFixTaskExecutionConfigData(
@Description("The path to the log file containing errors")
var logFile: String? = null,
task_description: String? = null,
task_dependencies: List<String>? = null,
state: TaskState? = null
) : TaskExecutionConfig(...)
Validates the log file path and ensures the file exists. Loads project context and initializes the LLM model.
Reads the log file and parses error messages. Identifies affected files and error types (syntax, type mismatch, missing imports, etc.).
Uses the LLM to generate patch-based fixes for each error. Validates fixes against the codebase structure.
Creates a detailed markdown transcript with analysis results, proposed fixes, and execution summary.
Returns success status and provides link to the generated transcript for user review.
Copy-pasteable Kotlin code to register this task:
import com.simiacryptus.cognotik.plan.tools.run.SingleFixTask
// In your OrchestrationConfig setup:
val singleFixTask = SingleFixTask(
orchestrationConfig = this,
planTask = SingleFixTask.SingleFixTaskExecutionConfigData(
logFile = "build/logs/compilation_errors.log",
task_description = "Fix compilation errors from build",
task_dependencies = listOf("CompileTask")
)
)
// Register in task orchestrator
taskOrchestrator.registerTask(
SingleFixTask.SingleFix,
SingleFixTask.SingleFixTaskTypeConfig(
name = "SingleFix",
model = orchestrationConfig.instance(ApiChatModel.GPT4)
)
)
The text injected into the LLM prompt:
Analyze the log file '{logFile}' and fix any errors found.
This prompt is combined with the project context (file tree, code snippets) and the log file contents to guide the LLM in generating appropriate fixes.
{
"tasks": [
{
"type": "CompileTask",
"config": {
"command": "gradle build"
}
},
{
"type": "SingleFixTask",
"config": {
"logFile": "build/logs/compilation_errors.log",
"task_dependencies": ["CompileTask"],
"task_description": "Analyze and fix compilation errors"
}
}
]
}