Skip to content

refactor(codex): drop unread private runtime reports - #177689

Merged
steipete merged 2 commits into
mainfrom
deslop/z38-3-unread-codex-reports-20261015
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z38-3-unread-codex-reports-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Codex plugin retains private inventory diagnostics and constructs installation, activation, and transcript-import reports that no production consumer reads.

User Impact

No user-visible change, migration, or required action. Inventory freshness, activation failure handling, signed Computer Use installation and rollback, transcript bounds, and source-reply termination remain unchanged.

Why This Change Was Made

Remove the unread diagnostic map, revision and timestamp copies, unused installation and monitor reports, transcript import counts, and duplicate source-reply result field. Activation retains only its per-config success fact instead of complete results. The authoritative bridge response still receives its termination flag.

Net production reduction: 106 lines (+41/-147), excluding tests/support. Whole patch: +101/-255 across 23 files. No upstream wire, public SDK, config, or persisted shape changes.

Best-effort tradeoffs accepted

  • No authority, concurrency, durability, or failure guard is removed. Only private unread reports and their producers disappear; no new best-effort failure scenario is accepted.
  • Refresh failures retain their warning log and last successful inventory. TTL, scope keys, refresh coalescing, and failed-activation exclusion remain.

Evidence

  • Whole-tree property/caller searches, including public barrels, UI, and protocol consumers; introducing history and open activation work checked.
  • Upstream Codex app/plugin response contracts inspected directly; unchanged.
  • Independent review completed through P2. One termination finding was rejected after tracing the sole caller: the authoritative response is still mutated and returned; only the unread duplicate helper-return field disappears.
  • Focused proof has observed 295 unique cases passing across 18 files: inventory, activation, thread-config/deadline, both source-reply suites, Computer Use, projection, mirror, fork import, and catalog adoption. The initial combined run passed 294 cases and failed the unchanged one-off Computer Use acquisition-deadline case with zero client requests. A single-case head replay repeated it; the pinned base and a subsequent head diagnostic replay passed. The temporary assertion-message diagnostic was removed. No timeout, retry, skip, assertion, or product change was made to chase the result; the cause remains unexplained and passing replay is not a claimed fix.
  • Targeted types rooted at all 22 changed files and explicit-file type-aware lint pass. Formatting passes on 22 files, and the suppression audit passes all 14 cases. Changed-check planning selects the expected extension production/test lanes; broad check-changed/types/builds were not run locally under the campaign CPU budget.
  • Both cycle checks pass: zero runtime-value cycles and zero Madge/static cycles. Exact-head PR CI remains pending.
  • Initial exact-head CI identified one additional stale test consumer: the explicit app-refresh test still read the removed diagnostic. Both failing leaf jobs (types and extension bundle1) pointed to that same assertion. The repair preserves rejection/stale-state proof and asserts the previous successful inventory snapshot remains available. Focused2/2,23-root types, one-file lint/format, suppression14/14 and fresh independent P2 review pass. No runtime code, timeout, retry, skip or guard changed in this repair. The repaired exact-head CI is pending.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 19, 2026 20:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T20:09:50.103640Z 1ee10ad Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ee10ada81

ℹ️ 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".

Comment on lines 47 to 50
export type CodexAppInventoryCacheRead = {
state: CodexAppInventoryReadState;
key: string;
revision: number;
snapshot?: CodexAppInventorySnapshot;
refreshScheduled: boolean;
diagnostic?: CodexAppInventoryCacheDiagnostic;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the remaining diagnostic assertion

When the full Codex app-server test suite runs, the unchanged plugin-app-refresh.test.ts:75 still expects cached.diagnostic?.message to contain the refresh failure. Since this return type and the runtime object now omit diagnostic, that assertion receives undefined and fails deterministically; update this remaining consumer as part of the cache-report cutover.

AGENTS.md reference: AGENTS.md:L80-L82

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes unread private Codex runtime reports and retains only the results its callers use.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, coherent cleanup with no actionable finding; confidence rests on source tracing and in-process coverage while remaining CI completes.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; supplied validation covers inventory, activation, provisioning, transcript imports, and reply termination through tests rather than a shipped-entry-point run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction removes verified unused private state and reports while preserving public contracts and operational behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open as a useful, maintainer-directed simplification; no introduced correctness or security defect was found, and the earlier test-consumer finding is repaired.

Priority: P3
Reviewed head: 54e416554760f1b3ab49fc0e86f7f04519ce3e3d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped Gateway/Codex run is supplied for this refactor; retained coverage exercises production owners through in-process fixtures.
Agent review details

How this fits together

The Codex plugin adapts app-server inventory, plugin activation, Computer Use provisioning, transcript imports, and tool results into OpenClaw thread configuration and session behavior.

flowchart LR
  A[OpenClaw agent turn] --> B[Codex plugin adapter]
  B --> C[Inventory and activation owners]
  C --> D[Codex app server]
  B --> E[Computer Use provisioning]
  B --> F[Transcript mirror]
  F --> G[Session store]
Loading

Technical review

Best possible solution:

Retain the existing runtime owners and guards while deleting their unused private reports.

Do we have a high-confidence way to reproduce the issue?

There is no reported user-facing bug to reproduce; source and caller inspection substantiate the unused-report cleanup.

Is this the best way to solve the issue?

The patch uses the existing owners, preserves operative results and guards, and updates affected test consumers without adding replacement machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0548086d6a95.

Provenance checked

  • Inventory diagnostics and revision reports changes intended behavior with a stated reason (a1ac559: Native plugin support introduced cached inventory reports; fix(codex): preserve payload keys and current inventory diagnostics #162032 later protected diagnostic freshness, while this PR explains their retirement after checking consumers.)
  • Computer Use installation reports keeps the original intent (ee606de: Provisioning supported isolated-home readiness, with signed bundle synchronization subsequently strengthened by fix(codex): refresh stale isolated Computer Use bundles #126080; installation, validation, rollback, and the consumed missing-source outcome remain.)
  • Computer Use monitor reports keeps the original intent (1b6393c: Readiness work added periodic monitoring; its production caller ignores the returned startup report, and cadence, replacement, and close cleanup remain unchanged.)
  • Activation result retention and deferred refresh keeps the original intent (a1ac559: Activation results support app admission; the delayed-inventory repair from fix(codex): expose plugin apps after delayed inventory load #96872 remains, with only per-config success retained for exclusion decisions.)
  • Transcript import counts keeps the original intent (f94a7dc: Supervised sessions import bounded visible history; subsequent projection consolidation preserved that behavior, and removing unused counts changes neither selected messages nor stored rows.)
  • Source-reply termination keeps the original intent (0ed2e0c: Tool-authored replies must end the appropriate turn after settlement; termination remains on the authoritative response and only the unread duplicate helper-return field disappears.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current main: Reviewed the merge-base-to-head hunks rather than endpoint drift; fetched main retains the removed reports, and its corresponding production modules have no intervening changes against this merge base. (54e416554760)
  • Refresh behavior remains owned by the cache: Refresh failures still warn and reject without replacing the successful inventory; expiry, scope keys, targeted merging, and refresh coalescing remain intact. (extensions/codex/src/app-server/app-inventory-cache.ts:185, 54e416554760)
  • Activation and termination retain their operative facts: Thread configuration retains per-config activation success and failed-activation exclusion; the source-reply helper still sets response.terminate, which its sole production caller returns. (extensions/codex/src/app-server/dynamic-tool-source-reply.ts:97, 54e416554760)
  • Earlier review finding repaired: The prior Codex review identified the remaining diagnostic assertion; this head instead verifies rejection, stale state, and preservation of the previous successful snapshot. (extensions/codex/src/app-server/plugin-app-refresh.test.ts:75, 54e416554760)
  • Diagnostic provenance checked: fix(codex): preserve payload keys and current inventory diagnostics #162032 previously protected diagnostic freshness; the current PR explicitly retires those unread reports while preserving warning and rejection behavior. (extensions/codex/src/app-server/app-inventory-cache.ts:185, 8f3aa224b670)
  • Determining Codex dependency contract inspected: The changed cache and activation modules consume Codex app and plugin responses, establishing the dependency signal; personally inspected sibling apps.rs, plugin.rs, and dynamic_tools.rs and verified that the removed fields are OpenClaw-private reports rather than native response fields. (codex-rs/app-server-protocol/src/protocol/v2/apps.rs:60, 092d3acd6bec3e3a14bdc7e7a2810ab628ab759d)

PR surface

Source -107, Tests -47. Total -154 across 23 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 10 44 151 -107
Tests 13 57 104 -47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 101 255 -154

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +41/-147; tests/support +60/-108 The reduction removes unused report construction and storage; changed assertions continue checking operational outcomes.

Labels

Label changes:

  • add P3: This is internal cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 4:33 PM ET / 20:33 UTC.

@steipete
steipete merged commit 1099ccc into main Oct 19, 2026
131 of 133 checks passed
@steipete
steipete deleted the deslop/z38-3-unread-codex-reports-20261015 branch October 19, 2026 21:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 19, 2026
* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...
vincentkoc added a commit that referenced this pull request Oct 19, 2026
#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* refactor(codex): drop unread private runtime reports

* test(codex): assert retained snapshot after refresh failure
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
openclaw#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '4f8617589b6c71d754171052b603fe534901bfa1': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (openclaw#177614)
  fix(release): tag restart plugin cohorts consistently (openclaw#177725)
  refactor(ui): inline single-caller detail requests (openclaw#177705)
  chore(i18n): refresh native locales (openclaw#177721)
  refactor(codex): drop unread private runtime reports (openclaw#177689)
  refactor(ui): consolidate static artwork registries (openclaw#177692)
  refactor(ui): derive settings schema analysis in the view (openclaw#177624)
  refactor(media): consolidate capability defaults and compression grids (openclaw#177665)
  refactor(auth): bind OAuth managers to native provider operations (openclaw#177676)
  refactor(ui): remove redundant component rendering layers (openclaw#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (openclaw#166082)
  fix(agents): report failed secret input prompt delivery (openclaw#177688)
  refactor(ui): share chat message render contracts (openclaw#177668)
  fix(ui): settle model status after overlapping publication (openclaw#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (openclaw#177670)
  refactor(runtime): rely on canonical async lifecycle owners (openclaw#177635)
  refactor: fold private operation helpers into their callers (openclaw#177655)
  refactor(ui): remove unused chat leaf element adapters (openclaw#177582)
  perf(talk): use published authority for foreign voice writes (openclaw#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant