Repository navigation
feat(workers): persist fenced delivery results (W1-03f-a) - #301
Conversation
Test-First: src-tauri/src/workers.rs::repeated_worker_delivery_done_is_idempotent Test-First: src-tauri/src/workers.rs::wrong_run_or_fence_cannot_complete_worker_delivery Co-Authored-By: GPT-5 <47299143+Cuarroc@users.noreply.github.com>
Test-First: src-tauri/src/workers.rs::repeated_worker_delivery_done_is_idempotent Test-First: src-tauri/src/workers.rs::wrong_run_or_fence_cannot_complete_worker_delivery Co-Authored-By: GPT-5 <47299143+Cuarroc@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a066d870a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let run = store | ||
| .get_development_run(run_id) | ||
| .await? |
There was a problem hiding this comment.
Keep replay authorization inside the transaction
When the initial transition finds an already-terminal run, its BEGIN IMMEDIATE transaction is released before this separate read. A concurrent task checkpoint and reclaim can change continuous_tasks.claim_owner or claim_fence in that gap, while the immutable run row still contains the old credentials and terminal status; the checks below then return Ok to a stale worker. Validate and return an idempotent terminal replay within the same store transaction, including the live task authority check.
Useful? React with 👍 / 👎.
| store | ||
| .complete_development_run(run_id, owner, fence, None) | ||
| .await, |
There was a problem hiding this comment.
Do not terminalize the run before native cleanup
When a native worker invokes the planned self-report command while its agent process is still running, this immediately changes the run from launched to completed (and the blocked branch similarly changes it to failed). The subsequent native exit path in store/native_completion.rs only accepts intent, launched, or reconciling at line 149 and requires reconciling at line 47, so capture finalization and session cleanup fail after either report, leaving launch/accounting state unresolved. Persist the worker's report separately or defer the terminal run transition until native cleanup has completed.
Useful? React with 👍 / 👎.
|
Queued — the merge queue status continues in this comment ↓. |
No-Test: test-only coverage of existing behaviour; no production change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 44 minutes 2 seconds in the queue, including 11 minutes 20 seconds running CI. Required conditions to merge
|
Dieser Teil speichert die Abschlussmeldung eines Worker-Laufs dauerhaft im vorhandenen Laufdatensatz. Ein wiederholtes „done“ verändert nichts, während falsche Läufe und veraltete Fences abgewiesen werden. Eine Blockierung wird zusammen mit ihrem konkreten Grund gespeichert.
Report
What changed
WorkerDelivery::{Done, Blocked}contract andrecord_worker_deliveryinsrc-tauri/src/workers/delivery_state.rs:8-65.development_runsterminal states; no schema change or store-lane edit was needed.src-tauri/src/workers.rs:645-688,src-tauri/src/workers.rs:831,src-tauri/src/store/development_delivery.rs:38-113, andsrc-tauri/src/store/development_runs.rs:546-580.Evidence
origin/main855850aa5162cc9100d1a5afdd9faee1a33e29d2(fetched 2026-10-04).c9968f7d262929d8fddddf058cb3d800835a9a7e.cargo test --bin projecta worker_deliveryon the red commit: exit 101; bothrepeated_worker_delivery_done_is_idempotentandwrong_run_or_fence_cannot_complete_worker_deliveryfailed for the intended reasons.cargo test --bin projecta worker_deliveryat the final candidate: exit 0; 3 passed.bash scripts/ci/gates.sh lane prepushata066d870a0e39c6e61e61052716af71e2348cb05: exit 0; log/tmp/srv-w1-03f-a-prepush.logon the worker host. Rust suite: 1708 passed, 7 skipped.git ls-remote origin refs/heads/codex/w1-03f-a-delivery-statereturneda066d870a0e39c6e61e61052716af71e2348cb05.NICHT ABGEDECKT
#[cfg(windows)]tests or the Windows clippy arms; the Windows lane runs in the merge queue.src-tauri/src/bin/pa.rs) is intentionally not included, sopa worker done|blockedis not yet wired to this worker-layer contract.Review status
Reviewer B (Claude Sonnet 5.5, Anthropic; author family codex), candidate a066d87, then f00f524.
Review disposition
require_run_authority,development_runs.rs:1009) runs before the status check intransition_run(:965vs:966), so a replay is only recognised for the live owner/fence; the string-matched error is the exact terminal-to-terminal message and the replay test would fail if it changed. No second pattern: existing store APIs andStringerrors are used. No high or medium finding.worker_delivery_replay_never_changes_a_different_terminal_result; test-only, passes on unchanged code (No-Test trailer).bash scripts/ci/gates.sh lane prepushat f00f524: exit 0.Open points
pa worker done|blockedwithout weakening the credential-bound run identity.