Repository navigation
refactor(reply): converge queued follow-up execution [AI-assisted] - #114599
Conversation
9c49543 to
c5ba11e
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 2:54 PM ET / 18:54 UTC. ClawSweeper reviewWhat this changesThe PR refactors queued follow-up replies to use the shared agent-turn execution pipeline while retaining queued admission, delivery, and cleanup behavior. Merge readiness⛔ Blocked until real behavior proof is added - 6 items remain The environment denied the required read-only inspection command before repository policy, PR diff, and current-main behavior could be verified, so no safe merge or close conclusion is possible. Priority: P2 Review scores
Verification
How this fits togetherQueued follow-up turns are delayed agent replies that enter through the reply queue, execute an agent turn, then project progress and deliver results to the originating channel. This PR changes the boundary between queued orchestration and the shared agent execution pipeline. flowchart LR
A[Queued follow-up] --> B[Admission and session fence]
B --> C[Shared agent execution]
C --> D[Accounting and terminal settlement]
D --> E[Queued delivery decision]
E --> F[Originating channel or dispatcher]
Decision needed
Why: The environment prevented the mandatory repository-policy and source inspection needed to assess a large runtime refactor safely. Before merge
Findings
Agent review detailsSecurityNeeds attention: No concrete security defect is established, but the dedicated source-level security and supply-chain pass could not be completed because read-only inspection was blocked. PR surfaceSource -112, Tests -4248, Other -2. Total -4362 across 45 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Re-run a full read-only review once repository reads work: inspect scoped policy, maintainer notes, current-main and branch paths, prior-review deltas, exact-head checks, and a redacted real queued-follow-up runtime transcript before deciding merge readiness. Do we have a high-confidence way to reproduce the issue? Unclear: the supplied context describes focused tests and CI but no independently inspectable current-head real queued-follow-up transcript; the required repository review command could not run. Is this the best way to solve the issue? Unclear: the proposed convergence may be the right ownership direction, but current callers, siblings, tests, and maintainer decisions could not be independently inspected. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against e1e62f2a6e99. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
c9a5e24 to
497fa43
Compare
|
Merged via squash.
|
…penclaw#114599) * refactor(reply): converge queued follow-up execution * fix(reply): preserve follow-up lifecycle invariants * fix(reply): fence follow-up admission generation * fix(reply): reconcile follow-up preflight state * fix(reply): fence persisted follow-up generation * fix(reply): defer follow-up compaction terminal notices * style(reply): format follow-up admission * fix(reply): normalize follow-up session metadata * fix(reply): fence in-memory follow-up generation * test(reply): satisfy follow-up lint contracts * fix(reply): revalidate failed follow-up preflight * fix(reply): reject deleted follow-up generation * fix(reply): release restart-aborted operations * test(reply): avoid unbound operation assertion * fix(reply): refresh follow-up presentation state * test(reply): use canonical plan update shape * fix(reply): harden follow-up progress delivery * fix(reply): synchronize recovered follow-up operation * test(reply): mark partial operation fixture * fix(reply): adopt owned preflight rotations * docs(reply): clarify restart settlement guard * test(reply): preserve terminal notice call count * refactor(reply): remove retired follow-up exports * test(reply): prove dispatcher-only follow-up routing * chore(reply): remove stale delivery type import * fix(reply): finalize follow-up cleanup and failure delivery * fix(reply): prefer authoritative admission snapshot * fix(reply): avoid replay on progress failure * fix(reply): retain suppressed-mode terminal failures * fix(reply): preserve follow-up session context * fix(reply): preserve exclusive delivery and deleted state * fix(reply): prevent post-start follow-up replay * fix(reply): prioritize safe follow-up failure delivery * fix(reply): signal follow-up execution after start * fix(reply): harden follow-up settlement * refactor(reply): keep session clear internal * fix(reply): consume pre-run user aborts * fix(reply): retain progress delivery failure * fix(ci): register codex prewarm test shard * test(reply): retain operation mock type
What Problem This Solves
Queued follow-up turns had accumulated a second copy of the agent execution, fallback, terminal settlement, accounting, progress, and delivery logic. That duplicate path had drifted from foreground turns and made lifecycle races, session rotation, source visibility, and cross-channel delivery substantially harder to reason about and test.
Why This Change Was Made
This maintainer-requested redesign makes queued turns a thin adapter into the canonical
agent-runner-*execution pipeline. Follow-up-specific ownership is now limited to admission, progress projection, final delivery decisions, and unconditional cleanup; foreground and queued turns share candidate execution, fallback settlement, and result accounting.The refactor intentionally adds no config, environment, protocol, plugin SDK, SQLite schema, compatibility alias, fallback execution path, or durable pending-final marker. Local/non-routable queued items retain the latest-live-dispatcher contract.
The existing restart-loss window remains: execution and accounting can complete before the turn enters
routeReply/sendDurableMessageBatch. This PR preserves the current durable transport contract and does not add a second pending-final marker; any stronger recovery contract should be a separate design and proof track.User Impact
There is no intended user-visible behavior change. Queued turns now receive the same canonical runtime behavior as foreground turns while preserving room-event silence, message-tool-only privacy, one-shot stranded recovery, cross-channel non-misdelivery, queue restoration, session-generation fencing, progress ordering, and typing cleanup.
Evidence
c217e02c3f5: https://github.com/openclaw/openclaw/actions/runs/30286041559followup-runner.tsis 177 lines of composition/cleanup, both max-lines entries are removed, production LOC is net -176, and test LOC is net -4,295.AI-assisted: yes. The implementation and review loop were performed with Codex under maintainer direction.