Skip to content

Commit f325119

Browse files
authored
fix: resolve undefined $agent_id and $job_snapshot in AIStep::executeStep() (#826)
Both variables were defined in validateStepConfiguration() but used in executeStep() without being re-defined. PHP treated them as null, which silently broke per-agent tool policies (ToolPolicyResolver skipped agent filtering) and per-agent model overrides (global defaults used instead). Adds the two missing lines at the top of executeStep() to read from the engine snapshot, matching the pattern already used in validateStepConfiguration().
1 parent c8bec26 commit f325119

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

inc/Core/Steps/AI/AIStep.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ protected function executeStep(): array {
179179
$max_turns = PluginSettings::get( 'max_turns', PluginSettings::DEFAULT_MAX_TURNS );
180180

181181
// Resolve user_id and agent_id from engine snapshot (set by RunFlowAbility).
182-
$user_id = (int) ( $job_snapshot['user_id'] ?? 0 );
182+
$job_snapshot = $this->engine->get( 'job' );
183+
$agent_id = (int) ( $job_snapshot['agent_id'] ?? 0 );
184+
$user_id = (int) ( $job_snapshot['user_id'] ?? 0 );
183185

184186
$payload = array(
185187
'job_id' => $this->job_id,

0 commit comments

Comments
 (0)