Repository navigation
Conversation
Frame final nonempty OpenClaw generic policy with explicit replacement and withdrawal lifetime, preserving body bytes and exactly empty configuration. Keep configured and injected policy identical for native child overrides, and include framing and MCP diagnostics once in prompt reports. Preserve incognito refusal/restoration, native ownership, independent instructions, and unknown-write no-replay behavior. Finite stock-native live comparison observed zero candidate failures across 22 scenarios; this does not guarantee model obedience or rewrite legacy history. Related: #135338. Follow-up to #135577.
|
🦞👀 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. Reviewed October 7, 2026, 10:31 PM ET / October 8, 2026, 02:31 UTC (Revision 2). ClawSweeper reviewWhat this changesThis PR frames nonempty OpenClaw instructions with explicit replacement and withdrawal semantics while keeping native configuration, injected refreshes, and prompt reports consistent. Example: A hook supplies "replacement policy" before resuming a Codex conversation.
Review scores
ProductKind: Bug fix · Worth it: Yes Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR contains distinct, owner-approved work that current main does not implement. No definite defect was found in the pinned patch, but later runtime results leave its replacement reliability unsettled. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex plugin carries OpenClaw instructions into native Codex conversations. It prepares configuration and policy refresh messages before the native runtime sends conversation context to the model. flowchart TD
A[Prompt hook and OpenClaw instructions] --> B[Complete generic policy]
B --> C{Policy empty?}
C -->|No| D[Policy lifetime frame]
C -->|Yes| E[Empty configuration and withdrawal notice]
D --> F[Native configuration and history refresh]
E --> F
F --> G[Codex model request]
Technical reviewBest possible solution: Carry the bounded frame through current policy owners while preserving separate parent-local and refreshable instructions, exact empty withdrawal, native-child replacement, and enforced tool authority. Do we have a high-confidence way to reproduce the issue? No deterministic current-main reproduction is established. Recorded live comparisons expose stale-policy behavior, but model compliance is variable and current main uses a newer Codex runtime. Is this the best way to solve the issue? Unclear: one bounded encoder with configured/injected equality is a coherent solution, but the later warm replacement result must be reconciled against current instruction ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1f891df2c45f. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. Added test files: 6. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +214, Docs +9. Total +242 across 13 files. View PR surface stats
Review metrics
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 (1 earlier review cycle)
|
|
Current-runtime revalidation found mixed results, so I am leaving this PR open for discussion rather than landing the current-main adoption yet. The published head remains unchanged; the adoption described below has not been pushed. The stock 0.155.1 synthetic native tests pass for warm/cold policy refresh, inherited child policy, and explicit child replacement. In the fixed authenticated comparison, stale policy appeared in 8 of 10 control withdrawal cases and 0 of 10 candidate cases. However, the candidate's warm replacement case returned the user-requested marker instead of the current policy marker. Its cold replacement passed, and both replacement controls passed. This finite sample does not establish statistical improvement or prove that the candidate introduced a replacement regression. No ordinary cases were replayed to obtain a cleaner result. Both compaction cases in each arm failed before a compaction request reached the provider. A separate credential-free native diagnostic reproduced the boundary: the normal turn obtains a live model source, but the new standalone compaction turn does not. The native error reports missing owner authority, and the turn fails before forwarding. This executed on the adoption candidate; the implicated owner code matches the separately inspected current-main snapshot. It is a broader host-to-harness authority handoff issue, so it should be repaired separately while preserving the existing denial, cancellation, and cleanup rules. The authenticated recorder also aborted when native stopped reading at The diagnostic intentionally ended with a failing compaction assertion and its owned Testbox was stopped. These are unresolved findings, not a passing current-runtime compaction result. The PR body's earlier results remain evidence for its older head/runtime, not for this unpushed adoption. |
|
Closing this older policy-format experiment. Main already sends explicit replacement and withdrawal notices, and the recorded follow-up results do not establish a reliable benefit for the current instruction lifecycle. Closed in a sweep of stale maintainer PRs (no activity for 7+ days). Reopen with a current reproduction if this still matters. |
Related: #135338. Follow-up to #135577; the native configuration/ownership repair remains intact.
What Problem This Solves
Resolves a reliability problem where ongoing Codex conversations can keep following an earlier OpenClaw generic policy after a prompt hook replaces or withdraws it. The native configuration can already be correctly empty and the withdrawal recorded, yet the model can still return the old policy's requested output because that policy remains in append-only history.
This is an explicitly approved model-visible policy-format change, not a behavior-neutral cleanup or a new authorization boundary.
Why This Change Was Made
Frame the final nonempty OpenClaw generic policy once, identifying its origin and stating that it applies only until a later OpenClaw policy replaces or withdraws it. Preserve the policy body byte-for-byte. Exactly empty configuration remains
"", and its existing separate withdrawal notice is unchanged.The entire nonempty injected refresh equals the native configured string, with the supersession notice inside the frame. Stock Codex V2 child overrides replace the current parent's configured literal string; leaving a notice outside it would leave text surrounding the child override. The common configuration producer covers start/resume/canonical forks; direct supervision probes and side conversations use the same framing. Prompt reports count the frame and MCP diagnostics once, with collaboration instructions kept separate.
No native patch, dependency/config/schema change, history rewriting, new runtime store, or weakening of ownership, incognito refusal/recovery, or unknown-write handling. Independent native managed/project/guardian/security/collaboration/child-role instructions retain their own authority.
User Impact
New OpenClaw policies carry explicit replacement/withdrawal semantics, reducing ambiguity when older policy text remains in a conversation. This does not retroactively label legacy history, erase historical policies, guarantee model obedience, or replace enforced tool/approval boundaries. The fixed added overhead is 631 UTF-8 bytes, below the frozen 768-byte budget; empty policy adds no frame.
Production LOC: +36/−17 (net +19). Tests: +475/−261 (net +214). Docs: +9. Production growth implements one encoder and consistent final-policy/report composition, without a parallel lifecycle path.
Evidence
Fixed-count live comparison
Both cohorts used the same OpenClaw base
8c7e36560d11d3ed211e2aca254efd33e34cdcb0, stock Codex 0.153.4, public model gpt-5.6-luna, provider name exactly OpenAI, recorder hashes, and predefined scenario order. Each contained 22 scenarios and 52 HTTP-200 requests.The candidate had zero behavioral failures across all 22 scenarios. Native delivery/configuration, metadata, ownership, incognito refusal/restoration, and execution checks passed in both cohorts. Every cohort closed/exited all 31 native clients, closed both relay servers, and joined its composition process with no outstanding native PIDs.
This is finite, sequential evidence—not statistically established improvement or deterministic obedience. The candidate text was frozen before comparison; no prompt tuning or extra cohort was used to obtain green model results. An earlier 53-request control is retained separately with three marker failures; it exposed recorder response-tail handling and an obsolete contention-fixture assumption and is not pooled with the corrected comparison. Seven local recorder regressions verified the correction before the paired run. Synthetic ordered captures and source identities are retained locally; no operator conversation or credential is included in this PR.
Stock native binary SHA-256:
b973d440acac501fd2594a43e7ca9ce41e0a65b9dfb28d0d7a7837c99e1261e3. Exact native source inspected at3d2ee51ca2d5db578f328aa75e20aa22c0197c9a, including generic fragment serialization and current-parent replacement in native child forks. Content-kind metadata is enabled by default; non-OpenAI provider-name filtering is a separate behavior, not the explanation claimed here.Native child and local validation
node scripts/check-changed.mjspassed, including extension/root-test types and lint, import cycles, and runtime guards.pnpm buildpassed, including declarations, SDK exports, plugin runtime/assets, and Control UI output. Only nonblocking upstream eval, browser-externalization, and timing advisories were emitted.Static/build proof used an independently installed, byte-identical checkout outside the parent repository's dependency tree. The nested worktree's compiler consulted outer package manifests despite its own frozen install; no containment guard, dependency, or baseline was weakened. That tooling issue is separate from this PR.
The final validated tracked diff SHA-256 is
475d4c4f71d403894a9c6868d3218136cde038b93a85779f92f182804c2edb74. The six-file production diff remained unchanged after live proof:188d03447029dfabb6cf0aaf9b0290a4d646e9261829cf919b2f3cde0a0261ca.Documentation: https://docs.openclaw.ai/plugins/codex-harness-runtime#hook-boundaries