{"record":{"id":"cb24ec80e15ead75","repo":"sipeed/picoclaw","slug":"no-active-turn-state-found-for-session-s","errorCode":null,"errorMessage":"no active turn state found for session %s","messagePattern":"no active turn state found for session (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/steering.go","lineNumber":514,"sourceCode":"\t\tdefault:\n\t\t\treturn results\n\t\t}\n\t}\n}\n\n// ====================== Hard Abort ======================\n\n// HardAbort immediately cancels the running agent loop for the given session,\n// cascading the cancellation to all child SubTurns. This is a destructive operation\n// that terminates execution without waiting for graceful cleanup.\n//\n// Use this when the user explicitly requests immediate termination (e.g., \"stop now\", \"abort\").\n// For graceful interruption that allows the agent to finish the current tool and summarize,\n// use Steer() instead.\nfunc (al *AgentLoop) HardAbort(sessionKey string) error {\n\ttsInterface, ok := al.activeTurnStates.Load(sessionKey)\n\tif !ok {\n\t\treturn fmt.Errorf(\"no active turn state found for session %s\", sessionKey)\n\t}\n\n\tts, ok := tsInterface.(*turnState)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid turn state type for session %s\", sessionKey)\n\t}\n\n\tif strings.HasPrefix(ts.turnID, \"pending-\") {\n\t\treturn fmt.Errorf(\"turn is still initializing for session %s\", sessionKey)\n\t}\n\n\tlogger.InfoCF(\"agent\", \"Hard abort triggered\", map[string]any{\n\t\t\"session_key\":            sessionKey,\n\t\t\"turn_id\":                ts.turnID,\n\t\t\"depth\":                  ts.depth,\n\t\t\"initial_history_length\": ts.initialHistoryLength,\n\t})\n","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/steering.go#L496-L532","documentation":"Error \"no active turn state found for session %s\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/agent/steering.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}