Files
openclaw/src/agents/runtime/internal-hooks.ts
T
Peter Steinberger 7fd723b515 fix(agent): apply steering before unstarted tools (#120470)
* fix(agent): apply steering before unstarted tools

Restore steering checkpoints before sequential tool launches and before parallel batch launch. Preserve paired synthetic tool results, async callback compatibility, and Code Mode outcome handling.

* fix(agent): delay tool loop admission commits

Commit loop-detection history only for calls crossing the final launch checkpoint. Release steering-skipped markers, add repeated-steer coverage, and align remaining steering contract text.

* fix(agent): keep tool admission lifecycle internal

Attach delayed admission callbacks through the private internal-hooks seam so steering history remains correct without widening the public Agent Core or Plugin SDK contract.

* fix(agent): preserve steering API contracts

Keep public steering callbacks Promise-based and protocol error kinds unchanged. Use private synchronous draining and structured skip details to retain launch-boundary behavior without API or generated protocol drift.

* test(gateway): use canonical steering fixture config

Use keyed agent entries in the real gateway steering harness so current main does not migrate the fixture during startup.

* fix(agent): remove unused lifecycle re-export

* fix(agent): gate tool launch after wrapper preflight

Split OpenClaw tool execution into private prepare and launch phases so steering is checked after policy, approval, validation, and reconciliation but before the original side effect. Preserve final arguments, voice grants, loop admission, context wrappers, and direct tool execution.

* fix(agent): preserve steering callback receiver

Invoke public steering callbacks with their AgentLoopConfig receiver and cover method-style implementations that read config-owned queue state.
2026-08-08 09:52:10 -07:00

10 lines
322 B
TypeScript

export {
attachInternalToolBatchLifecycle,
attachInternalToolExecutionPreparer,
copyInternalToolExecutionPreparer,
getInternalToolExecutionPreparer,
setInternalBeforeToolBatch,
type InternalBeforeToolBatchHook,
type InternalToolExecutionPreparer,
} from "../../../packages/agent-core/src/internal-hooks.js";