Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/fullsend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
# which determines the stage and runs the agent inline (ADR 62).
# Adding a new stage requires only a job in reusable-dispatch.yml — zero changes to this repo.
#
# Concurrency: per-role cancel-in-progress groups live in reusable-dispatch.yml
# stage jobs with -agent- suffix. Roles operate independently (#2452).
# Concurrency: per-role groups (fullsend-{stage}-...) live in reusable-dispatch.yml
# stage jobs. A newer event never cancels the run in flight; it waits as the single
# pending run (ADR 0106). Roles operate independently (#2452).
name: fullsend

on:
Expand Down
42 changes: 32 additions & 10 deletions .github/workflows/reusable-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,31 @@
# caller-provided matrix. This enables reuse without extracting separate workflows
# while preserving ADR 62's inlining decision.
#
# Concurrency: each stage job declares a per-role cancel-in-progress group
# (fullsend-{stage}-…). Roles operate independently — review dispatches do
# not cancel triage, code, fix, etc.
# Concurrency: each stage job declares a per-role group (fullsend-{stage}-...).
# Roles operate independently: a review dispatch does not cancel triage, code,
# fix, and so on.
#
# A second event on the same work item never cancels the run already working
# on it. Every stage job carries cancel-in-progress: false, so the run in
# flight finishes and one run waits behind it: GitHub Actions keeps a single
# pending run per group, the last one to queue, which is normally but not
# necessarily the newest event, since a stage job queues only after route
# completes. Either way the pending run works from the work item's current
# state rather than the state that dispatched it. That reconciliation is the
# agent's side of the bargain, and is why the runner exports
# FULLSEND_RUN_HEAD_SHA and FULLSEND_RUN_STARTED_AT (ADR 0106).
#
# What that gives up: ADR 0063 names per-stage cancel-in-progress as the second
# of two layers protecting poll dispatch from duplicate side effects, and that
# layer is now gone everywhere, leaving the first — the poller's own lock —
# plus whatever idempotency the agent has. The duplicate-poll case is where
# this costs most: two duplicate dispatches are the same work rather than a
# newer state superseding an older one, so both run to completion instead of
# one replacing the other.
#
# queue: max is deliberately not used. The default already keeps one pending
# run per group, which is the coalescing ADR 0106 asks for, and N pending full
# runs is the failure mode preserving the active run exists to remove.
#
# Flow: shim (per-repo) → reusable-dispatch.yml (route + inlined stage logic)
# Or: custom poller → reusable-dispatch.yml (pre-computed matrix → harness-run)
Expand Down Expand Up @@ -656,7 +678,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-triage-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true
cancel-in-progress: false
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
permissions:
actions: write
contents: read
Expand Down Expand Up @@ -767,7 +789,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-code-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
actions: write
contents: write
Expand Down Expand Up @@ -908,7 +930,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-review-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
actions: write
contents: read
Expand Down Expand Up @@ -1038,7 +1060,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-fix-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
actions: write
contents: write
Expand Down Expand Up @@ -1320,7 +1342,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-retro-${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
actions: write
contents: read
Expand Down Expand Up @@ -1432,7 +1454,7 @@ jobs:
runs-on: ${{ inputs.runner_image }}
concurrency:
group: fullsend-prioritize-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
actions: write
contents: read
Expand Down Expand Up @@ -1691,7 +1713,7 @@ jobs:
matrix: ${{ fromJSON(inputs.matrix != '' && inputs.matrix || (needs.harness-dispatch.outputs.matrix != '' && needs.harness-dispatch.outputs.matrix || '{"include":[]}')) }}
concurrency:
group: fullsend-harness-${{ matrix.agent }}-${{ github.repository }}-${{ matrix.status_repo }}-${{ matrix.status_number }}
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
cancel-in-progress: true
cancel-in-progress: false
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
runs-on: ${{ inputs.runner_image }}
permissions:
actions: write
Expand Down
8 changes: 7 additions & 1 deletion docs/ADRs/0063-polling-based-work-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,13 @@ event-driven dispatch already assumes under `cancel-in-progress`.
> **Update (2026-09):** [ADR 0106](0106-serialize-agent-runs-and-coalesce-subsequent-events.md)
> replaces automatic cancellation with serialized runs and platform-native
> pending-run coalescing. Source-native locks and agent idempotency remain
> defense in depth for duplicate dispatch and side effects.
> defense in depth for duplicate dispatch and side effects. On GitHub, every
> stage job in `reusable-dispatch.yml` now carries `cancel-in-progress: false`,
> so layer 2 above is gone, and the duplicate-poll case is where that trade is
> least favourable, because two duplicate dispatches are the same work rather
> than a newer state superseding an older one. The mentions below of GHA
> concurrency as a mitigation for stale-lock races and as the primary safety net
> for same-item re-dispatch describe the cancelling behaviour and no longer hold.

Property keys are namespaced by target repo to avoid collisions when multiple
repos poll the same Jira project:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ MUST derive compatible harness-and-entity identities, but a synchronous
`workflow_call` caller and callee MUST retain distinct group-name prefixes so
the child does not wait on the parent that is waiting for it.

> **Update (2026-09):** Active-run preservation is implemented on GitHub
> Actions by [#7007](https://github.com/fullsend-ai/fullsend/pull/7007): every
> stage job in `reusable-dispatch.yml` carries `cancel-in-progress: false`, and
> the runner exports `FULLSEND_RUN_HEAD_SHA` and `FULLSEND_RUN_STARTED_AT` so a
> run can tell whether the subject moved under it
> ([`fullsend run` § Run baseline](../cli/run.md#run-baseline)). Keying the
> serialization scope on the canonical subject identity is still pending:
> `harness-run` keys on the item number
> ([#7475](https://github.com/fullsend-ai/fullsend/issues/7475)).

On GitLab CI/CD, a subject-scoped `resource_group` serializes agent jobs.
`workflow:auto_cancel:on_new_commit: none` and a non-interruptible agent job
preserve active work, while the resource group's `newest_first` process mode
Expand Down
6 changes: 4 additions & 2 deletions docs/agents/fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ The fix agent enforces iteration caps to prevent infinite review-fix loops:
`needs-human` label.
- When the cap is exceeded, the run fails before the sandbox starts and the
status comment shows the escalation message (a human can still `/fs-fix`).
- Each `/fs-fix` comment cancels any in-flight fix run for the same PR and
starts a new one.
- A `/fs-fix` comment while a fix run is already in flight for the same PR does
not cancel it: that run finishes, and the new dispatch waits as the single
pending run (normally but not necessarily the newest event), then works from
the PR's current state ([ADR 0106](../ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md)).

## How it helps

Expand Down
6 changes: 6 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ The existing design principle is that [the repo is the coordinator](problems/age
over other comments and content discovered during reconciliation remains a
separate decision
([ADR 0106](ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md)).
On GitHub this is every stage job in `reusable-dispatch.yml` running with
`cancel-in-progress: false`, so the last run to queue, normally but not
necessarily the newest event, waits as the single pending run and works from
current state, and the runner exporting `FULLSEND_RUN_HEAD_SHA` and
`FULLSEND_RUN_STARTED_AT` so an agent can see what moved beneath it
([`fullsend run` § Run baseline](cli/run.md#run-baseline)).
- Dispatch runs no follow-up stage after an agent. Every run publishes the
`fullsend-<agent>` artifact, and users who want to act on a result chain
their own workflow on the shim's `workflow_run` event
Expand Down
28 changes: 28 additions & 0 deletions docs/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,34 @@ variables is deployed.
| `clearing stale iteration deadline (iteration N): ...` | The write failed and the previous iteration's file could not be removed either. The run stops rather than let the agent read a stale deadline. | Same as above. |
| `FULLSEND_ITERATION_DEADLINE` unset inside the agent | The agent's shell was started without sourcing `/sandbox/workspace/.env`. | Runtimes that fullsend ships always source it; a custom command must do the same. |

## Run baseline
Comment thread
waynesun09 marked this conversation as resolved.
Resolved
Comment thread
waynesun09 marked this conversation as resolved.
Resolved

Alongside the budget, the runner tells the agent what the work item looked like when the run
began. Two more environment variables, set on every runtime (claude, pi, codex):

| Variable | Value |
|---|---|
| `FULLSEND_RUN_HEAD_SHA` | The work item's head as the event that dispatched the run carried it. Empty on an issue run, which has no head, and today on GitLab, where the poller-raised agent pipeline does not carry the merge request's head. A value that is not a hex object name is exported empty |
| `FULLSEND_RUN_STARTED_AT` | When the run started, RFC 3339 UTC |

The two are not sampled at the same instant. The head is frozen when the run is dispatched, before
it queues; the start is the runner's own clock at the top of `fullsend run`, after the
concurrency-group wait, which can now last a whole predecessor run, and after the job steps that
precede the command. The gap runs one way. An agent re-checking against the start looks at a
narrower window than the run spans, never a wider one, so it can miss activity that landed while the
run queued or the job was starting but cannot invent any; a head comparison has no such gap.

The head is empty rather than absent on an issue run — an agent that re-checks it skips the check
on an empty value, which it cannot do for a variable that is not there at all.

Both are written after the harness's `.env.d` files are sourced and after `env.sandbox` is
applied, so a harness cannot shadow the baseline its own agent's re-check depends on. Position is
what protects them: the reserved-key check drops an `env.sandbox` entry with either name, but says
nothing about `.env.d`.

Both are captured once, at run start, and are not rewritten between validation-loop iterations,
unlike the deadline above.

## OpenAI credentials on pi and codex

A `fullsend-openai` provider (`providers: [openai]` on the harness, `openai/<id>` models on pi or codex)
Expand Down
2 changes: 2 additions & 0 deletions docs/contributing/ci-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Conventions for GitHub Actions workflows under `.github/workflows/`. Follow thes
```
Hybrid workflows that combine `workflow_call` with direct triggers like `pull_request_target` or `push` (e.g., `e2e.yml`, `functional-tests.yml`) may still use `${{ github.workflow }}` in the branch of their concurrency expression that handles direct triggers — the `workflow_call` invocations in these cases come from a thin caller that shares the same concurrency intent.
- Never cancel in-progress runs on the default branch (`refs/heads/main`). Gate `cancel-in-progress` when the workflow triggers on `push` to `main`.
- **Agent stage jobs never cancel the run in flight.** Every stage job in `reusable-dispatch.yml` carries `cancel-in-progress: false`. A newer event on the same work item leaves the run already working on it alone; GitHub keeps one pending run per group, the last to queue, normally but not necessarily the newest event, which then works from the item's current state rather than its own event ([ADR 0106](../ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md)). Keep the value identical across every stage job — one role cancelling while another queues on the same item is harder to reason about than either behaviour on its own. The rule covers the dispatch path through `reusable-dispatch.yml`. The scheduler-driven prioritize lane (`prioritize.yml` → `reusable-prioritize.yml`, installed per-repo as well) and the deprecated per-org path ([ADR 0044](../ADRs/0044-deprecate-per-org-installation-mode.md)) still cancel in flight. The trade: [ADR 0063](../ADRs/0063-polling-based-work-discovery.md) counted per-stage cancellation as a layer against duplicate poll dispatch, and that layer is gone, leaving the poller's lock and agent idempotency.
- **Where that trade bites.** The duplicate-poll case is the least comfortable one: two duplicate dispatches are the same work rather than a newer state superseding an older one, so both run to completion instead of one replacing the other.

**Why:** A hardcoded prefix like `my-workflow-${{ github.workflow }}` is redundant — `github.workflow` already resolves to the workflow `name:` field. The duplication creates a confusing group key and wastes characters. The reusable-workflow exception exists because GitHub resolves `github.workflow` from the caller's context, so a reusable workflow using it would share a concurrency group with its caller.

Expand Down
4 changes: 2 additions & 2 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ watermark-based deduplication at 5–60 minute intervals
reconciliation backstop.
[ADR 0106](ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md)
additionally adopts preserve-and-coalesce scheduling at the execution-platform
layer: after implementation, an active run finishes while later matching
events collapse into one pending follow-up run.
layer. On GitHub Actions an active run now finishes while later matching events
collapse into one pending follow-up run.
See [architecture.md](architecture.md) (building block 1).

### Default Agent
Expand Down
2 changes: 2 additions & 0 deletions docs/guides/dev/cli-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ Vendoring commit messages use title + body (upload and stale delete). `github st
│ │ ├── FULLSEND_FETCH_URL=... (if allow_runtime_fetch)│ │
│ │ ├── FULLSEND_FETCH_TOKEN=<run token> (if above)│ │
│ │ ├── sources .env.d/*.env files │ │
│ │ ├── FULLSEND_RUN_HEAD_SHA + │ │
│ │ │ FULLSEND_RUN_STARTED_AT │ │
│ │ └── sources .fullsend/iteration.env │ │
│ │ (FULLSEND_TIMEOUT_MINUTES + │ │
│ │ FULLSEND_ITERATION_DEADLINE + │ │
Expand Down
7 changes: 7 additions & 0 deletions docs/guides/user/bring-your-own-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ and `TRACEPARENT` (this iteration's agent-span W3C trace context, so runtime tel
Fullsend trace; empty when telemetry produced no valid span context). Write the result before the
deadline — see [`fullsend run` § Budget and deadline](../../cli/run.md#budget-and-deadline).

It also carries what the work item looked like when the run began: `FULLSEND_RUN_HEAD_SHA` (the head
the dispatching event carried, empty for an issue and today on GitLab's poller-raised pipeline) and
`FULLSEND_RUN_STARTED_AT` (RFC 3339 UTC). The start is the runner's own clock at the top of
`fullsend run`, after the concurrency wait and the job steps that precede the command, so activity
from that gap falls before it — see
[`fullsend run` § Run baseline](../../cli/run.md#run-baseline).

Network access (which APIs the agent can reach) is controlled by provider profiles or inline `network_policies`. The six built-in profiles (`vertex-ai`, `github`, `github-ro`, `github-artifacts`, `gitleaks`, `package-registries`) use framework-known `type` values (e.g. `fullsend-vertex-ai`, `fullsend-github`), but — like a fully custom provider type — still need a matching `openshell.profiles` entry (or one inherited via `base:` composition) to be imported; only the profile's `type` value is framework-known, not its import path. When defining a fully custom provider type, reference a remote provider definition together with a matching `openshell.profiles` entry (see [Remote providers and profiles](customizing-agents.md#remote-providers-and-profiles)). For endpoints not covered by providers, inline `network_policies` in the policy YAML also work. Providers are the pattern used by fullsend's built-in agents, but custom agents can use whichever approach fits.

**Next steps:** [Register your agent](#registering-your-agent) so dispatch discovers it, then [write a CEL trigger](cel-triggers-reference.md#writing-cel-triggers) to control when it runs. To iterate on your agent locally before registering, see [Testing locally](#testing-locally).
Expand Down
21 changes: 14 additions & 7 deletions docs/guides/user/building-custom-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Environment variables set by the runner, present in every agent's shell:
- `TRACEPARENT` — W3C trace context of this iteration's agent span, so runtime telemetry
can join the Fullsend trace; empty when telemetry produced no valid span context
(see [`fullsend run` § Budget and deadline](../../cli/run.md#budget-and-deadline))
- `FULLSEND_RUN_HEAD_SHA` — the work item's head as the dispatching event carried it; empty for an issue
and today on GitLab's poller-raised pipeline
- `FULLSEND_RUN_STARTED_AT` — when the run started, RFC 3339 UTC. This is the runner's own clock
at the top of `fullsend run`, after the concurrency wait and the job steps that precede the
command, so activity from that gap falls before it
(see [`fullsend run` § Run baseline](../../cli/run.md#run-baseline))

## Process

Expand Down Expand Up @@ -500,7 +506,7 @@ on:

concurrency:
group: my-agent-${{ inputs.issue_key || 'unknown' }}
cancel-in-progress: true
cancel-in-progress: false

jobs:
run:
Expand Down Expand Up @@ -578,12 +584,13 @@ jobs:
path: ${{ github.workspace }}/output
```

This example reflects the currently deployed cancellation policy. Under
[ADR 0106](../../ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md),
the platform will change subject-scoped agent workflows to
`cancel-in-progress: false` once preserve-and-coalesce scheduling is
implemented. Until that migration lands, keep the setting aligned with the
reusable workflow that invokes the agent.
This example matches the platform's scheduling: subject-scoped agent workflows
run with `cancel-in-progress: false`, so a newer event on the same work item
waits as the single pending run and works from current state instead of
cancelling the run in flight
([ADR 0106](../../ADRs/0106-serialize-agent-runs-and-coalesce-subsequent-events.md),
which the reusable dispatch workflow implements). Keep the setting aligned with
the reusable workflow that invokes the agent.

### Critical workflow steps

Expand Down
Loading
Loading