Skip to content

Commit 9d8d2ab

Browse files
committed
fix(apply): queue exact drift refreshes without hydration
1 parent f211e21 commit 9d8d2ab

8 files changed

Lines changed: 582 additions & 9 deletions

File tree

‎.github/workflows/sweep.yml‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7023,6 +7023,7 @@ jobs:
70237023
if: ${{ always() && !cancelled() && steps.primary-apply-result.outputs.succeeded == 'true' && steps.target.outputs.target_repo == 'openclaw/openclaw' }}
70247024
env:
70257025
GH_TOKEN: ${{ github.token }}
7026+
DISPATCH_REPOSITORY: ${{ github.repository }}
70267027
run: |
70277028
set -euo pipefail
70287029
if [ "${APPLY_NOOP:-false}" = "true" ] ||
@@ -7040,23 +7041,26 @@ jobs:
70407041
target_branch="$(gh api "repos/${APPLY_TARGET_REPO}" --jq .default_branch)"
70417042
IFS=',' read -r -a requeue_items <<< "$items"
70427043
for item_number in "${requeue_items[@]}"; do
7044+
item_kind="$(gh api "repos/${APPLY_TARGET_REPO}/issues/${item_number}" --jq 'if .pull_request then "pull_request" else "issue" end')"
70437045
jq -n \
70447046
--arg target_repo "$APPLY_TARGET_REPO" \
70457047
--arg target_branch "$target_branch" \
70467048
--arg item_number "$item_number" \
7049+
--arg item_kind "$item_kind" \
70477050
'{
7048-
event_type: "clawsweeper_target_sweep",
7051+
event_type: "clawsweeper_item",
70497052
client_payload: {
70507053
target_repo: $target_repo,
70517054
target_branch: $target_branch,
70527055
item_number: $item_number,
7053-
batch_size: "1",
7054-
shard_count: "1",
7055-
hot_intake: "false",
7056+
item_kind: $item_kind,
7057+
source_event: (if $item_kind == "pull_request" then "pull_request" else "issues" end),
7058+
source_action: "source_drift_requeue",
7059+
supersedes_in_progress: false,
70567060
codex_timeout_ms: "1200000"
70577061
}
7058-
}' | gh api --method POST "repos/${{ github.repository }}/dispatches" --input -
7059-
echo "::notice::Requeued exact review for ${APPLY_TARGET_REPO}#${item_number}: its close was blocked by source drift or an unverified-checkout review."
7062+
}' | gh api --method POST "repos/${DISPATCH_REPOSITORY}/dispatches" --input -
7063+
echo "::notice::Dispatched exact review refresh for ${APPLY_TARGET_REPO}#${item_number}: its close was blocked by source drift or an unverified-checkout review; durable admission is owned by queue intake."
70607064
done
70617065
70627066
publish-apply-observability:

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ checkpoint, and status-only commits are intentionally omitted.
5959

6060
### Fixed
6161

62+
- Routed default apply's bounded source-drift refreshes through exact-event queue intake so full-repository hydration cannot fail before admission.
6263
- Indexed webhook receipt expiry by receipt time to avoid scanning and sorting retained history on each accepted delivery, preserving 30-day retention and transactional cleanup.
6364
- Bounded apply/proof/comment-sync record retention to selected records and paired dependencies, avoiding unrelated archive loads during ledger finalization without changing close guards.
6465
- Kept projected GitHub reads out of the durable ETag cache so incompatible response shapes cannot hide requested reviewers from close guards. Thanks @goutamadwant! (#1242)

‎docs/scheduler.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,26 @@ single-item review only needs the target repository and live GitHub item state;
283283
generated state is checked out afterward, just before publishing the review
284284
record, safe close result, and command-router ledger.
285285

286+
Default close-mode apply refreshes use that same queue-only intake. The merged
287+
apply report selects at most five distinct source-drift items in report order,
288+
with unverified-checkout holds filling spare slots. The producer resolves the
289+
repository default branch and each selected item's kind with narrow GitHub
290+
reads, then sends `clawsweeper_item` with `source_action: source_drift_requeue`
291+
and `supersedes_in_progress: false`. It does not send `clawsweeper_target_sweep`,
292+
run a broad planner, or hydrate canonical repository records before enqueue.
293+
Read or dispatch failures remain visible step failures; a dispatch notice is
294+
not a durable admission receipt. The existing intake signs the queue request.
295+
296+
`source_drift_requeue` uses the queue's existing low-priority recovery contract:
297+
existing pending or leased work, including maintainer-command context and source
298+
authority, wins; delivery deduplication, pending backpressure, and lease fencing
299+
remain queue-owned. Exact selection requests a fresh review of current source
300+
without a new `force` flag, stale source pin, or producer-supplied lease. Closed
301+
or missing targets still stop at the queue/executor live-state checks. General
302+
manual and broad dispatch behavior, the independent proof cursor, and close
303+
policy are unchanged. OpenClaw Bay needs no change: this producer reuses existing
304+
queue/lifecycle fields and adds no published schema, status field, or control.
305+
286306
## Automerge Fast Path
287307

288308
Automerge is an exact-item event path. A maintainer command dispatches one

0 commit comments

Comments
 (0)