Repository navigation
feat(harness)!: steer the running agent by default #7377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
64752b1
5ad906e
3ec3747
8f1b8f4
d26ecb5
354f82d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,9 +22,9 @@ Accepted | |
| ## Context | ||
|
|
||
| [ADR 0101](0101-preserve-the-agent-run-in-flight-on-work-item-updates.md) stops the | ||
| cancellation: the stage job already working on a work item is left to finish, and the newer | ||
| event waits as the single pending run the platform keeps per concurrency group. This ADR builds | ||
| on that decision and addresses what preserving alone leaves standing. | ||
| cancellation: the stage job already working on a work item is left to finish, and one run waits | ||
| behind it as the pending run — normally but not necessarily the newest event — working from the | ||
| item's current state. This ADR addresses what preserving alone leaves standing. | ||
|
|
||
| Three costs survive it. The run in flight finishes on the state it started with and posts output | ||
| that is already stale — a review of a commit that no longer exists, which is | ||
|
|
@@ -47,12 +47,11 @@ to be written down. | |
|
|
||
| ## Decision | ||
|
|
||
| Steering is an **opt-in** extension of preserving, enabled per harness by the `steer:` block. | ||
| While the run in flight holds the work item it absorbs updates to that item itself — the queued | ||
| follow-up run becomes the *notification*, not the worker — so that when the queued run finally | ||
| starts it finds a receipt saying the work is done and exits. With the block absent, which is the | ||
| default everywhere, the behaviour is ADR 0101 alone and nothing more. Steering requires | ||
| preserving; the reverse is not true. | ||
| Steering is an extension of preserving that is **on by default**, with a per-harness opt-out: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] missing-authorization The Decision section asserts steering is "on by default" as settled fact. The PR body explains this follows "the 2026-09-14 meeting recorded on #6957" and states "#6957's validation criteria still describe steering as off by default and should be read as superseded by ADR 0101" — but the PR does not add a comment to issue #6957 itself, whose Validation criteria section (confirmed live via the GitHub API) still literally reads "No stage regresses when Suggested fix: Add a comment on issue #6957 noting its Validation criteria are superseded by ADR 0101's on-by-default decision (and link the 2026-09-14 meeting record if one exists in a durable location), so the authorization trail is discoverable from the issue without relying on this PR's description. |
||
| `steer: {enabled: false}` gets ADR 0101 alone and nothing more, and an absent block is the | ||
| default, which is on. While the run in flight holds the work item it absorbs updates to that item | ||
| itself — the queued follow-up run becomes the *notification*, not the worker — so the queued run | ||
|
qodo-code-review[bot] marked this conversation as resolved.
Resolved
|
||
| finds a receipt saying the work is done and exits. Steering requires preserving, not the reverse. | ||
|
|
||
| The runner learns about an update by listing the execution platform's own run records for its | ||
| shim, verifies each candidate's **provenance** against server-side fields the sender cannot | ||
|
|
@@ -65,12 +64,13 @@ After the run, the runner posts a processing receipt as its own comment naming t | |
| it consumed, and a queued run that finds its own id in one exits without starting the agent. The | ||
| terminal status comment keeps an informational copy of the marker, which the skip check does not | ||
| honour. The receipt is load-bearing rather than an optimization: without one, steering costs | ||
| *more* than cancelling does today, since the run in flight absorbs the push and reviews the new | ||
| head, and the queued run then reviews that same head again. **Steering may not be enabled | ||
| *more* than preserving alone — the run in flight absorbs the push and reviews the new head, | ||
| and the queued run then reviews that same head again. **Steering may not be enabled | ||
| anywhere until receipts are authenticated by a channel that agents and post-scripts cannot | ||
| mint** — a forged receipt drops the update silently rather than merely wasting it. That channel | ||
| is the GitHub Actions job token: minting swaps it out of the environment before the sandbox | ||
| exists, so the runner alone holds it, and both writing and reading happen under its identity. | ||
| is the GitHub Actions job token: minting swaps it out before the sandbox exists, so the runner | ||
| alone holds it and reads and writes receipts under its identity — which satisfies the | ||
| precondition and is why the default is on rather than a switch each harness must find. | ||
|
|
||
| This precondition, like the rest of the rollout order, is guidance a human judges before enabling | ||
| steering; the binary does not enforce it. | ||
|
|
@@ -98,16 +98,16 @@ contract with the fleet agent definitions, versioned in | |
| ## Consequences | ||
|
|
||
| - A burst of events on one work item produces one agent run that absorbs them plus at most one | ||
| short follow-up, instead of a full re-run per event — but only once the receipt is | ||
| authenticated, since the follow-up is only short if it can trust a receipt to skip on. | ||
| short follow-up, instead of a full re-run per event. | ||
| - Agents stop posting output computed from state the subject has already moved past, which is the | ||
| complaint in [#1207](https://github.com/fullsend-ai/fullsend/issues/1207). | ||
| - The runner gains a dependency on the execution platform's run records and its per-stage | ||
| `actions: write` grant, and steering is unavailable on any platform that exposes neither. | ||
| - A run now holds its sandbox until it settles rather than ending at its first result, so a | ||
| steered run occupies a VM longer and can cost as much again per absorbed update. | ||
| - Nothing changes for a repository that does not opt in, and the fallback in every failure path — | ||
| no ack, no time left, cap reached, runtime cannot steer — is ADR 0101 on its own. | ||
| - Every repository steers on the release that carries this unless a harness opts out; an opt-out, | ||
| and every failure path — no ack, no time left, cap reached, runtime cannot steer — is ADR 0101 | ||
| on its own. | ||
|
|
||
| Related: [#5445](https://github.com/fullsend-ai/fullsend/issues/5445) and | ||
| [#2388](https://github.com/fullsend-ai/fullsend/issues/2388) — `/fs-cancel` gains a second | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| # Steering a run in flight | ||
|
|
||
| How a fullsend run already working on a work item absorbs an update to that | ||
| item — a push, a comment, a stage command — instead of being cancelled and | ||
| restarted, and how the run queued behind it learns the work is done. | ||
| item — a push, a comment, a stage command — rather than leaving it for the run | ||
| queued behind it, and how that queued run learns the work is done. | ||
|
|
||
| This page is the contributor reference for the mechanics. | ||
| [ADR 0113](../ADRs/0113-steer-the-running-agent-on-work-item-updates.md) is the | ||
|
|
@@ -39,7 +39,8 @@ concurrency: | |
| cancel-in-progress: false | ||
| ``` | ||
|
|
||
| so the active run always finishes while one run waits behind it as the single pending run | ||
| so the active run always finishes while one run waits behind it as the pending run — normally but | ||
| not necessarily the newest event — and works from the item's current state | ||
| ([ADR 0101](../ADRs/0101-preserve-the-agent-run-in-flight-on-work-item-updates.md)). Whether that | ||
| surviving run is *steered* is decided here, by the harness `steer:` block. Preserving is useful on | ||
| its own and is the base change's whole subject; steering builds on it. | ||
|
|
@@ -351,18 +352,26 @@ is the change to make. | |
|
|
||
| ## Configuration | ||
|
|
||
| Per-agent, default off, because enabling it changes how long a run holds its VM: | ||
| Per-agent, on by default. A harness that says nothing about `steer:` steers; so does one that | ||
| sets only a cap or a cadence. Turning it off takes the key by name: | ||
|
|
||
| ```yaml | ||
| steer: | ||
| enabled: true # default: false | ||
| enabled: false # default: true — this is the opt-out | ||
| max_steers: 2 # default: 2 | ||
| poll_interval_seconds: 30 # default: 30 | ||
| ``` | ||
|
|
||
| The runner sets `RunParams.Steerable` only when all of: the harness opted in, the runtime | ||
| `enabled` is a pointer internally for exactly this reason: absent and `false` have to mean | ||
| different things, so `steer: {max_steers: 3}` cannot silently opt a harness out while it is | ||
| trying to raise the cap. | ||
|
|
||
| The runner sets `RunParams.Steerable` only when all of: the harness has not opted out, the runtime | ||
| implements `Steerer`, and the job is a GitHub Actions run. Otherwise `Steerable` stays false and | ||
| `Run` is single-turn exactly as today. | ||
| `Run` is single-turn exactly as before. The runner announces a declined watch only when the | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] docs-inconsistency steering.md states the runner announces a declined watch only when 'the harness named steering itself.' The actual code condition, SteerExplicitlyEnabled() in internal/cli/steer.go, is narrower: true only when enabled is an explicit true, not merely when a steer: block is present with other keys set (e.g. max_steers). steer: {max_steers: 3} — which does 'name steering' by tuning its cap — stays silent on a declined watch under the code, per the new TestStartSteerWatcherDeclineMessage case. docs/reference/harness-reference.md's wording ('only when the harness set enabled: true') matches the code correctly. Suggested fix: Align steering.md's wording with harness-reference.md and the code: the warning fires only when the harness explicitly sets enabled: true, not merely when it includes any steer: block. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] docs-inconsistency This sentence ("The runner announces a declined watch only when the harness set Suggested fix: Clarify in both documents that ordinary declines are announced only when |
||
| harness set `enabled: true` itself — a block that sets only a cap or a cadence stays quiet, since | ||
| with the default on most declines are ordinary conditions rather than misconfiguration. A missing | ||
| job token or `GITHUB_RUN_ID` is always announced. | ||
|
|
||
| ## What changes for each stage | ||
|
|
||
|
|
@@ -396,8 +405,8 @@ possible follow-up, not part of this decision. | |
|
|
||
| **GitLab is not wired.** GitLab pipelines already queue rather than cancel, and the provenance | ||
| join is different — `GET /pipelines/:id/variables` exposes the poller-set `STAGE` and | ||
| `RESOURCE_KEY`, already covered by the HMAC dispatch signature. The watcher is GitHub-only for now | ||
| and says so when it declines to start. | ||
| `RESOURCE_KEY`, already covered by the HMAC dispatch signature. The watcher is GitHub-only for now, | ||
| and on GitLab it declines quietly unless the harness set `enabled: true` itself. | ||
|
|
||
| **A steer needs time left.** The exec hosting a live session cannot be extended once running, so | ||
| the watcher settles rather than steering when less than `MinRemaining` (default five minutes) of | ||
|
|
@@ -423,16 +432,29 @@ This precondition, like the rest of the rollout order, is judged by the people w | |
| steering; nothing in the binary enforces it. | ||
|
|
||
| The receipt is load-bearing rather than an optimization. Without one, steering costs *more* than | ||
| cancelling does today: the active run absorbs the push and reviews head B, then the queued run | ||
| reviews head B again — two reviews where cancel-and-restart produces one. So the skip check and | ||
| the authenticity it depends on ship together, or neither ships. | ||
|
|
||
| Once that holds, the harness `steer:` block is the only switch. With it off, a repository sits in | ||
| exactly the base change's state, where the run in flight finishes and the queued run does the | ||
| work from the item's current state. Nothing is half-enabled, so a repository can sit there | ||
| indefinitely, which is where every repository starts. | ||
|
|
||
| Steering is the second step and needs its own preconditions met: the fleet agent definitions | ||
| ([fullsend-ai/agents#1163](https://github.com/fullsend-ai/agents/issues/1163)) merged, since the | ||
| envelope's shape changed; one real steer of each runtime observed on OpenShell; and the | ||
| authenticated receipt above. Then `steer:` goes on one harness at a time. | ||
| preserving alone: the active run absorbs the push and reviews head B, then the queued run reviews | ||
| head B again — two reviews of the same head where preserving alone produces one. So the skip | ||
| check and the authenticity it depends on ship together, or neither ships. | ||
|
|
||
| Once that holds, the harness `steer:` block is the only switch, and it is now on by default: | ||
| steering arrives with the release that carries it rather than one harness at a time. A harness | ||
| that opts out with `enabled: false` sits in exactly the base change's state, where the run in | ||
| flight finishes and the queued run does the work from the item's current state. Nothing is | ||
| half-enabled, so a harness can sit there indefinitely. | ||
|
|
||
| The preconditions this ordering existed to impose are not waived by moving the switch; they are | ||
| what the people cutting the release check by hand, since nothing in the binary enforces them. | ||
| The authenticated receipt ships in the change below this one. Still open at the time of | ||
| writing: the fleet agent definitions | ||
| ([fullsend-ai/agents#1163](https://github.com/fullsend-ai/agents/pull/1163)) are unmerged, so | ||
| the agents have not yet been taught the envelope; each runtime's transport has been driven in | ||
| isolation, but no end-to-end steer inside OpenShell from a real workflow run has been observed; | ||
| the receipt's identity match has not been seen on a live run; and that same PR teaches the | ||
| envelope to code, fix, review and triage only, so prioritize, retro and scribe must either learn | ||
| the contract or set `steer: {enabled: false}` before the default reaches them — an eligible run | ||
| on a definition that ignores the envelope still acks the delivery and still posts a receipt, so | ||
| the queued run skips and the update is dropped silently, which is the one failure mode this | ||
| design may not have. All four belong before the default reaches a release. Agents that | ||
| `fullsend agent new` scaffolds from here on carry the contract in their generated body; ones | ||
| scaffolded earlier must be regenerated to gain it, and neither changes the fleet definitions | ||
| above. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[low] missing-authorization
The PR body frames the default-on flip as authorized by 'the 2026-09-14 decision recorded on #6957: run continuation is the default, and steering with it.' The visible #6957 discussion (two scribe-bot meeting-update comments) covers run continuation (ADR 0113's territory — not cancelling in-flight runs) but does not explicitly extend that decision to an on-by-default posture for the steering/follow-up-run watcher. This PR is itself what rewrites ADR 0101's Decision section from opt-in to on-by-default, which is normal ADR flow, but the evidentiary chain visible to an outside reviewer is thinner than the PR body's phrasing implies. There is no formally linked (Closes/Fixes) issue on this PR.
Suggested fix: Either add a comment on #6957 that explicitly extends the run-continuation decision to 'steering is on by default,' or soften the PR body's framing to present the on-by-default default as this PR's own design call built on the run-continuation decision, rather than as something #6957 already settled on its own.