fix: address clawsweeper hook cleanup findings

This commit is contained in:
jesse-merhi
2026-05-06 10:31:34 +10:00
committed by clawsweeper
parent 2f1b671535
commit d4b8acb117
3 changed files with 5 additions and 9 deletions

View File

@@ -406,8 +406,9 @@ do not run in live chat traffic, check these first:
containers, PID 1 may only be a supervisor; restart or signal the child
`openclaw gateway run` process.
- Use `openclaw plugins inspect <id> --runtime --json` to confirm hook registrations and
diagnostics. Non-bundled conversation hooks such as `llm_input`,
`llm_output`, `before_agent_finalize`, and `agent_end` need
diagnostics. Non-bundled conversation hooks such as `before_model_resolve`,
`before_agent_reply`, `before_agent_run`, `llm_input`, `llm_output`,
`before_agent_finalize`, and `agent_end` need
`plugins.entries.<id>.hooks.allowConversationAccess=true`.
- For model switching, prefer `before_model_resolve`. It runs before model
resolution for agent turns; `llm_output` only runs after a model attempt

View File

@@ -2766,11 +2766,6 @@ export async function runEmbeddedAttempt(
? ""
: buildCurrentTurnPromptContextSuffix(params.currentTurnContext);
const promptForModel = promptSubmission.prompt + currentTurnPromptContextSuffix;
const blockedTranscriptPrompt =
effectiveTranscriptPrompt ??
(isRawModelRun
? params.prompt
: annotateInterSessionPromptText(params.prompt, params.inputProvenance));
const runtimeSystemContext = promptSubmission.runtimeSystemContext?.trim();
if (promptSubmission.runtimeOnly && runtimeSystemContext) {
const runtimeSystemPrompt = composeSystemPromptWithHookContext({

View File

@@ -79,7 +79,7 @@ import {
cleanupManagedOutgoingImageRecords,
createManagedOutgoingImageBlocks,
} from "../managed-image-attachments.js";
import { ADMIN_SCOPE, TALK_SECRETS_SCOPE } from "../method-scopes.js";
import { ADMIN_SCOPE } from "../method-scopes.js";
import {
GATEWAY_CLIENT_CAPS,
GATEWAY_CLIENT_MODES,
@@ -1714,7 +1714,7 @@ function broadcastChatError(params: {
}
export const chatHandlers: GatewayRequestHandlers = {
"chat.history": async ({ params, respond, context, client }) => {
"chat.history": async ({ params, respond, context }) => {
if (!validateChatHistoryParams(params)) {
respond(
false,