Skip to content

Documentation / @agentick/kernel / isWithinEngine

Function: isWithinEngine() ​

isWithinEngine(ctx): boolean

Defined in: kernel/src/execution-helpers.ts:74

Check if this execution is within an engine execution (engine:execute or engine:stream). Useful for persistence to know if engine is handling top-level tracking.

Parameters ​

ctx ​

KernelContext

Returns ​

boolean

Example ​

typescript
if (isWithinEngine(ctx)) {
  // Engine handles execution record - just track model-specific stuff
} else {
  // Standalone model call - need full tracking
}

Released under the ISC License.