mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 18:08:12 +00:00
fix(hooks): reuse shared hook context for post-prompt hooks
This commit is contained in:
@@ -1595,13 +1595,7 @@ export async function runEmbeddedAttempt(
|
||||
error: promptError ? describeUnknownError(promptError) : undefined,
|
||||
durationMs: Date.now() - promptStartedAt,
|
||||
},
|
||||
{
|
||||
agentId: hookAgentId,
|
||||
sessionKey: params.sessionKey,
|
||||
sessionId: params.sessionId,
|
||||
workspaceDir: params.workspaceDir,
|
||||
messageProvider: params.messageProvider ?? undefined,
|
||||
},
|
||||
hookCtx,
|
||||
)
|
||||
.catch((err) => {
|
||||
log.warn(`agent_end hook failed: ${err}`);
|
||||
@@ -1655,13 +1649,7 @@ export async function runEmbeddedAttempt(
|
||||
lastAssistant,
|
||||
usage: getUsageTotals(),
|
||||
},
|
||||
{
|
||||
agentId: hookAgentId,
|
||||
sessionKey: params.sessionKey,
|
||||
sessionId: params.sessionId,
|
||||
workspaceDir: params.workspaceDir,
|
||||
messageProvider: params.messageProvider ?? undefined,
|
||||
},
|
||||
hookCtx,
|
||||
)
|
||||
.catch((err) => {
|
||||
log.warn(`llm_output hook failed: ${String(err)}`);
|
||||
|
||||
Reference in New Issue
Block a user