Skip to content

docs(adr): serialize agent runs and coalesce subsequent events - #6909

Open
ifireball wants to merge 2 commits into
mainfrom
codex/add-debounced-agent-triggering
Open

docs(adr): serialize agent runs and coalesce subsequent events#6909
ifireball wants to merge 2 commits into
mainfrom
codex/add-debounced-agent-triggering

Conversation

@ifireball

@ifireball ifireball commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Add ADR 0098 to preserve active agent runs and coalesce later matching events into one platform-managed pending run per harness and subject.
  • Keep normalization, trigger authorization, harness selection, and CEL matching in fullsend dispatch; fullsend run executes one run and does not poll or schedule follow-ups.
  • Require agents to reconcile current issue or PR state, while explicitly deferring authority over other scanned comments and content to a future ADR.
  • Document GitHub Actions implementation through subject-scoped concurrency with cancel-in-progress: false, plus the need for equivalent semantics on other execution platforms.
  • Record that per-run infrastructure timeouts remain effective while sustained triggering still requires separate rate, cost, or loop circuit breakers.
  • Remove the unrelated generated Codex environment file from the PR.

Accepted ADR annotations

  • ADR 0034: annotate its automatic-cancellation consequence as replaced by ADR 0098 platform-native pending-run coalescing.
  • ADR 0063: annotate both cancel-in-progress discussions as replaced by ADR 0098 while retaining source locks and idempotency as defense in depth.

Living documentation

  • Update docs/architecture.md with the platform-managed coalescing and state-reconciliation model.
  • Resolve the security threat model question by treating event coalescing as both a correctness and denial-of-service defense.

Verification

  • make lint

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document serialized agent runs and bounded event coalescing

📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Define serialized agent execution with bounded coalescing of later subject events.
• Preserve authorization and CEL trigger evaluation for the newest follow-up event.
• Align architecture, prior ADRs, and DoS guidance with the scheduling policy.
Diagram

sequenceDiagram
    actor Source as Event Source
    participant Dispatch
    participant Driver as Input Driver
    participant Auth as Auth Gate
    participant Harness
    participant Run as Run Loop
    participant Sandbox
    Source->>Dispatch: Initial event
    Dispatch->>Driver: Normalize event
    Driver-->>Dispatch: NormalizedEvent
    Dispatch->>Auth: Authorize initial event
    Dispatch->>Harness: Evaluate trigger
    Dispatch->>Run: Start serialized run
    Run->>Sandbox: Execute agent
    Sandbox-->>Run: Terminal result
    loop Bounded follow-ups
        Run->>Driver: Retrieve later events
        Driver-->>Run: Ordered subject events
        Run->>Auth: Authorize newer events
        Run->>Harness: Evaluate newest match
        alt Trigger matches
            Run->>Sandbox: Execute fresh run
            Sandbox-->>Run: Terminal result
        end
    end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Cancel active run
  • ➕ Prioritizes the newest event immediately.
  • ➕ Matches the previous concurrency-group behavior.
  • ➖ Discards completed inference and sandbox work.
  • ➖ Event bursts can repeatedly consume resources without producing results.
2. Queue every event
  • ➕ Preserves every triggering event independently.
  • ➕ Provides straightforward event-to-run traceability.
  • ➖ Creates redundant runs for overlapping inputs.
  • ➖ Allows bursts to amplify token and sandbox consumption.
3. Durable external scheduler
  • ➕ Could provide explicit queue state, priorities, retries, and operational controls.
  • ➕ Would support more sophisticated cross-run coordination.
  • ➖ Adds persistent infrastructure and operational complexity.
  • ➖ Conflicts with the current repository-coordinated, event-driven architecture.

Recommendation: The documented finish-and-coalesce policy is the best fit: it preserves active work, processes the newest relevant context, reapplies authorization and CEL routing, and bounds resource amplification without introducing a central scheduler. Cancellation remains appropriate only for explicit operator action, while per-event queuing is unnecessarily wasteful for overlapping event bursts.

Files changed (6) +131 / -2

Documentation (5) +123 / -2
0034-centralized-shim-routing-via-dispatch.mdSupersede automatic cancellation guidance +4/-0

Supersede automatic cancellation guidance

• Adds an update noting that ADR 0098 replaces automatic cancellation with serialized runs and bounded follow-up event coalescing.

docs/ADRs/0034-centralized-shim-routing-via-dispatch.md

0063-polling-based-work-discovery.mdAlign polling guidance with coalesced follow-ups +5/-0

Align polling guidance with coalesced follow-ups

• References ADR 0098 as the replacement for automatic cancellation. It retains source-native locking and agent idempotency as defense-in-depth measures.

docs/ADRs/0063-polling-based-work-discovery.md

0098-serialize-agent-runs-and-coalesce-subsequent-events.mdDefine serialized agent scheduling policy +101/-0

Define serialized agent scheduling policy

• Adds the accepted architecture decision for finishing active runs and coalescing later subject events into bounded follow-ups. It specifies canonical 'NormalizedEvent' handoff, driver retrieval requirements, repeated authorization and CEL evaluation, stable event ordering, and observable limit exhaustion.

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md

architecture.mdDocument serialized dispatch and follow-up flow +9/-1

Document serialized dispatch and follow-up flow

• Adds serialized per-harness and per-subject execution to the decided coordination architecture. It also reframes cancellation, retry, and reassignment as an open question relative to the new automatic coalescing policy.

docs/architecture.md

security-threat-model.mdClassify coalescing as a DoS defense +4/-1

Classify coalescing as a DoS defense

• Resolves the open question about event debouncing by identifying finish-and-coalesce scheduling as both a correctness mechanism and a denial-of-service defense, with a link to ADR 0098.

docs/problems/security-threat-model.md

Other (1) +8 / -0
environment.tomlAdd generated Codex environment setup +8/-0

Add generated Codex environment setup

• Adds the generated 'fullsend' Codex environment definition. Its setup trusts the repository's mise configuration from the active Codex worktree.

.codex/environments/environment.toml

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 11:50 AM UTC · Ended 11:54 AM UTC

Commit: e0db092 · View workflow run →

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Site preview

Preview: https://65a0e30b-site.fullsend-ai.workers.dev

Commit: 4fe27fc6f45e55fd258652e9c8c99690a6f09d13

@qodo-code-review

qodo-code-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Coalescing discards event contents 🐞 Bug ≡ Correctness
Description
The follow-up evaluates every event but passes only the newest matching event into the run, so
earlier comments and their distinct concerns never reach the agent. This contradicts the stated goal
of considering accumulated concerns and silently drops actionable user input.
Code

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[R78-80]

+`fullsend run` selects the newest matching event, resolves the harness and its
+CEL-guarded overlays against that event, and invokes a fresh sandbox and runtime
+run. Events coalesced into that follow-up do not each receive their own run.
Relevance

●●● Strong

Selecting only the newest event conflicts with the ADR’s stated goal of considering accumulated
concerns and risks losing input.

PR-#5685
PR-#2582

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ADR 0098 motivates the change with multiple comments whose accumulated concerns should be
considered, but its algorithm selects only the newest event. NormalizedEvent contains one
transition/comment and its state snapshot has no comment history, proving earlier event bodies are
unavailable to the follow-up.

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[25-30]
docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[72-80]
internal/normevent/event.go[80-90]
internal/normevent/event.go[128-133]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The coalescing algorithm evaluates all later events but invokes the follow-up with only the newest event. Earlier matching comments or edits are therefore absent from the agent's input rather than being considered together.

## Issue Context
The newest event may still control harness and overlay resolution, but the follow-up needs a bounded representation of every coalesced matching event so user concerns are not discarded.

## Fix Focus Areas
- docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[53-80]
- docs/normative/normalized-event/v1/normalized-event.schema.json[6-27]
- internal/normevent/event.go[11-19]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Follow-up handoff is non-atomic ✓ Resolved 🐞 Bug ☼ Reliability
Description
The policy retrieves later events only after execution terminates but defines no atomic handoff
between that final retrieval and independently triggered dispatches. An event racing the final check
can either start concurrently or be suppressed after the check and receive no follow-up, violating
serialization or losing work.
Code

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[R72-75]

+Input drivers MUST provide an operation that accepts the event that started a
+run and returns later events for the same subject as `NormalizedEvent` values.
+The execution loop within `fullsend run` calls this operation after the sandbox
+and runtime reach a terminal state. It applies the same platform authorization
Relevance

●● Moderate

Race-safety is architecturally important, but historical evidence does not decisively establish
acceptance of this specific handoff requirement.

PR-#1215

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The ADR describes only a post-run retrieval loop, while the current dispatch workflow independently
starts a harness job for each matrix entry and relies on GitHub concurrency cancellation. The
architecture still leaves the need for a queue, lock, or claim system open, so no component owns the
atomic dispatch-to-follow-up handoff required by the decision.

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[59-87]
.github/workflows/reusable-dispatch.yml[1611-1620]
docs/architecture.md[305-315]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ADR does not define atomic ownership of a harness/subject across initial dispatch, follow-up polling, and run completion. This leaves a race at the final event check where serialization or event delivery can fail.

## Issue Context
The protocol needs a subject-scoped lease, lock, or equivalent compare-and-swap handoff that coordinates independently triggered workflows with the execution loop and guarantees a final cursor check before ownership is released.

## Fix Focus Areas
- docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[59-87]
- docs/architecture.md[275-280]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Events lack ordering cursor 🐞 Bug ≡ Correctness
Description
The required driver operation receives only the starting NormalizedEvent, but that canonical value
has no occurrence ID, timestamp, sequence, or cursor. Repeated transitions on the same subject
therefore cannot be reliably classified as later or ordered newest, causing possible replay or
omission.
Code

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[R72-73]

+Input drivers MUST provide an operation that accepts the event that started a
+run and returns later events for the same subject as `NormalizedEvent` values.
Relevance

●● Moderate

Ordering is required, but the ADR delegates stable ordering to drivers; schema changes are not
clearly mandated.

PR-#6769

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
ADR 0098 requires the driver to infer later events from the starting NormalizedEvent and select the
newest. The closed normative schema and corresponding Go Source type contain only source
system/type/action, with no occurrence identity or ordering boundary from which that operation can
proceed.

docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[72-87]
docs/normative/normalized-event/v1/normalized-event.schema.json[6-27]
docs/normative/normalized-event/v1/normalized-event.schema.json[439-459]
internal/normevent/event.go[160-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The follow-up retrieval API must identify events occurring after the initial event, but its only input has no event occurrence or ordering metadata. Driver-defined ordering cannot establish the starting boundary for repeated indistinguishable transitions.

## Issue Context
Add a canonical source event identifier, sequence/timestamp, or opaque driver cursor and require drivers to use it for exclusive, monotonic retrieval. Update both the normative schema and Go representation.

## Fix Focus Areas
- docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md[65-87]
- docs/normative/normalized-event/v1/normalized-event.schema.json[6-27]
- docs/normative/normalized-event/v1/normalized-event.schema.json[439-459]
- internal/normevent/event.go[160-176]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. Accepted ADR edits unnamed 📘 Rule violation § Compliance
Description
The PR edits accepted ADRs 0034 and 0063, but its description only refers generically to “related
ADRs” without identifying either ADR. Each accepted ADR edit must be explicitly named and summarized
in the PR description.
Code

docs/ADRs/0034-centralized-shim-routing-via-dispatch.md[R149-151]

+> **Update (2026-09):** [ADR 0098](0098-serialize-agent-runs-and-coalesce-subsequent-events.md)
+> replaces automatic cancellation with serialized runs and bounded follow-up
+> event coalescing.
Relevance

●●● Strong

Accepted ADR annotations are expected, and PR descriptions should identify substantive edits to
accepted ADRs.

PR-#2465
PR-#5798

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both documents have status: Accepted and receive new scheduling-policy annotations, while the
supplied PR description names only ADR 0098 and refers to the modified accepted records generically
as “related ADRs.” Rule 1062059 requires the identifier or filename and a short summary for each
modified accepted ADR.

Rule 1062059: Call out edits to accepted ADRs in PR descriptions
docs/ADRs/0034-centralized-shim-routing-via-dispatch.md[1-19]
docs/ADRs/0034-centralized-shim-routing-via-dispatch.md[149-151]
docs/ADRs/0063-polling-based-work-discovery.md[1-23]
docs/ADRs/0063-polling-based-work-discovery.md[354-357]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR description does not explicitly identify the edits to accepted ADRs 0034 and 0063.

## Issue Context
Add each ADR identifier or filename to the PR description and briefly state that it now points to ADR 0098 as replacing automatic cancellation with serialized, coalesced follow-up runs.

## Fix Focus Areas
- docs/ADRs/0034-centralized-shim-routing-via-dispatch.md[149-151]
- docs/ADRs/0063-polling-based-work-discovery.md[354-357]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 65 rules
Review mode: ⚖️ Balanced: Although mostly documentation, this establishes a new concurrency, event-authorization, and denial-of-service policy and also changes environment configuration, so its behavioral and security implications warrant a complete review.

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread docs/ADRs/0034-centralized-shim-routing-via-dispatch.md Outdated
Comment thread docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md Outdated
Comment thread docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md Outdated
Comment thread docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md Outdated
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ifireball
ifireball force-pushed the codex/add-debounced-agent-triggering branch from e0db092 to 7f56095 Compare September 2, 2026 11:54
@ifireball ifireball changed the title Document serialized agent runs and coalesced follow-up events docs(adr): serialize agent runs and coalesce subsequent events Sep 2, 2026
@ifireball ifireball self-assigned this Sep 2, 2026
Signed-off-by: Barak Korren <bkorren@redhat.com>
Assisted-by: Codex (gpt-5.6-sol)
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 11:56 AM UTC · Ended 11:57 AM UTC

Commit: 7f56095 · View workflow run →

@ifireball
ifireball force-pushed the codex/add-debounced-agent-triggering branch from 7f56095 to 0493886 Compare September 2, 2026 11:56
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:59 AM UTC · Completed 12:17 PM UTC

Commit: 0493886 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.93

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Docs/config-only PR adding a new ADR with minor cross-references; no protected paths, security-sensitive files, CI, or dependency changes. Slight elevation from medium blast radius and high churn on docs/architecture.md, but the actual change to that file is small (10 added, 1 deleted). Signals unchanged from prior assessment; score preserved at 2.

Previous run

Risk Assessment: moderate (2/5)

Details

Docs/config-only PR adding a new ADR with minor cross-references; no protected paths, security-sensitive files, CI, or dependency changes. Slight elevation from medium blast radius and high churn on docs/architecture.md, but the actual change to that file is trivial (9 added lines). Overall low-to-moderate risk.

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

Looks good to me

Previous run

Review

Findings

Medium

  • [auto-trust of tool configuration] .codex/environments/environment.toml:8mise trust -a -y auto-trusts all mise configuration files in the worktree without user confirmation. The -a flag trusts all config files recursively, not just the root mise.toml. In a Codex environment operating on untrusted worktrees (e.g., checking out PR branches), this would automatically trust any mise config files introduced or modified by those branches — including potentially malicious [hooks], [tasks], or [env] directives that execute arbitrary commands.
    Remediation: Scope the trust to the known config file only (mise trust mise.toml) instead of using -a. Alternatively, if Codex environments only ever operate on the default branch, document that assumption explicitly.

Low

  • [scope-creep] .codex/environments/environment.toml — The PR title scopes this change to docs(adr) but bundles an unrelated Codex environment setup file. While the file is small and autogenerated, it is not documentation or an ADR — it is developer environment configuration. Mixing unrelated changes into a docs PR makes bisect and revert less clean.
    Remediation: Consider splitting the Codex environment file into a separate PR (e.g., chore: add codex environment setup) or adjusting the PR title/prefix to reflect both scopes.

  • [stale-doc] docs/ADRs/0063-polling-based-work-discovery.md:486 — The Negative/risks section references "mitigated by per-stage cancel-in-progress groups" without an ADR 0098 update annotation. The PR adds an update note after the first cancel-in-progress passage (after line 352) but not at this second reference.
    Remediation: Add a brief annotation similar to the one added after line 352.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

Comment thread docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md Outdated
Comment thread docs/ADRs/0098-serialize-agent-runs-and-coalesce-subsequent-events.md Outdated
Signed-off-by: Barak Korren <bkorren@redhat.com>
Assisted-by: Codex (gpt-5.6-sol)
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:09 AM UTC · Completed 11:29 AM UTC

Commit: 4fe27fc · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.55

Comment on lines +72 to +75
The execution platform MUST allow the active run to finish and coalesce later
matching events into one pending run representing the newest retained event.
GitHub Actions provides these semantics with a subject-scoped concurrency group,
`cancel-in-progress: false`, and its default single-pending queue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this is yet another perfect example of GH-AW overlap.

A thing I find very compelling about GH-AW in this respect is that what GitHub Actions providers, GH-AW automatically provides too!

This is the "input side" mirroring the discussion in #6614

We could expose e.g.

github:
  concurrency: cancel-in-progress: false

BTW there's also some experimental support in GH-AW for feeding dynamic events into agent runs automatically, check e.g. https://github.github.com/gh-aw/reference/safe-outputs/#steering-issues-steer

Of course some of this is implementable via prompts; just tell the review agent (for example) to check for changes since it started (though this complicates "what it reviewed").

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should expose this to users like gh-aw does. I think ideally fullsend should work at a higher level, users sohuld be concerned with that they want the agent to do, not the details of when exactly it gets triggered - whice may be slightly different across platforms but should result in a similar user-facing behaviour.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expose this to users

"users" = humans? I think you have a mindset that humans will be writing the fullsend BYO agent YAML by hand. That seems unlikely to be true broadly.

Again I think GH-AW has done a good job in this because there's lots of examples that both humans and agents can reference/fork - but an especially good idea here is the compiler - agents (and humans!) are much more effective with tooling to check their output quickly and reliably.

I am not seeing a choice on concurrency that would make sense for all workflows.

@ifireball ifireball Sep 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to make an opinionated educated choice here - agent instances derived from the same harness file (line in the config) never run in parallel against the same target entity - that simplified the mental model for a lot of things. I would be willing to revise this in a future ADR given concrete examples were different behaviour is crucial.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

against the same target entity

I think the tricky thing is that while Fullsend's current builtin agents have a pretty hardcoded concept of "target entity", there are valid agentic flows that do not; https://github.github.com/gh-aw/patterns/workqueue-ops/ is one example.

Basically this arises with actions that are scheduled.

Though of course triggering based on time can have real problems too, and it can often make sense to ensure that any pending work is automatically enqueued by event-based triggers.

For example, fullsend's retro agent runs once per PR today, but it could actually make sense for a PR to add a checklist item to a queued retro, and have the retro agent actually run against multiple PRs as a group so it gets a more holistic view - that could be schedule based but would ideally deterministically no-op if there was no work to do.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanting to implement this kind of pattern to facilitate automated recovery from missed events as well as enable flows like staleness detection, in a way that pust less burden on the agent implementers is exactly why I'm proposing this change and other related ones.

I think this discussion in not really productive at this point. You seem o be making an argument for theoretical agents that do not exist while I'm trying to make changes to significantly improve the current set of agent and remove major automation road blocks from the existing workflow.

We can always expand the API and add lowe level primitives if use cases show up, removing stuff once its out there is much harder. So I'll keep the API narrow for now and focused on wnat we ave concrete use cases for.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I think that's a reasonable position.

You seem o be making an argument for theoretical agents that do not exist

Kind of. What I really like just to emphasize is that core model with GH-AW that agent invocations are just action runs and so existing verbs like concurrency which are already well-understood and known apply.

(To be clear my preferred outcome is still that we target Tekton as a baseline, which would drop the abstractions and mean in the end we control the flow much more e2e)

Comment on lines +78 to +79
compatible groups and cancellation settings. Integrations for platforms without
equivalent semantics MUST emulate them outside the agent execution process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integrations for platforms without equivalent semantics MUST emulate them outside the agent execution process.

My instinct says that's going to get hard fast without going with my suggestion of actually always executing in e.g. Tekton (Konflux) which then becomes the baseline target...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still aspire to this, and write another ADR explaining why this cannot be done on a particular platform once we actually try to implement it.

Comment on lines +81 to +82
Each agent run MUST reconcile the subject's current state rather than assume the
triggering event describes all outstanding work. The retained event may still

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, the thing I like about GH-AW is it's a very clear framework.

Each agent run MUST reconcile the subject's current state

Do we really need that for all agents? I don't think so.

Also it could mean a review agent on an active PR being discussed spends a long time looping and perhaps gets timed out and killed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we really want this - I think focusing too much on events is a consistent design issue we keep introducing into CI systems, and keep avoiding to fix because it becomes too expensive once we realize it was the wrong desing choice.

WRT review timing out - its really up to us to avoid that kind of bug, and balance retries with execution time - nothing in the ADR sais otherwise. The only thing this ADR says is that if there are 10 comment/CI results on a PR - it best to launch review once to deal with them all rather then 10 times.

@ralphbean ralphbean Sep 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - the event-oriented (event obsessed?) nature of things like Konflux and Tekton are a problem. When things flake, there's nowhere in that model that makes it easy or obvious how to recover later.

The kube controller model, on the other hand, handles this well. The controller tracks a kind of resource and an event-like mechanism functions as a performance optimization to prompt it to respond, but in the model it is oriented on the entity, on the resource and its state. If things flake, reconciling in the next pass is obvious.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG comparing this to the controller model is brilliant! That probably gives us the right mental framework to document this in a way that would be most productive!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - the event-oriented (event obsessed?) nature of things like Konflux and Tekton are a problem.

While you know this, I think it's really worth spelling out that that behavior is more specific to PaC. It's absolutely possible to skip PaC as e.g. rhel-on-gitlab does, and implement something more like a "controller" there that triggers a pipeline possibly multiple times, especially on push events - the reconciliation loop there is clear: "is there a successful pipeline corresponding to the current git HEAD".

(Also the way PaC spams comments on gitlab is just absolutely awful)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The controller tracks a kind of resource and an event-like mechanism functions as a performance optimization to prompt it to respond, but in the model it is oriented on the entity, on the resource and its state.

I would just link https://kubernetes.io/docs/concepts/architecture/controller/ which explains this pretty clearly, and I think concrete important terms to use here are "spec" vs "status" among others.

waynesun09 added a commit that referenced this pull request Sep 4, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 4, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 4, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 4, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 5, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 6, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
waynesun09 added a commit that referenced this pull request Sep 10, 2026
ADR 0098 (#6909) is open and under review, and it and this change were
written independently against the same feedback. Saying the dispatch half
here is 0098 implemented claims an alignment nobody has established. State
the shared first move, that the two were not designed against each other,
and that they should be reconciled where they overlap.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
@ralphbean

Copy link
Copy Markdown
Member

Thinking about the layering here, I wonder if ADR 0098 (this coalescing one) would be clearer after ADR 0106 (the entity-first one), both numerically and conceptually. Entity-first evaluation establishes the current-state reconciliation model; coalescing then becomes an optimization on top of that framework. Consider renumbering this to follow ADR 0106 (the entity-first one) and simplifying some of the text here by referring back to it directly.

Like Greg brought up in slack, I’d also like to see GitLab as a first-class consideration. The policy is forge-agnostic, but the implementation discussion is currently anchored in GitHub Actions concurrency (cancel-in-progress: false and one pending run). Please include how GitLab provides or would emulate the same invariant, along with any platform-specific gaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants