{"record":{"id":"e193d2d615a19fcb","repo":"sipeed/picoclaw","slug":"turn-s-is-already-aborting","errorCode":null,"errorMessage":"turn %s is already aborting","messagePattern":"turn (.+?) is already aborting","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/steering.go","lineNumber":457,"sourceCode":"\t)\n\n\treturn nil\n}\n\n// InterruptHard aborts an arbitrary active turn. In parallel mode this may\n// target the wrong session. Prefer HardAbort(sessionKey) instead.\n//\n// Deprecated: Use HardAbort(sessionKey) for session-safe aborts.\nfunc (al *AgentLoop) InterruptHard() error {\n\tts := al.getAnyActiveTurnState()\n\tif ts == nil {\n\t\treturn fmt.Errorf(\"no active turn\")\n\t}\n\tif strings.HasPrefix(ts.turnID, \"pending-\") {\n\t\treturn fmt.Errorf(\"turn is still initializing for session %s\", ts.sessionKey)\n\t}\n\tif !ts.requestHardAbort() {\n\t\treturn fmt.Errorf(\"turn %s is already aborting\", ts.turnID)\n\t}\n\n\tal.emitEvent(\n\t\truntimeevents.KindAgentInterruptReceived,\n\t\tts.eventMeta(\"InterruptHard\", \"turn.interrupt.received\"),\n\t\tInterruptReceivedPayload{\n\t\t\tKind: InterruptKindHard,\n\t\t},\n\t)\n\n\treturn nil\n}\n\n// ====================== SubTurn Result Polling ======================\n\n// dequeuePendingSubTurnResults polls the SubTurn result channel for the given\n// session and returns all available results without blocking.\n// Returns nil if no active turn state exists for this session.","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/steering.go#L439-L475","documentation":"Transition guard in the deprecated InterruptHard: the active turn's requestHardAbort returned false — the turn already has an abort in flight (an earlier InterruptHard/HardAbort succeeded), so a second abort request is refused as redundant. The turnID identifies the turn that is already aborting; nothing is emitted and no state changes.","triggerScenarios":"Thrown at pkg/agent/steering.go:457 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as success: the abort was already requested and is in progress","Wait for the abort to complete instead of re-requesting","Use HardAbort(sessionKey) for a session-safe idempotent check"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}