Skip to content

fix: resolve undefined $agent_id and $job_snapshot in AIStep::executeStep()#826

Merged
chubes4 merged 1 commit intomainfrom
fix/aistep-agent-id-undefined
Mar 16, 2026
Merged

fix: resolve undefined $agent_id and $job_snapshot in AIStep::executeStep()#826
chubes4 merged 1 commit intomainfrom
fix/aistep-agent-id-undefined

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 16, 2026

Summary

  • $job_snapshot and $agent_id were defined in validateStepConfiguration() but referenced in the separate method executeStep() without being re-defined
  • PHP treated both as null, which silently broke two things:
    1. Per-agent tool policiesToolPolicyResolver received agent_id = 0, skipping all agent-specific tool filtering
    2. Per-agent model overridesresolveModelForAgentContext() received null, always returning global defaults instead of agent-specific model config
  • Also caused PHP Warning noise in debug.log every 5 minutes (Undefined variable $agent_id on lines 220/227)

Fix

Two lines added at the top of executeStep(), matching the exact pattern already used in validateStepConfiguration():

$job_snapshot = $this->engine->get( 'job' );
$agent_id     = (int) ( $job_snapshot['agent_id'] ?? 0 );

Impact

  • Eliminates PHP Warning log noise
  • Enables per-agent tool policies to actually apply during pipeline AI execution
  • Enables per-agent model overrides to work in pipeline context
  • No behavioral change for flows without agent-specific config (they already fall through to global defaults)

…Step()

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().
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Homeboy Results — data-machine

Lint

⚡ Scope: changed files only

lint (changed files only)

Test

Failure Digest

Test Failure Digest

Autofixability classification

  • Overall: human_needed
  • Autofix enabled: no
  • Autofix attempted this run: no
  • Human-needed failed commands:
    • test
  • Failed commands with available automated fixes:
    • test
  • Automated fixes are disabled for this step. Commands with available fix support in this run: test

Machine-readable artifacts

  • homeboy-lint-summary.json
  • homeboy-test-failures.json
  • homeboy-audit-summary.json
  • homeboy-autofixability.json

⚡ Scope: changed files only

test (changed files only)

Audit

⚡ Scope: changed files only

audit (changed files only)

Tooling versions
  • Homeboy CLI: homeboy 0.78.0+b5e69b75
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Homeboy Action v1

@chubes4 chubes4 merged commit f325119 into main Mar 16, 2026
2 of 3 checks passed
@chubes4 chubes4 deleted the fix/aistep-agent-id-undefined branch March 16, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant