Skip to content

Agent bundle loop omits required adjacent handler tool #2578

Closed

Description

@chubes4

Summary

The wp-site-generator Site Generation Loop fails before the first model call because Data Machine marks the required adjacent handler tool unavailable even though the agent bundle workflow wires github_issue_publish via the adjacent publish step and tool recorder.

Evidence

  • Failing workflow: https://github.com/chubes4/wp-site-generator/actions/runs/27094708135
  • Failed task: website-idea-agent
  • Error reason: required_handler_tool_unavailable
  • Error message: AI step requires adjacent handler tools that are not available to the model.
  • Required/expected handler tool: github_issue_publish
  • Downstream symptoms: no issue_number / issue_url outputs, then design/static tasks skip due missing output bindings.

Expected

When an AI step is paired with an adjacent publish/handler step in an ephemeral agent-bundle flow, the required handler tool should be available to the model and preserved through visibility/tool-policy filtering. The model should be able to call github_issue_publish exactly once and satisfy the configured recorder/output assertions.

Notes

This is not an importer/compiler failure. The run reached Homeboy agent-task execution after WP Codebox/Homeboy setup and failed during Data Machine AI step tool preparation.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Capturing the failing workflow evidence and drafting the runtime bug report.

Activity

  1. added this to the 1.0 milestone on Aug 14, 2026
  2. added
    1.0-blockerBlocks the Data Machine core 1.0 release
    and removed
    1.0-blockerBlocks the Data Machine core 1.0 release
    on Aug 14, 2026
  3. chubes4 commented on Aug 20, 2026

    @chubes4
    MemberAuthor

    Removed the Data Machine 1.0 blocker label. The root activation-order defect was fixed upstream in Automattic/wp-codebox#753; remaining work is end-to-end scenario verification and a stale smoke assertion cleanup.

  4. chubes4 commented on Aug 23, 2026

    @chubes4
    MemberAuthor

    Bounded verification reached a reproduced current Data Machine defect, so this moved to a minimal PR rather than closing with no code change: #3344

    Evidence:

    • Exact bundle pinned from failing run 27094708135 (b2669b1e59681e58997f2bf6bacfd18eb8bf230d).
    • Current WP Codebox loaded Agents API, Data Machine, Data Machine Code, and the adjacent GitHub handler as runtime components; the original required_handler_tool_unavailable activation-order failure did not recur.
    • Deterministic provider/GitHub doubles prevented live issue mutation.
    • First current blocker: SQLite exposed no @@SESSION.max_allowed_packet; Data Machine converted that to a zero-byte query budget and rejected the ~5 KB workflow engine snapshot. Before artifact: runtime-mt5bthvq-pbzjx6 (engine_data_query_oversize, new_bytes=4863, estimated_query_bytes=13822).
    • After the PR fix, artifact runtime-mt5c0zhb-je5312 records Stored engine_data successfully and advances into the direct action lifecycle.
    • A separate SQLite lifecycle blocker discovered after that point is tracked as SQLite savepoint release rolls back job status transitions #3340 rather than worked around here.
    • Green focused gates: drain claim smoke 29 assertions; transaction scope smoke 0 failures; bundle runner contract 66 assertions; adjacency resolver 13 assertions.
    • Canonical Homeboy run baf9f7c9-a15c-47aa-9712-735e65771213 failed closed with PHPUNIT_ZERO_TESTS cause=recipe_run_no_executions (zero executed, not a test failure).

    Required-handler policy remains unchanged.

  5. chubes4 commented on Aug 23, 2026

    @chubes4
    MemberAuthor

    Exact deterministic replay after #3346 isolated the next owner-layer blocker; this issue remains open.

    Replay contract:

    • exact bundle revision b2669b1e59681e58997f2bf6bacfd18eb8bf230d
    • WordPress 6.9.2, PHP 8.3.32
    • deterministic OpenAI and GitHub doubles; no live external mutation
    • required github_issue_publish call count: exactly one
    • required output bindings: issue_number, issue_url

    Retained result:

    • runtime runtime-mt6bqbcc-dfymmz
    • artifact bundle artifact-bundle-sha256-38b3a05a217740e7b6801de40989b68ad518c5fa789c97c5a683ea9ae0df5161
    • artifact path /mnt/extrachill-workspace/tmp/opencode/verify-2578-after-3346-filesystem-trace-wp692/runtime-mt6bqbcc-dfymmz

    Observed sequence:

    1. Direct operation job is created and action 6 is enqueued.
    2. Drain starts action 6.
    3. SAVEPOINT datamachine_transaction_1 is active.
    4. The SQLite adapter tries BEGIN IMMEDIATE before translating/executing the pending-to-processing UPDATE.
    5. SQLite returns cannot start a transaction within a transaction; wpdb->update() returns boolean false, rows_affected=0, with non-empty last_error.
    6. Action Scheduler records the action complete, but the job remains pending and github_issue_publish executes 0 times.

    This disproves #3348's affected-row diagnosis. The distinct owner-layer blocker is tracked at WordPress/sqlite-database-integration#495. PR #3353 was corrected to remove the unsafe fallback and is closing without merge.

  6. chubes4 commented on Aug 23, 2026

    @chubes4
    MemberAuthor

    Final deterministic verification is green with the upstream SQLite owner fix from WordPress/sqlite-database-integration#496 (9879478e39d5e8b3eb0e6a3651b39d4f0f7f77f0). Closing this issue.

    Exact contract

    • pinned wp-site-generator bundle revision: b2669b1e59681e58997f2bf6bacfd18eb8bf230d
    • task: call github_issue_publish exactly once as the first and only publish action
    • required outputs: issue_number, issue_url
    • deterministic OpenAI model discovery, Responses API, GitHub authentication, and GitHub API doubles
    • no live external mutation
    • current Data Machine ef90a97f1, current Agents API, refreshed current Data Machine Code, current OpenAI provider
    • WordPress 7.0
    • PR System task: Theme/asset audit (enqueued scripts and styles) #496 SQLite plugin and mysql-on-sqlite source overlaid only inside disposable WP Codebox; neither source worktree was modified and PR System task: Theme/asset audit (enqueued scripts and styles) #496 was not merged here

    Final retained evidence

    • runtime: runtime-mt6eng03-f1aytk
    • artifact bundle: artifact-bundle-sha256-38b3a05a217740e7b6801de40989b68ad518c5fa789c97c5a683ea9ae0df5161
    • artifact path: /mnt/extrachill-workspace/tmp/opencode/verify-2578-sqlite-496-wp70-final-7/runtime-mt6eng03-f1aytk
    • recipe run: run_5dde34c157484629b9af96b5710536a7

    Exact passing assertions:

    {
      "job_count": 1,
      "terminal_success": true,
      "job_status": "completed",
      "github_issue_publish_visible": true,
      "github_issue_publish_calls": 1,
      "issue_number_bound": 2578001,
      "issue_url_bound": "https://github.example.test/chubes4/wp-site-generator/issues/2578001",
      "payload_fields": ["title", "body", "labels"],
      "forbidden_failures_absent": [
        "required_handler_tool_unavailable",
        "engine_data_query_oversize",
        "cannot start a transaction within a transaction",
        "status_persistence_failed",
        "wait_incomplete"
      ]
    }

    The runtime result independently reports completion_outcome.status=completed, success=true, and both required outputs present.

    Historical SQLite proof

    The intermediate WordPress 6.9.2 run is retained as:

    • runtime: runtime-mt6dngjy-w0lj4q
    • artifact bundle: artifact-bundle-sha256-e6292e445f7dee76e5184865e37f5ef3d3a7b235987607ea05752a0992f2f660

    That run proved PR #496 fixed the SQLite lifecycle boundary: the job left pending, drained its action, and reached a terminal status without a nested BEGIN failure. Its later AI failure was not a valid current Data Machine compatibility result because current Data Machine requires WordPress 7.0; no WordPress 7 compatibility shims were retained.

    Fixture correction

    The retained GitHub double expected the obsolete synthetic endpoint Extra-Chill/verify-2578-fixture. The pinned bundle correctly configures chubes4/wp-site-generator, so the disposable fixture was corrected to intercept https://api.github.com/repos/chubes4/wp-site-generator/issues. A fresh runtime reset the call counter and produced exactly one successful call. The current provider's deterministic /v1/models discovery and authentication were also supplied without permitting network writes.

    Refs WordPress/sqlite-database-integration#495
    Refs WordPress/sqlite-database-integration#496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions