Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThe Codex plugin delays acknowledging native child results until the parent completes a later model response, and updates ordering tests and harness documentation. Review scores
Merge readiness⛔ Blocked before merge - 4 items remain Keep open: current main fixes yielded and ended-parent receipt handling, but this branch still adds meaningful active-turn sampling and eager-wait protection. The protected maintainer-owned work is not eligible for cleanup closure. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherOpenClaw’s Codex plugin observes native child completions and decides whether the parent already consumed them. Unconsumed results feed the existing detached continuation so the parent can finish and reply. flowchart TD
A[Native child completes] --> B[Parent completion receipt]
B --> C[Per-turn sampling state]
D[Recorded wait output] --> C
E[Later parent response] --> C
C --> F{Exact parent consumed result?}
F -->|Yes| G[Acknowledge delivery]
F -->|No| H[Detached parent continuation]
Technical reviewBest possible solution: Integrate the remaining active-turn sampling and eager-wait guards into current main’s receipt owner while preserving its yielded, settled, cancelled, and successor-assignment protections. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the remaining active-parent mechanism: main immediately matches receipts without requiring a later response or recorded wait output. No current-main execution was performed in this read-only review. Is this the best way to solve the issue? Yes, confirming consumption within the existing receipt owner is a focused solution; the implementation now needs to fit main’s newer lifecycle guards. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 90c6934d630f. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +136, Tests +482, Docs +3. Total +621 across 19 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 5, 2026, 8:53 PM ET / October 6, 2026, 00:53 UTC (Revision 5). |
Verification remains blocked — no live behavior claimThe requested real Gateway/Codex test could not authenticate: the configured Testbox Codex refresh token was rejected as revoked. The Gateway and Control UI started, but no native child spawned and no parent final response was produced. These are setup-failure captures, not before/after proof. Both temporary Testboxes were stopped. Published candidate remains The child-reuse repairs remain local and unpublished. The last validated local candidate passed 153 monitor/mirror tests and full changed-file checks; an additional admission-ordering regression is still open. Pinned Codex acknowledges either a started turn or steering of an existing turn, so retaining the subscription cannot rely on always receiving a new No merge, no source-PR closure, and no substitution of another credential. Landing remains gated on the remaining repair/review, exact-head CI, and real yielded-parent plus safe-reuse proof after the configured Testbox authentication is restored. |
|
Related fix: #150065 updates private-completion guidance and Gateway cancellation classification. It does not determine whether a native Codex completion receipt was actually consumed by a later model response. This PR's per-turn receipt accounting and follow-up for unconsumed native child results remain distinct; it is not superseded by #150065. |
e094a1c to
b0ae52b
Compare
Keep native completion receipts pending until a later non-compaction model response confirms consumption. Preserve yielded-parent wakeups, exact pre-bind ownership, native wait deduplication, and same-turn child reuse. Based on #137822; fixes #137710. Co-authored-by: Josh Tsai <[email protected]>
b0ae52b to
9d4bc16
Compare
|
A live case from our install (OpenClaw + Codex plugin 2026.10.1, Telegram, 10-11 to 10-13). Results the parent already consumed in the foreground still get the detached redelivery.
From the diff, this PR changes when a receipt is accepted, not how Evidence (Codex rollouts + gateway log, UTC)Counts: 31 children with completion in the rollout; 30 have a parent Found by Claude Opus 5.5 (Claude Code) while tuning our own install. |
|
I found a possible false-settlement path at the current head In The source-supported schedule is:
Relevant Codex0.164 source:
The native preemption → compaction → history-omission schedule above is source analysis, not a deterministic native/Gateway reproduction. The tracker-level component is now reproduced independently below. Could the existing staging owner invalidate unacknowledged receipt evidence at this history-replacement boundary? I am not proposing a second receipt mechanism, and this finding is separate from the native resume raw-event opt-in gap discussed in openai/codex#34353. Runnable tracker-level regressionI reproduced the stale-pending part of this finding against the actual receipt classes at An unsampled raw Observed: 1 failing regression, 1 passing control, exit1 (Node v26.10.0). This is deterministic tracker/parser evidence, not a native preemption+compaction or Gateway E2E reproduction. Those synthetic events do not prove what a particular compaction summary retained. The native schedule and history-retention concern remain the separate source analysis described above. To reproduce without installing dependencies, save the script below as node /path/to/compaction-repro.mjs /path/to/openclawThe production receipt/parser/protocol/coercion modules are unchanged. Only unrelated logging/history/task-ID imports are isolated with fail-fast stubs; invoking one would fail the test. The regression expects Self-contained regression and control// Run with Node 26 (tested v26.10.0): node compaction-repro.mjs /path/to/pinned/openclaw
// Production receipt, parser, protocol and coercion modules are not modified.
import assert from "node:assert/strict";
import { test } from "node:test";
import { registerHooks } from "node:module";
import { resolve } from "node:path";
import { pathToFileURL } from "node:url";
const root = pathToFileURL(resolve(process.argv[2] ?? ".") + "/");
const unexpected = `const fail = () => { throw new Error("Unrelated dependency invoked"); };
export const embeddedAgentLog = { warn: fail };
export const readCodexNativeSubagentHistoryOwner = fail;
export const codexNativeSubagentRunId = fail;
export const readNativeTaskAssignment = fail;`;
// Isolate unrelated logging/history/assignment APIs. They must not be invoked.
// The string-coercion facade routes to its actual production implementation.
registerHooks({
resolve(specifier, context, next) {
if (specifier === "openclaw/plugin-sdk/string-coerce-runtime") {
return { url: new URL("packages/normalization-core/src/record-coerce.ts", root).href, shortCircuit: true };
}
if (specifier === "openclaw/plugin-sdk/agent-harness-runtime" ||
specifier === "./native-subagent-history-owner.js" ||
specifier === "./native-subagent-task-ids.js") {
return { url: "data:text/javascript," + encodeURIComponent(unexpected), shortCircuit: true };
}
if (specifier.startsWith("./") && specifier.endsWith(".js")) {
return next(specifier.slice(0, -3) + ".ts", context);
}
return next(specifier, context);
},
});
const { CodexNativeSubagentDeliveryReceipts, CodexNativeSubagentReceiptSampling } =
await import(new URL("extensions/codex/src/app-server/native-subagent-delivery-receipts.ts", root));
function fixture() {
const tracker = new CodexNativeSubagentDeliveryReceipts();
const sampling = new CodexNativeSubagentReceiptSampling();
assert.deepEqual(tracker.record("child-run", ["/root/child"], "child result"), []);
const observe = (method, item) => {
sampling.observe({ method, params: { threadId: "parent", turnId: "turn", ...(item ? { item } : {}) } }, [tracker]);
return sampling.consume({ isTurnYielded: () => false });
};
return {
observe,
receipt: () => observe("rawResponseItem/completed", {
type: "agent_message", id: "receipt", author: "/root/child", recipient: "/root",
content: [{ type: "input_text", text: "Message Type: FINAL_ANSWER\nTask name: /root\nSender: /root/child\nPayload:\nchild result" }],
}),
compact: () => {
assert.deepEqual(observe("item/started", { type: "contextCompaction", id: "compact" }), []);
assert.deepEqual(observe("rawResponse/completed"), [], "compaction response must not acknowledge");
assert.deepEqual(observe("item/completed", { type: "contextCompaction", id: "compact" }), []);
},
};
}
test("unsampled pre-compaction receipt is not accepted by a later ordinary completion", () => {
const f = fixture();
assert.deepEqual(f.receipt(), [], "arrival alone must not acknowledge");
// No normal completion acknowledged this receipt before history replacement.
f.compact();
// No new receipt after compaction. The tracker sees only this later completion.
assert.deepEqual(f.observe("rawResponse/completed"), []);
});
test("a fresh post-compaction receipt is accepted after ordinary completion", () => {
const f = fixture();
f.compact();
assert.deepEqual(f.receipt(), [], "arrival alone must not acknowledge");
assert.deepEqual(f.observe("rawResponse/completed"), ["child-run"]);
assert.deepEqual(f.observe("rawResponse/completed"), [], "do not deliver twice");
});Could the existing staging owner invalidate unsampled receipt evidence at the history-replacement boundary while preserving genuinely sampled receipts and new post-compaction receipts? This is not a proposed second receipt mechanism or a claim that the separate resumed-thread raw-event gap is fixed. |
Closes #137710.
Supersedes #137822 by @bounce12340 (Josh Tsai), whose contribution is preserved in the commit co-author credit. This maintainer-owned replacement incorporates the reviewed owner-level repair without squashing rewritten ancestry under the contributor PR.
What Problem This Solves
A native Codex child can finish while its parent yields or tears down. Codex can persist the child's completion message without starting another model response. Treating arrival as consumption suppresses OpenClaw's follow-up and leaves the parent without its promised response.
Why This Change Was Made
The existing delivery-receipt owner now holds receipt captures outside its matching state until the same foreground parent turn completes a subsequent non-compaction model response. An exact bound, non-yielded owner must confirm consumption. Native
waitresults additionally require the matching tool output to be recorded before a later response can confirm consumption: the response that requested an eagerly completed wait cannot consume its own result.Rebased onto
9b4bbdf41a9c10f66b3a243f974d82077840930e. This uses main's immutable assignment, successful V1 submission, and serialized thread-ownership implementations. Delayed acknowledgement of predecessor A does not own or release successor B. Unsampled receipts cannot become acknowledged through a later alias/result/history operation. Foreground turn sampling is released separately from receipt owners retained by child assignments and recovery.User Impact
Evidence
Candidate:
9d4bc16a5370e2088eb1a9f40ada51f2f49f7b2b.Full changed-file gate passed: extension and extension-test typechecks, typed lint, formatting, line/suppression ratchets, export scans, plugin/storage guards, and zero runtime import cycles.
576 tests passed across 23 files in the native-subagent and registered native run-attempt suites on this candidate. Coverage includes successful V1 submissions, warm expiry, recovery, close ownership, rotated parents, native waits, compaction exclusion, yielded/aborted parents, and exact pre-bind ownership.
The seven native follow-up custody cases now record the matching native wait tool output and subsequent model response before expecting delivery. The fixtures also assert delivery remains pending before those boundaries; existing successor-custody assertions are unchanged. This fixes the PR-attributable CI fixture failure without weakening the production sampling gate.
The rebased candidate preserves main’s compact pending-receipt shape and map-replacement restoration. A fresh P0–P2 review passed after conflict resolution, and the committed Git tree exactly matches the validated staged tree.
Local single-worker test batches took 161.93 s (170 tests / 11 files) and 218.95 s (406 tests / 12 files). Hosted CI on the new head is not yet confirmed green.
Registered-runtime reused-child proof covers eight combinations: receipt before/after reuse, successor running/completed, and identical/distinct results. Sampling A leaves B's task and live claim intact; B subsequently produces its own detached completion.
Sampling regression comparison against pinned main: 14 failed / 2 passed before the repair; the production snapshot was restored byte-for-byte afterward. A further four-case eager-wait regression reproduced the review finding before the matching-output gate was added.
Fresh independent P0–P2 review of the repaired candidate: scoped-clean, no accepted/actionable findings. The first review's eager-wait finding was reproduced and fixed before this review.
Direct protocol inspection used Codex
rust-v0.154.0(6b9826e3aa83b1a5947db50f4332cb9c65f1b340): eager wait dispatch, tool-output recording, normal response completion, task-end input persistence, compaction response events, and non-triggering native completion delivery.The changed registered custody suite passed all seven cases, with 30.026 seconds summed test-body time. It exercises the existing registered run-attempt and native follow-up ownership boundary; a receipt-helper test cannot establish this wiring or successor custody. No real-time sleeps, retries, or timeout increases were added. Isolated per-file wall times and new-head hosted CI durations have not been measured.
Reproducible local checks:
Real Gateway/Codex behavior proof remains blocked and merge readiness is not claimed. The configured Testbox credential was rejected as revoked during the previous live attempt; no native child or parent final response was produced. Those captures are setup failure, not before/after proof. The local regression suite does not establish a live yielded-parent continuation, visible final reply, and settled parent. See the recorded proof blocker. The configured credential must be refreshed through the authorized route before repeating that proof; no substitute credential or retention expansion is part of this change.
View the OpenClaw team session