Skip to content

refactor: remove unused durable agent-run diagnostics - #177694

Merged
steipete merged 3 commits into
mainfrom
deslop/z39-2-run-diagnostics-20261015
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
deslop/z39-2-run-diagnostics-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agent runs write two separate diagnostic histories that no production reader consumes, along with their workers, queues, retries, and shutdown bookkeeping.

User Impact

No change to parent progress, stall/failure/completion notices, message-tool-only delivery, transcripts, or the in-memory session backend. New runs stop accumulating ACP parent-stream diagnostics and durable message-tool outcome rows. Existing tables, rows, archive handling, and schema compatibility remain unchanged; no migration or operator action is required.

Why This Change Was Made

Remove the ACP diagnostic recorder and the durable message-tool outcome adapter, their workers/registrations, and orphaned implementation helpers/tests. Keep the entire in-memory outcome route and all memory-backend operations/contracts/tests. The remaining recorder reports whether it actually recorded an outcome so the caller does not log false durable success.

The source reference audit found only producers, pruning, schema metadata, and historical archive/copy/delete handling—not a semantic reader. #109427 explicitly describes ACP diagnostics as rebuildable with no importer. #124830 calls message-tool outcomes “pure diagnostic collection feeding a future default-flip decision,” with no runtime impact. No open activation reader or human-filed incident requiring these diagnostic writes was found. The public parent-stream feature from #34310 is retained.

Production: 594 net lines removed (+35/-629), excluding tests, fixtures, support, generated files, and declarations. Tests/support: 594 net lines removed, exclusively persistence-mechanism coverage; historical ACP cascade assertions move into the existing migration suite, and delivery/archive/memory behavior keeps its coverage.

Best-effort tradeoffs accepted

  • ACP diagnostic store capture, environment copies, physical-store binding, and write admission previously protected delayed diagnostic writes against store replacement. The history describes rebuildable diagnostics (refactor: move non-session runtime journals to SQLite #109427), not a human-reported durability incident. With no diagnostic write, there is no delayed target to validate; actual transcript and effect authority remain unchanged.
  • ACP serialization guards, batching, bounded retry/backoff, rollback-versus-unknown classification, and warning bookkeeping existed only to retain this unconsumed stream. A diagnostic row is no longer recorded; actual progress still uses the existing session-event handoff.
  • ACP persistence settlement and Gateway release claims covered pending diagnostic batches. refactor(acp): persist parent-stream diagnostic batches through the agent writer #164454 cites synthetic shutdown/batch proof, not a human-filed incident. The relay now only removes its timers/listeners; actual write-capable work settlement is untouched.
  • Durable message-tool outcomes previously captured discovery custody, prepared/revalidated the database target, admitted a worker transaction, transported errors, and joined cleanup. The original purpose was future diagnostic analysis (feat(auto-reply): record message-tool mute outcomes #124830), not delivery or authorization. These writes no longer occur; the protected memory route still records its existing side data.
  • The durable outcome SQL kernel, per-write pruning, and lazy additive-table installer have no remaining writer. Existing canonical tables, compatibility metadata, and historical rows remain; no schema, retention setting, or persisted shape changes.

Evidence

  • Parent progress relay: 23/23 tests passed (33.87s wrapper).
  • Historical ACP archive preservation: 3/3 targeted cases passed (184.59s wrapper; predominantly cold worker compilation; 16 unrelated cases filtered, no committed skips).
  • Unchanged memory side-effects suite: 10/10 passed (56.77s wrapper), including outcome publication failure, closed-session rejection, and bounded outcome ordering.
  • Late outcome metadata cannot recreate a missing incognito session: 1/1 passed (100.54s wrapper).
  • Auto-reply execution lifecycle and message-tool behavior: 24/24 passed (245.99s wrapper).
  • Historical storage migration/cascade suite: 3/3 passed (74.24s wrapper).
  • Targeted typecheck passed using five touched entry roots and production declarations; no whole-core source glob.
  • Formatting passed on the 10 remaining changed source/script files.
  • Independent isolated review: scoped-clean at P0–P2; no actionable findings.
  • Runtime manifest/package, lint-suppression and native PR import-closure tests: 18/18 passed.
  • Focused source and script lint passed. The fixture lint finding was an unnecessary await of the synchronous transaction owner; removed it without changing the fixture contract.
  • Runtime import graph: zero value cycles; static/madge graph: zero cycles.
  • Worker inventory regenerated through its generator. The latest conflict-only rebase preserves main's refreshed snapshot; the generated delta is 12 lines and excluded from production LOC.
  • Initial exact-head CI caught one stale mock-export baseline entry for the deleted recorder mock. Removed that entry; the exact mock-export ratchet replay passes (8,212 factories), suppression tests pass 14/14, and fresh correction review is scoped-clean. No production change or CI rerun.
  • Follow-up review found two deleted tests still listed in Vitest routing and the removed message-outcome worker still named in worker-only classification. Removed those three obsolete registrations. Focused registry, test-project routing, and lint-suppression checks pass 291/291; independent correction review is scoped-clean at P0–P2. No runtime or type/import graph changed.

Local proof runs serially with one Vitest worker, lowered CPU priority, and task-owned HOME/config/state/XDG paths. Exact-head PR CI is the broad proof; no live Gateway or personal state was touched.

Collision notes: optional recorder-only ACP input attributes remain temporarily because #122849 owns the spawn caller. The overlapping narrative worker-access documentation is deferred. Inventory changes are shrink-only generated metadata and removal of the stale worker-only classification for the worker deleted here; no retained worker classification changes.

Current-head hosted proof

Head 58c3c3e39353d83768c0f21ba20a161eda1214aa: CI 39337040997, attempt 1, completed successfully. Native completed-hosted verification also passed for that exact head, including build-artifact and workflow-sanity proof. No CI rerun or push for green.

All 154 check runs were enumerated: 90 successful, 61 skipped, one neutral, and two superseded metadata cancellations. Neither cancellation is missing behavioral proof: PR-context job 118349013716 is replaced by successful same-head 118349027208; dispatch 118349012439 is replaced by successful same-head 118349028102. No failed, timed-out, or action-required job remains. Skipped checks are not claimed as executed. Current dependency and security review statuses are successful.

Prior-head inherited CI failures (superseded by conflict-only rebase)

The native inherited-failure attempt below sent no merge request: main advanced during admission, and GitHub reported a conflict in the generated worker inventory. That inventory was regenerated on main 9417a7224806920a1b7233ca1e9c6e478d51870f. New head 51e4cb67a68f4d79dfcf579b597641f5f52b2e34 is patch-identical outside the generated inventory. Frozen installation and targeted types passed again; current-head CI is required separately. The following table is historical attribution, not a claim about the new head's checks.

Exact head bee4f589d95415dbe03f27fd051e0ee1716252e3, CI 39323283032, attempt 1, completed with two inherited leaf failures and their downstream gate. All selected behavioral jobs passed; security-fast passed. The 141-check census contains 81 successes, 55 skipped checks, one neutral, three failures below, and one superseded metadata cancellation with a successful same-head replacement. Skipped checks are not claimed as executed.

Failing job Failure Main evidence
check-lint-core-1 Untouched local-http-probe.test.ts:178:53: rejection reason must be an Error. Identical rule, message and location in scheduled main job 118292687840.
check-test-types-core-4 Same untouched test: missing createDeferredCore import at line 154; consequent implicit-any parameter at line 178. Both diagnostics match scheduled main job 118292687907; the automated failure table also reports matching signatures.
openclaw/ci-gate Downstream aggregate of those two roots. Its completed gate log names only the lint and test-type stripes.

Preflight identifies tested merge 7c7fe0c9fd919edb4fc6f406e2f0776ed94fd93d with ordered parents 34f6f1ba01cec96639031a47e736849b14bc072a and the prior PR head. The failing file is byte-identical on scheduled main, that baseline, the prior PR head, and the tested merge. Main repair b6bd9e8bd0cad400b31a223a0c44f8494f5cfb87 already restores the import. Lint's automated classification was unknown because extraction was incomplete; the independently inspected matching main diagnostic resolves it. No changed files were dropped and no CI rerun was requested. The later rebase was solely for GitHub's reported conflict, not to obtain green. Any landing exception must qualify its own exact head; failed CI is not relabeled green.

@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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 19, 2026
@steipete
steipete marked this pull request as ready for review October 19, 2026 20:08
@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-19T22:47:17.212763Z 58c3c3e New commits
ℹ️ 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 durable ACP parent-stream and message-tool outcome recording while preserving parent notifications, incognito outcomes, and historical data handling.

Example: An ACP child named main streams progress and completes run-1.

  • Before: The parent receives progress and completion notices, and diagnostic events accumulate in acp_parent_stream_events.
  • After: The parent receives the same notices without new diagnostic rows.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused cleanup with resolved prior findings and supporting integration tests; evidence does not establish a shipped-entry-point run.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored cleanup is outside the ordinary contributor proof gate; supplied validation covers relay behavior, real storage/archive handling, memory outcomes, and lifecycle consumers through tests, with no live Gateway run claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Agent runs incur durable diagnostic writes and lifecycle machinery without a production consumer.
Reason: The maintainer-authored direction explicitly accepts ending diagnostic collection, and the source audit supports preserving the actual delivery and historical-data boundaries.

Merge readiness

✅ Ready for maintainer review

This maintainer-authored PR is a coherent cleanup of unused diagnostic writers; the prior findings are fixed, no new blocking defect was found, and current-head CI remains pending.

Priority: P3
Reviewed head: 58c3c3e39353d83768c0f21ba20a161eda1214aa

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent events feed the ACP parent relay, and completed turns feed outcome bookkeeping; parent notifications continue through session-event delivery, while incognito outcomes remain with the memory actor.

flowchart LR
  A[ACP child events] --> B[Parent stream relay]
  B --> C[Session event delivery]
  D[Completed agent turn] --> E[Outcome adapter]
  E --> F[Incognito memory actor]
Loading

Technical review

Best possible solution:

Remove the unused durable producers and their machinery while retaining existing delivery owners, memory outcomes, and historical storage contracts.

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

This is a cleanup rather than a bug report; source inspection confirms the durable producers exist on main and their semantic readers are absent from the audited references.

Is this the best way to solve the issue?

The patch follows the existing owners and removes the unused paths completely; retained schema metadata and historical-data handling have concrete compatibility purposes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e7f4d345645.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -594, Tests -596, Docs -2, Other -4. Total -1196 across 22 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 9 35 629 -594
Tests 9 28 624 -596
Docs 1 5 7 -2
Config 0 0 0 0
Generated 0 0 0 0
Other 3 0 4 -4
Total 22 68 1264 -1196

Review metrics

Metric Value Why it matters
Production versus test reduction Production +35/-629; tests/support +28/-622 The reduction removes unused persistence machinery and its mechanism-specific coverage while preserving delivery, memory, and historical-data contracts.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is an internal cleanup with no demonstrated user-facing failure requiring urgent repair.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-19T20:26:08.009Z sha 6f5557c :: needs changes before merge. :: [P2] Prune the baseline entry for the removed recorder mock

Reviewed October 19, 2026, 7:00 PM ET / 23:00 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

Merge-order hold: please wait for #174599 (R10 PR1b, Postgres local credential store) to merge before landing this PR.

The two PRs overlap on four files:

  • config/test-mock-exports-baseline.txt
  • docs/reference/database-schemas/worker-access-inventory.md
  • scripts/check-export-name-collisions.mts
  • src/infra/runtime-process-manifest.ts

#174599 has lost several roughly 1.5-hour exact-head CI windows to main drift at merge time. It is now finishing a conflict reconciliation and will start a fresh CI run. After it merges, rebase this PR and regenerate the shared baselines/inventory. Thanks!

@steipete
steipete force-pushed the deslop/z39-2-run-diagnostics-20261015 branch from 0bb09aa to bee4f58 Compare October 19, 2026 20:54

@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: bee4f589d9

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

@steipete

Copy link
Copy Markdown
Contributor Author

PR177694 exact-head inherited CI evidence

Head: bee4f589d95415dbe03f27fd051e0ee1716252e3. CI39323283032, attempt1, completed failure. No CI rerun. Security-fast118303276037 passed.

Actual checkout

Preflight job118302539656 log:

2026-10-19T20:55:47.3812964Z HEAD is now at 7c7fe0c9f Merge bee4f589d95415dbe03f27fd051e0ee1716252e3 into 34f6f1b
2026-10-19T20:55:47.8735536Z CHECKOUT_SHA: 7c7fe0c9fd919edb4fc6f406e2f0776ed94fd93d

Run API independently records PR177694, headbee4f589, base34f6f1ba. The exact merge object was fetched and its ordered parents verified. Prior scheduled main0548086 is an ancestor of34f6f1ba. The raw prior-main-to-head delta includes forward-main differences; the actual tested merge retains those main changes and contains the reviewed PR cut.

Every failed leaf job

PR job Actual failure Scheduled main proof
check-lint-core-1 /118303705079 src/gateway/local-http-probe.test.ts:178:53 typescript/prefer-promise-reject-errors: Expected the Promise rejection reason to be an Error. Main39320267109 /118292687840 emits the identical rule, message, file, line and column. Other diagnostics in the retained oxlint leaf are max-lines warnings, not errors.
check-test-types-core-4 /118303704993 src/gateway/local-http-probe.test.ts(154,25) TS2304 Cannot find name createDeferredCore; (178,34) TS7006 Parameter error implicitly has any type. Main39320267109 /118292687907 emits both identical diagnostics in tsconfig.core.test.gateway-root.json.

Failed file blob is cb50eabba3e6638baad1a3860e8f602449757f75 on the scheduled-main head0548086, PR headbee4f589, actual merge baseline34f6f1ba and tested merge7c7fe0c9. It is absent from all19 changed PR paths. This is deterministic source failure, not a load-only timeout or a speculative import-graph inference.

The automated failure table marks types pre-existing with matching signatures. It marks lint unknown because signature extraction was incomplete; the independently inspected main and PR lint diagnostic above settles that attribution.

Aggregate openclaw/ci-gate118323162337 failed solely on check-lint-hosted-core-shard and check-test-types-hosted-core-shard, corresponding to these two roots. The older cancelled PR-context job118302525141 has successful same-head replacement118302641835; it is superseded metadata, not missing behavioral proof.

Main repair b6bd9e8 restores the deferred import and is an ancestor of current origin/main. No changed path or assertion was dropped and no rebase was performed for inherited failures.

The coordinator main-flake ledger and latest six completed scheduled main runs were inspected before attribution:39320267109,39311481040,39304330137,39294792872,39286736487,39278710829. Attribution uses exact matching scheduled-main job logs, not a generic flake label. Each failed PR/main job log and the preflight/gate log was retrieved once via the completed-job API; initial gh run view attempts returned logs-unavailable while the workflow was in progress and fetched no log.

@steipete

Copy link
Copy Markdown
Contributor Author

Merge-order hold lifted: #174599 merged as 8f62210. This PR can proceed; rebase onto main and regenerate the shared baselines/inventory for the four overlapping files.

@steipete
steipete force-pushed the deslop/z39-2-run-diagnostics-20261015 branch from bee4f58 to 51e4cb6 Compare October 19, 2026 21:53

@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: 51e4cb67a6

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

@steipete
steipete enabled auto-merge (squash) October 19, 2026 22:05
@steipete
steipete disabled auto-merge October 19, 2026 22:34
@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the obsolete registrations in 58c3c3e39353d83768c0f21ba20a161eda1214aa: both deleted tests are removed from their authoritative routing lists, and the deleted message-outcome worker is removed from worker-only classification.

Focused registry, test-project routing and lint-suppression checks passed 291/291. Syntax, focused scripts lint, formatting and independent isolated correction review passed. Runtime code and its 594-net-line reduction are unchanged; current-head PR CI remains the broad gate.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@steipete
steipete merged commit a651938 into main Oct 19, 2026
164 of 166 checks passed
@steipete
steipete deleted the deslop/z39-2-run-diagnostics-20261015 branch October 19, 2026 23:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* refactor: remove unused durable agent-run diagnostics

* test: prune removed ACP recorder mock baseline

* test: remove retired diagnostics registrations
steipete added a commit that referenced this pull request Oct 22, 2026
Remove redundant observation and audit forwarding paths and the obsolete message-tool-outcome schema module. Preserve synchronous warm dispatch, cold input capture before recovery, receiver binding, no-replay behavior, and the existing audit writer ownership. SQL, transactions, schemas, request counts, public SDK surfaces and effect-authority checks are unchanged.

Production +22/-45 (net -23); total net -25. Direct commands allocate one fewer adapter and forwarding closure; no timing claim.

Validation: focused schema, audit, Workboard/observation and wrapper-inventory tests; type-aware lint, types, source/architecture guards, Knip/Madge and database ratchets. All three exact-head PostgreSQL conformance shards passed. The CI owner-selection assertion introduced on newer main by #180844 reproduces identically on main dfe0396; recorded for main repair. Independent component reviews and exact-head coordinator/PostgreSQL review approved the change.

Source provenance: #170138, #165561 and #177694 (Peter Steinberger).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…w#180928)

Remove redundant observation and audit forwarding paths and the obsolete message-tool-outcome schema module. Preserve synchronous warm dispatch, cold input capture before recovery, receiver binding, no-replay behavior, and the existing audit writer ownership. SQL, transactions, schemas, request counts, public SDK surfaces and effect-authority checks are unchanged.

Production +22/-45 (net -23); total net -25. Direct commands allocate one fewer adapter and forwarding closure; no timing claim.

Validation: focused schema, audit, Workboard/observation and wrapper-inventory tests; type-aware lint, types, source/architecture guards, Knip/Madge and database ratchets. All three exact-head PostgreSQL conformance shards passed. The CI owner-selection assertion introduced on newer main by openclaw#180844 reproduces identically on main d41e3f8; recorded for main repair. Independent component reviews and exact-head coordinator/PostgreSQL review approved the change.

Source provenance: openclaw#170138, openclaw#165561 and openclaw#177694 (Peter Steinberger).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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