Summary
#49408 (fixing #49400) added a ref field to DispatchWorkflowOutput
in schemas/agent-output.json and updated dispatch_workflow.cjs's ref
resolution priority to check message.ref first. That part works — I verified it
with unit-level testing against a compiled workflow.
But the per-workflow MCP tool the agent actually calls to request a dispatch
never got updated to expose ref as a parameter. The agent has no way to
supply it, so message.ref is always absent in practice, and every dispatch
silently falls through the priority chain to GITHUB_REF/context.ref — the
dispatching workflow's own trigger ref, not anything the agent intended.
Where the gap is (confirmed against v0.84.2 and current main)
pkg/workflow/safe_outputs_dispatch.go, generateDispatchWorkflowTool:
func generateDispatchWorkflowTool(workflowName string, workflowInputs map[string]any) map[string]any {
...
tool := generateWorkflowToolDefinition(workflowToolDefinitionOptions{
workflowName: workflowName,
workflowInputs: workflowInputs,
descriptionFormat: "Dispatch the '%s' workflow with workflow_dispatch trigger. ...",
metadataKey: "_workflow_name",
})
...
}
Neither this function nor generateWorkflowToolDefinition (in
pkg/workflow/safe_outputs_workflow_helpers.go) references ref or
allowed-refs anywhere — I grepped both files at v0.84.2 and at current
main; zero hits either version. The generated tool's inputSchema.properties
only ever contains the target workflow's own workflow_dispatch inputs (e.g.
model, build-type, platform) — there is no generic ref/branch property
added regardless of whether the workflow's dispatch-workflow config sets
allowed-refs.
Compare to dispatch_workflow.cjs (the runtime handler), which does look for
message.ref and does have allowed-refs matching logic — that side of
#49408 is real and works. It's just unreachable, because nothing ever puts
ref in the agent's hands.
Live evidence
tenstorrent/tt-metal, workflow "Silencer", run
https://github.com/tenstorrent/tt-metal/actions/runs/30729757440 (job agent).
The workflow's dispatch-workflow config has allowed-refs: ["silencer/*"]
configured correctly. The agent's own reasoning trace noticed the gap live:
I'm noticing the t3000_unit_tests dispatch tool doesn't have a ref or branch
parameter in its schema—just build-type, model, and platform—so it might not
target my specific branch automatically.
And the raw safe-output it was forced to emit, with no ref field to fill in:
{"inputs":{"model":"all"},"workflow_name":"t3000-unit-tests","type":"dispatch_workflow"}
Consequence: this dispatched a full T3000 hardware test run against main
instead of the PR branch it was meant to validate — the workflow has an
allowed-refs allowlist specifically to scope dispatches to its own
silencer/* branches, and that allowlist is currently unreachable dead
configuration.
Suggested fix
Add a ref (string) property to the tool's inputSchema.properties in
generateDispatchWorkflowTool (or generateWorkflowToolDefinition, gated on
whether allowed-refs is configured for that workflow, mirroring how
dispatch_workflow.cjs already gates acceptance of message.ref on
allowed-refs being present) so the agent can actually see and fill in the
field the backend has been ready to accept since #49408. Ideally also update
the tool's descriptionFormat to mention that ref is required/validated
against the configured glob when present, so the agent understands the
contract instead of discovering the missing field by trial and error (as it
did here).
Related
Summary
#49408 (fixing #49400) added a
reffield toDispatchWorkflowOutputin
schemas/agent-output.jsonand updateddispatch_workflow.cjs's refresolution priority to check
message.reffirst. That part works — I verified itwith unit-level testing against a compiled workflow.
But the per-workflow MCP tool the agent actually calls to request a dispatch
never got updated to expose
refas a parameter. The agent has no way tosupply it, so
message.refis always absent in practice, and every dispatchsilently falls through the priority chain to
GITHUB_REF/context.ref— thedispatching workflow's own trigger ref, not anything the agent intended.
Where the gap is (confirmed against v0.84.2 and current
main)pkg/workflow/safe_outputs_dispatch.go,generateDispatchWorkflowTool:Neither this function nor
generateWorkflowToolDefinition(inpkg/workflow/safe_outputs_workflow_helpers.go) referencesreforallowed-refsanywhere — I grepped both files atv0.84.2and at currentmain; zero hits either version. The generated tool'sinputSchema.propertiesonly ever contains the target workflow's own
workflow_dispatchinputs (e.g.model,build-type,platform) — there is no genericref/branchpropertyadded regardless of whether the workflow's
dispatch-workflowconfig setsallowed-refs.Compare to
dispatch_workflow.cjs(the runtime handler), which does look formessage.refand does haveallowed-refsmatching logic — that side of#49408 is real and works. It's just unreachable, because nothing ever puts
refin the agent's hands.Live evidence
tenstorrent/tt-metal, workflow "Silencer", runhttps://github.com/tenstorrent/tt-metal/actions/runs/30729757440 (job
agent).The workflow's
dispatch-workflowconfig hasallowed-refs: ["silencer/*"]configured correctly. The agent's own reasoning trace noticed the gap live:
And the raw safe-output it was forced to emit, with no
reffield to fill in:{"inputs":{"model":"all"},"workflow_name":"t3000-unit-tests","type":"dispatch_workflow"}Consequence: this dispatched a full T3000 hardware test run against
maininstead of the PR branch it was meant to validate — the workflow has an
allowed-refsallowlist specifically to scope dispatches to its ownsilencer/*branches, and that allowlist is currently unreachable deadconfiguration.
Suggested fix
Add a
ref(string) property to the tool'sinputSchema.propertiesingenerateDispatchWorkflowTool(orgenerateWorkflowToolDefinition, gated onwhether
allowed-refsis configured for that workflow, mirroring howdispatch_workflow.cjsalready gates acceptance ofmessage.refonallowed-refsbeing present) so the agent can actually see and fill in thefield the backend has been ready to accept since #49408. Ideally also update
the tool's
descriptionFormatto mention thatrefis required/validatedagainst the configured glob when present, so the agent understands the
contract instead of discovering the missing field by trial and error (as it
did here).
Related
refoverride for runtime branch targeting #49408 — added backend support formessage.ref; this issue is theremaining half needed for it to actually be usable.
.yamlfindWorkflowFilefix, unrelated tothis gap but part of the same overall effort to get
dispatch-workflowworking for
tenstorrent/tt-metal'ssilencerworkflow.