{"record":{"id":"118cb2b8eb9be675","repo":"sipeed/picoclaw","slug":"hook-aborted-turn-during-before-llm-s","errorCode":null,"errorMessage":"hook aborted turn during before_llm: %s","messagePattern":"hook aborted turn during before_llm: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/turn_coord.go","lineNumber":521,"sourceCode":"\t\t\tGracefulTerminal: false,\n\t\t})\n\t\tswitch decision.normalizedAction() {\n\t\tcase HookActionContinue, HookActionModify:\n\t\t\tif llmReq != nil {\n\t\t\t\tif strings.TrimSpace(llmReq.Model) != \"\" && llmReq.Model != llmModel {\n\t\t\t\t\thookModelChanged = true\n\t\t\t\t}\n\t\t\t\tllmModel = llmReq.Model\n\t\t\t\tmessages = llmReq.Messages\n\t\t\t\tllmOpts = llmReq.Options\n\t\t\t\tdelete(llmOpts, \"native_search\")\n\t\t\t}\n\t\tcase HookActionAbortTurn:\n\t\t\treason := decision.Reason\n\t\t\tif reason == \"\" {\n\t\t\t\treason = \"hook requested turn abort\"\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"hook aborted turn during before_llm: %s\", reason)\n\t\tcase HookActionHardAbort:\n\t\t\treason := decision.Reason\n\t\t\tif reason == \"\" {\n\t\t\t\treason = \"hook requested turn abort\"\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"hook aborted turn during before_llm: %s\", reason)\n\t\t}\n\t}\n\tif hookModelChanged {\n\t\t// Hook-selected models must not continue through the pre-hook fallback\n\t\t// candidate list, otherwise fallback execution would call the original\n\t\t// candidate model and silently ignore the hook decision.\n\t\tactiveCandidates = nil\n\t}\n\n\tcallSideLLM := func(callMessages []providers.Message) (*providers.LLMResponse, error) {\n\t\tif len(activeCandidates) > 1 && al.fallback != nil {\n\t\t\tfbResult, err := al.fallback.ExecuteCandidate(","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/turn_coord.go#L503-L539","documentation":"Error \"hook aborted turn during before_llm: %s\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/agent/turn_coord.go:521 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"}