{"record":{"id":"0b9545c98ca74b9a","repo":"conductor-oss/conductor","slug":"e-message","errorCode":null,"errorMessage":"${e.message}","messagePattern":"\\$\\{e\\.message\\}","errorType":"http","errorClass":"ConflictException","httpStatus":409,"severity":"warning","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java","lineNumber":567,"sourceCode":"                .version(workflow.getWorkflowVersion())\n                .status(workflow.getStatus().name())\n                .input(workflow.getInput())\n                .output(workflow.getOutput())\n                .currentTask(currentTask)\n                .build();\n    }\n\n    /** Pause a running agent execution. */\n    public void pauseAgent(String executionId) {\n        workflowService.pauseWorkflow(executionId);\n    }\n\n    /** Resume a paused agent execution. */\n    public void resumeAgent(String executionId) {\n        try {\n            workflowService.resumeWorkflow(executionId);\n        } catch (IllegalStateException e) {\n            throw new ConflictException(e.getMessage());\n        }\n    }\n\n    /** Cancel a running agent execution. */\n    public void cancelAgent(String executionId, String reason) {\n        workflowService.terminateWorkflow(\n                executionId, reason != null ? reason : \"Cancelled by user\");\n    }\n\n    /**\n     * Permanently delete an execution record from the database.\n     *\n     * <p>Wraps Conductor's {@code WorkflowService.deleteWorkflow} to hard-delete completed\n     * execution records. Running executions should be terminated first.\n     *\n     * @param executionId the execution to remove\n     * @param archiveTasks if true, archive task records instead of deleting them\n     */","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java#L549-L585","documentation":"Thrown by AgentService.resumeAgent when the underlying workflowService.resumeWorkflow throws an IllegalStateException, which is rethrown as a ConflictException. The conflict means the workflow is not in a state from which it can be resumed (e.g. it is not currently PAUSED, or it is already terminal). ConflictException maps to HTTP 409.","triggerScenarios":"Calling resumeAgent on an execution that is RUNNING (never paused); calling resume on a COMPLETED/FAILED/TERMINATED execution; double-resume where the workflow was already resumed by another caller.","commonSituations":"UI shows a stale status and the user clicks resume on an already-running or already-completed agent; orchestration logic calls resume unconditionally without checking pause state; race condition where two concurrent resume calls land.","solutions":["Check the execution status via getStatus() before calling resumeAgent — only resume if status is PAUSED.","Handle HTTP 409 / ConflictException as a benign no-op if the agent is already running.","Ensure pauseAgent was successfully called before attempting resume."],"exampleFix":"// before\nagentService.resumeAgent(executionId);\n\n// after\nAgentStatusResponse status = agentService.getStatus(executionId);\nif (\"PAUSED\".equals(status.getStatus())) {\n    agentService.resumeAgent(executionId);\n} else {\n    log.info(\"Skipping resume: execution {} is {}\", executionId, status.getStatus());\n}","handlingStrategy":"validation","validationCode":"AgentStatusResponse status = agentService.getStatus(executionId);\nif (!\"PAUSED\".equals(status.getStatus())) {\n    throw new IllegalStateException(\n        \"Cannot resume: execution is \" + status.getStatus());\n}\nagentService.resumeAgent(executionId);","typeGuard":null,"tryCatchPattern":"try {\n    agentService.resumeAgent(executionId);\n} catch (ConflictException e) {\n    // Not in a pausable state — benign if already running\n    log.info(\"Cannot resume {}: {}\", executionId, e.getMessage());\n}","preventionTips":["Check status is PAUSED before calling resumeAgent.","Treat HTTP 409 on resume as a benign no-op.","Ensure pauseAgent completed before attempting resume."],"tags":["conflict","lifecycle","resume","state-mismatch"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}