glue: honor the caller's original event when invoked via workflow_call (fix auto-trigger no-op) #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
serious-devs/ai-factory#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #1 (finding 1). This blocks day-to-day usage: every automatic trigger currently produces a no-op run.
Evidence (observed live, test_factory_ai)
Commenting on an agent-labeled issue fired a run (event
issue_comment), but the job log shows:[agent 0.0s] not addressed to the agent (unhandled event workflow_call/created) — skippingA manual dispatch with an explicit
modeworks, so the whole plan/build machinery is fine — only intent inference is broken on the reusable-workflow path.Root cause
Project workflows delegate through
uses: serious-devs/ai-factory/.forgejo/workflows/agent.yml@main. Inside the called workflow,GITHUB_EVENT_NAMEisworkflow_call, soreadEvent()inglue/src/event.tsbuilds anEventInfowithname: 'workflow_call'andaction: 'created'— thecreatedvalue comes from the CALLER's payload, which provesGITHUB_EVENT_PATHstill holds the originalissue_comment/issuesevent.resolveIntent()has noworkflow_callbranch and falls through torun: false.Proposed change
glue/src/event.ts— inreadEvent(), whenGITHUB_EVENT_NAME === 'workflow_call', keep parsingGITHUB_EVENT_PATH(the caller's event) and derive the effective event family from the payload shape instead of the env var:comment→ treat asissue_comment(action from payload)issue+label→ treat asissues/labeledissue→ treat asissues(action from payload)workflow_call(falls through to the existing skip)resolveIntent()should need no change: the existingissues labeled/issues opened/issue_commentbranches then handle everything, including the self-trigger guard inmain.ts(senderLogincomes from the caller payload'ssender.login).Add regression tests to
glue/src/smoke.ts, which already buildsGITHUB_EVENT_PATHfixtures and asserts onresolveIntentresults:@agent planon an unlabeled issue + envworkflow_call→{ mode: 'plan', run: true }workflow_call→{ mode: 'plan', run: true }issues/labeledwith labelbuild+ envworkflow_call→{ mode: 'build', run: true }issues/labeledwith an irrelevant label + envworkflow_call→run: falseworkflow_callwith a payload withoutissue/comment(e.g. push) →run: falseAGENT_MODE=build+ envworkflow_call→ the explicit mode still winsDeployment note
Glue changes only take effect after a new image tag is built and pushed and the
agent-imagedefault in.forgejo/workflows/agent.ymlis updated (currentlyfactory.serious-devs.io/serious-devs/ai-factory:20261013-1) — seedocs/setup.md§3.Acceptance criteria
npm run checkpasses and all the new smoke.ts cases above are present and greenserious-devs/test_factory_ai: on a scratch issue labeledagent, posting a plain comment triggers a run whoseagent-1job log showstrigger: ...(nonot addressed to the agentskip) and the agent posts a plan reply — no manual dispatchbuild(automatic) runs the build without manual dispatchmodestill behaves exactly as today