Skip to content

feat(dispatch): let a config.yaml CEL trigger decide when review runs #8726

Closed

Description

@waynesun09

What is missing

Review routing is bash in the route job of reusable-dispatch.yml. A repository cannot change when review runs. For example, it cannot keep /fs-review and turn off the automatic review on every PR (#2078).

agents[] entries in config.yaml can already tune a built-in agent without a harness file (runtime, model, effort, subagents), but they cannot say when it runs. A harness trigger: exists, but the default agents are never routed through it, and overriding the whole review harness just to change when it runs means maintaining a base: pin.

Part of #2888. Implements the routing half of #2898.

What should happen

Users set when review runs with a CEL expression in config.yaml:

agents:
  - name: review
    trigger: >-
      event.transition.kind == "comment_added"
        && has(event.entity.linked_change_proposal)
        && event.transition.comment.command == "/fs-review"
        && event.actor.kind == "human"

This is dispatch policy (whether an agent runs), so it belongs in config.yaml per ADR 0080. The trigger is CEL, per ADR 0061.

CEL decides whether review runs. The existing review job still runs it, so the PR environment (PR_URL, PR_NUMBER, PRIOR_REVIEW_*), prior-review prefetch, role/enabled checks and per-PR concurrency stay as they are.

1. agents[].trigger in config.yaml

  • New AgentEntry.trigger (string, CEL), validated at config load with the same check harness triggers use.
  • Follow docs/contributing/harness-composition.md "Checklist for AgentEntry field changes": merge in perRepoConfig.AgentEntries() (an omitted or empty value inherits the parent; last overlay wins), layered-merge tests, and the layered configuration reference. Recheck HasSettings() / IsOverrideOnly(): an entry with only trigger stays override-only, but counts for routing.
  • Document it in docs/reference/config-reference.md. Fix the Jira guide's "trigger is a harness field, not a config.yaml field".

2. Opt-in rule: a config.yaml trigger

For the review agent, routing uses CEL only when agents[].trigger is set for review in config.yaml (any layer). Everything else stays on bash, unchanged: no entry, an entry without trigger, the default harness, and any trigger: in a sourced review harness, whether written there or inherited from base:. A harness trigger never opts a built-in agent into CEL routing; to opt in, put the expression in config.yaml.

This keeps upgrades free of surprises: nothing changes unless someone edits config.yaml. In particular, Jira-oriented harness triggers added per the Jira guide keep their meaning for the Jira poller and do not take over GitHub routing.

The default harness's own trigger (fullsend-ai/agents#1756) is not used for routing until the cutover that removes bash routing (#2902).

There is no repository variable or other switch: the config.yaml trigger is the opt-in.

3. fullsend dispatch --route <agent>

Decides for an allowlisted built-in agent (only review in this issue; later agents add one allowlist entry and their acceptance rule) and prints one JSON line: {"agent":"review","decision":"run|skip|bash","reason":"...","harness":"..."}.

  • Use the config.yaml trigger per §2; none → bash.
  • Kill switch active or agent disabled → bash (the existing route checks report them).
  • Authorize with the event-level gate plus the per-harness threshold (feat(dispatch): apply per-harness permission threshold on the CEL path #8724).
  • A bot comment_added → skip (bash parity), before any harness fetch.
  • Trigger true → run, false → skip.
  • Document the flag and the JSON contract on the fullsend dispatch page in docs/cli/.

4. Wiring in the route job (maintainers push this part)

  • "Determine stage" stays as it is on main apart from its step id.
  • New CEL steps run after it only when the bash stage is empty or review, the event is pull_request_target or an issue_comment on a PR, and .fullsend/config.yaml has a review agent entry with trigger. Every CEL step is continue-on-error.
  • A final step applies the decision: run → STAGE=review (accepted only for pull_request_target, or an issue_comment on a PR); skip → empty; bash or any CEL failure → keep the bash stage and log a warning.
  • Repositories without such an entry produce byte-identical routing; a test asserts this.

Known differences from bash (documented)

Case Bash CEL
PR opened or pushed by a bot without a registered role review denied (ADR 0107)
PR opened or pushed by the fix bot review denied until #8329 wires the bot-role lookup into GitHub dispatch; until then the review → fix → re-review loop stops
Who is checked on PR opened / synchronize / ready PR author event sender
A maintainer's push to an outside contributor's fork PR not reviewed reviewed
GitLab — only MR opened and /fs-review notes; no re-review on push

The user guide says to opt in only after #8329 ships, or to accept the fix-bot gap.

Tests (same PR)

Layer Cases
Go unit, config trigger merge and inheritance across layers; invalid CEL rejected at load
Go unit, --route review config trigger set (each layer) vs. absent, including a sourced harness with its own trigger → bash; kill switch and disabled → bash; bot comment → skip; auth denied → skip
Parity golden recorded review events through routeBuiltinAgent with a trigger equal to the default harness trigger; mismatches only on the known-difference rows
Behaviour (e2e/behaviour/) with the existing "the repository agents are configured with:" step and an on-demand-only trigger: PR opened → no review; /fs-review → review dispatched exactly once; a repository without a review entry → bash routing unchanged

Docs

  • docs/guides/user/customizing-agents.md: "Choosing when review runs" walkthrough, with the config.yaml example, how to check the result in the route job summary (review_route=cel|bash), and the known differences.
  • docs/guides/user/cel-triggers-reference.md: coexistence with built-in agents.
  • docs/reference/config-reference.md, layered configuration reference, docs/cli/ dispatch page.

Out of scope

Implementation notes for the code agent

  • Reference implementation: branch 8726-cel-review-route at e501087d8ab8a90db7f569ce586b1ed01eb4e68b (five commits on main 08b461637). Port its non-workflow files: internal/celtrigger, the AgentEntry.Trigger field and merge, fullsend dispatch --route <agent> with its allowlist, tests, docs, e2e/behaviour/features/dispatch/review-cel-route.feature and the new the write actor opens a pull request behaviour step. Keep the --route flag and its JSON fields (agent, decision, reason, harness) unchanged: the workflow wiring depends on them.
  • .github/workflows/reusable-dispatch.yml and internal/scaffold/cel_route_test.go are out of scope for this run, because the code agent cannot edit workflow files. Maintainers push them onto the PR.
  • Keep Go patch coverage at or above the repository target.

Activity

  1. added
    type/feature
    agent/review
    component/dispatch
    on Oct 22, 2026
  2. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 8:55 PM UTC · Completed 8:57 PM UTC

    Commit: fe68925 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.09

  3. added
    blocked
    on Oct 22, 2026
  4. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    Thanks for the thorough spec. This is blocked on two open issues that the description itself names as required for the on mode:

    Only shadow mode is independent of both. The "Done when" list (V2–V6 on a test repository) can't be met until both land. Once they merge, this can be re-triaged for implementation.

    Notes for whoever picks this up:

    • The route job changes are in .github/workflows/reusable-dispatch.yml, so the code agent can't make them under current permissions. A human PR or maintainer action is needed for the workflow portion. The Go --route review mode, the behaviour step and the docs updates are separable.
    • The companion agents-repo change (adding trigger: to harness/review.yaml) is a separate PR, and the issue says to merge it only after the release carrying fix(dispatch): don't fan out built-in agents from GitHub CEL dispatch #8725's filter. Its status was not checked.
    • The new variable and flag will need entries in docs/cli/ and docs/reference/config-reference.md as well as the two guides listed in the issue, per the repo's documentation rules.

    Blocked by:

  5. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    🤖 Triage · ⚠️ Cancelled · Started 9:17 PM UTC · Ended 9:18 PM UTC

    Commit: fe68925 · View workflow run →

  6. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 9:20 PM UTC · Completed 9:21 PM UTC

    Commit: fe68925 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.15

  7. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    This issue is still blocked. Re-checking the dependencies found all of them open, and no open or merged PR addresses this issue. The earlier closed PR #8729 is only the reference implementation.

    Blockers for the on mode:

    Only shadow mode has no dependencies. The full "Done when" list (V2–V6 on a test repository) can't be met until the blockers above merge.

    Notes for whoever picks this up:

    • The route job wiring is in .github/workflows/reusable-dispatch.yml. The code agent can't edit workflow files, so a maintainer must push that part, along with the scaffold test that asserts on it. The Go --route review mode, the behaviour step and the docs updates can be done separately.
    • The new variable and flag also need entries in docs/cli/ and docs/reference/config-reference.md, in addition to the two guides named in the issue.
    • The status of the companion agents-repo PR (adding trigger: to harness/review.yaml) has not been verified.

    Once the blockers are resolved, this can be re-triaged for implementation.

    Blocked by:

  8. added a commit that references this issue on Oct 22, 2026
  9. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 9:35 PM UTC · Completed 9:37 PM UTC

    Commit: fe68925 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.12

  10. fullsend-ai-triage commented on Oct 22, 2026

    @fullsend-ai-triage

    This issue is still blocked. All three dependencies were re-checked and remain open, and no open or merged PR addresses this issue (the closed reference-implementation PR does not count).

    Blockers for the on mode:

    Only shadow mode has no dependencies, but the full "Done when" list (V2–V6 on a test repository) cannot be met until the blockers merge.

    Notes for whoever picks this up:

    • The route job wiring lives in .github/workflows/reusable-dispatch.yml. The code agent cannot edit workflow files, so a maintainer must push that part, along with the scaffold test that asserts on it. The Go --route review mode, the behaviour step and the docs updates are separable.
    • The new variable and flag also need entries in docs/cli/ and docs/reference/config-reference.md, in addition to the two guides named in the issue.
    • The status of the companion agents-repo PR (adding trigger: to harness/review.yaml) has not been verified.

    Once the blockers are resolved, this can be re-triaged for implementation.

    Blocked by:

  11. 15 remaining items

  12. removed
    blocked
    on Oct 23, 2026
  13. waynesun09 commented on Oct 23, 2026

    @waynesun09
    MemberAuthor

    /fs-code
    Do not sign off. No git commit -s, no Signed-off-by trailer.

  14. waynesun09 commented on Oct 23, 2026

    @waynesun09
    MemberAuthor

    /fs-code
    Do not sign off. No git commit -s, no Signed-off-by trailer.

  15. fullsend-ai-coder commented on Oct 23, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 12:04 AM UTC · Completed 12:15 AM UTC

    Commit: 33dc5e1 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.24

  16. added 6 commits that reference this issue on Oct 23, 2026
  17. added 3 commits that reference this issue on Oct 23, 2026
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

    agent/reviewcomponent/dispatchtype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions