Skip to content

test(agents,codex,config): remove low-value tests (batch d083) - #160309

Merged
steipete merged 12 commits into
mainfrom
tcr/land-d083-1790578399
Sep 28, 2026
Merged

steipete merged 12 commits into
mainfrom
tcr/land-d083-1790578399

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Duplicate scenario matrices, helper-level replays, copied inventories, and repetitive fixtures add maintenance and CI cost across agent tools, embedded attempts, Codex attempts, and config tests.

User Impact

No user-visible or production behavior changes. This batch simplifies the test suite while retaining distinct regression, security, authority, lifecycle, and configuration contracts.

Why This Change Was Made

Replays all ten validated campaign commits onto main, refreshed to 69a2b5094badde281f943a399f1f36807d0acf80 after the initial validation. All applied in order without textual conflicts or skipped commits. Focused validation exposed one semantic replay conflict: t0048 removed GENERIC_NO_CLAIM_ERROR, but a newer retained requester-yield regression still uses it. Restored that existing matcher, preserving the newer regression unchanged. The later rebase was also conflict-free and preserved the batch diff exactly. The max-lines baseline merged automatically and only removes the obsolete agent-tools.schema.test.ts exception. Hosted CI also exposed an inventory-dependent negative-control fixture in test/scripts/ci-node-test-plan.test.ts: pruning files legitimately changes compact packing, so an assumed serial row can disappear. The control now uses an explicit typed already-serial admission with an independently expected policy; its child-pin rejection and the real before/after planner comparisons remain intact. This follow-up is +31/-12 test lines, adds no test declarations, and changes no planner policy. Accepted review feedback also retains the original 18-line ring-zero import-boundary test from main; it is a distinct module-evaluation contract and is no longer changed by this PR.

The final diff touches 99 test files: +6,985 / -24,362 lines, net -17,377 test LOC. Production and shared test-support LOC: +0 / -0. Tooling: one baseline line removed. No matching CODEOWNERS-owned paths are changed.

Shard evidence

Coverage below is the original in-shard before/after evidence, not a fresh combined-branch coverage measurement. Every shard stayed within the 1% covered-statement and covered-branch loss gate, with no excluded groups. Declaration counts count source it/test sites in changed files, including parameterized declarations; executed test cases are reported separately.

Shard Test LOC before → after Declaration sites before → after Executed cases before → after
t0052 4,787 → 3,739 (-1,048) 41 → 31 (-10) 97 → 53
t0046 3,838 → 1,912 (-1,926) 129 → 60 (-69) 178 → 89
t0042 4,498 → 2,247 (-2,251) 87 → 54 (-33) 143 → 69
t0053 4,737 → 3,685 (-1,052) 37 → 25 (-12) 86 → 44
t0063 3,562 → 2,437 (-1,125) 87 → 63 (-24) 139 → 89
t0048 6,128 → 3,528 (-2,600) 196 → 99 (-97) 253 → 111
t0056 2,078 → 1,001 (-1,077) 93 → 42 (-51) 109 → 54
t0043 7,347 → 3,654 (-3,693) 199 → 90 (-109) 226 → 109
t0047 3,465 → 1,732 (-1,733) 106 → 52 (-54) 148 → 71
t0058 1,762 → 851 (-911) 82 → 44 (-38) 106 → 50

Total source declaration reduction: 597 (final landing reduction 596 after retaining the import-boundary test); original shard executed cases 1,485 → 739. Shard LOC totals include their full measured file sets; the source-commit reductions total 17,416 lines; retaining the two-line matcher, the 18-line import-boundary guard, and the 19-line net fixture repair leaves a final reduction of 17,377 lines. Landing adjustments: t0046 is -1,908 test LOC and -68 declaration sites; t0048 is -2,598 test LOC and -97 declaration sites. Other shard deltas are unchanged.

Per-shard changed files and coverage totals

Brace notation lists exact filename suffixes.

  • t0052: extensions/codex/src/app-server/run-attempt.{continuity-media,durable-context,dynamic-tools,final-media,generation-finalization,hooks,input-attachments,media-lifetime,model-attribution,native-background-outcome,native-config}.test.ts
    • covered statements 11266 -> 11239 (-27); branches 8522 -> 8483 (-39); functions 2087 -> 2086 (-1)
  • t0046: src/agents/agent-tools.{memory-flush-writer,model-provider-collision,policy,read.host-operations,read.host-write-integrity,read.windows,read.workspace-mutations,read.workspace-root-guard,read.workspace-root-lazy,runtime,safe-bins}.test.ts
    • Coverage: statements 6,939 → 6,909 (−0.43%); branches 4,210 → 4,168 (−0.998%); functions 1,122 → 1,116. Both groups valid; gate passes.
  • t0042: src/agents/embedded-agent-runner/run/attempt.{model-diagnostic-events,model-diagnostic-lifecycle,model-diagnostic-observation,prompt-helpers,queue-message,sessions-yield,settled-turn-finalization-context,skills-policy}.test.ts
    • Coverage: statements 9,108 → 9,089 (-0.21%); branches 5,436 → 5,415 (-0.39%); functions 1,630 → 1,628. All groups included; no file lost more than four statements.
  • t0053: extensions/codex/src/app-server/run-attempt.{native-followup-custody,native-hook-fallback,native-hook-relay-retention,native-hook-relay,notification-burst,plugin-refresh,protocol-validation,question-refresh,reasoning-effort,receipt,settlement}.test.ts
    • Coverage: statements 11,701 → 11,681 (−0.17%); branches 8,879 → 8,817 (−0.70%); functions 2,231 → 2,228. Gate passed, no excluded groups or source-file statement drop above five.
  • t0063: src/config/io.{audit,best-effort,clobber-snapshot,compat,context.plugin-metadata,cron-owner-refusal,eacces,factory,health-state,load-env-restore,meta}.test.ts
    • Coverage: statements 4,279 → 4,271 (−8, 0.19%); branches 2,715 → 2,701 (−14, 0.52%); functions 781 → 779. No file lost more than three statements.
  • t0048: src/agents/openclaw-tools.{agents,camera,decision,media-factory-plan,media-workspace,nodes-workspace-guard,plugin-context,registration,requester-yield,scheduled-widget,session-context}.test.ts and src/agents/openclaw-tools.browser-plugin.integration.test.ts
    • Coverage: statements 8,604 → 8,566 (−38); branches 6,131 → 6,077 (−54). Both losses below 1%; no excluded groups.
  • t0056: src/config/config.{acp-binding-cutover,agent-concurrency-defaults,backup-rotation,compaction-settings,env-vars,gateway-node-pairing-auto-approve,gateway-node-plugin-tools,gateway-tailscale-bind,hooks-module-paths,hooks-session-mode,identity-avatar}.test.ts
    • Coverage: statements 4,344 → 4,332 (−0.28%); branches 2,430 → 2,411 (−0.78%); functions 776 → 774. Gate passes; no excluded groups or statement drops above five per file.
  • t0043: src/agents/embedded-agent-runner/run/attempt.{spawn-workspace.bootstrap-marker,spawn-workspace.bootstrap-warning,spawn-workspace.cache-ttl,spawn-workspace.context-engine,spawn-workspace.context-injection,spawn-workspace.sessions-spawn,spawn-workspace.timeout,stop-reason-recovery,subagent-runtime-facts,subscription-cleanup}.test.ts and src/agents/embedded-agent-runner/run/attempt.test.ts
    • Coverage: statements 10,244 → 10,212 (−0.31%); branches 6,624 → 6,579 (−0.68%); functions 1,864 → 1,862. Both groups compared; gate passed.
  • t0047: src/agents/agent-tools.{scheduled-exec-target,schema,session-permissions,unicode-read-workspace,workspace-outside,workspace-paths}.test.ts and config/max-lines-baseline.txt
    • Coverage: statements 7,732 → 7,721 (−0.14%); branches 4,664 → 4,658 (−0.13%); functions 1,314 → 1,311. All three groups included; no file lost more than five statements.
  • t0058: src/config/config.{schema-regressions,secrets-schema,skills-entries-config,talk-validation,tools-alsoAllow,web-search-provider}.test.ts
    • covered statements 2136 -> 2134 (-2); branches 1085 -> 1080 (-5); functions 377 -> 377 (0)

Distinct authority, symlink/hardlink/path-escape, rollback, cancellation, redaction, FIFO, generation, and protocol-validation regressions remain. The t0052 report attributes its two six-statement drops to named harness fallback and context-engine projection sibling tests. t0046's branch loss is narrowly within the gate. Some shards deliberately stop short of the aspirational 50% reduction to preserve meaningful contracts.

Evidence

  • Local frozen-lockfile install passed.
  • oxfmt --write <changed TS files>, plain oxlint -c .oxlintrc.json <changed TS files>, and git diff --check <pinned base> passed.
  • Changed-check planning selected core tests, extension tests, and tooling.
  • Fresh Blacksmith Testbox proof verified head 4d53e58b6793e32424ad0dbe3b2e32019f87faeb: CI=1 pnpm install --frozen-lockfile --prefer-offline && CI=1 pnpm test <all 88 surviving changed test files> passed 721 tests with three existing platform skips across seven Vitest groups (329.49s).
  • Final Testbox run, lease tbx_01m3kfz2jz77tfshgdhxs3g2p2.
  • Earlier replay validation caught the missing requester-yield matcher, which was restored and passed its focused rerun. The previous base also contained the unrelated duplicate dataImageClipboardFile definition; incorporated main's existing fix bb05e779e2a through the conflict-free rebase, then reran all focused tests.
  • OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <all 100 changed paths> executed inside the same Testbox with the remote-child marker and passed. This includes 25 core test typecheck groups, extension test typechecking, all dead-export scans, core/extension/scripts type-aware lint, formatting, boundaries, and ratchets. No checks were skipped; temp-directory migration warnings were non-blocking.
  • Final remote command exit 0; 49m42.9s command time for focused tests plus the complete changed gate. The provider's post-run portal-sync warning did not change the successful command result.
  • The first three task-owned Testbox leases were stopped. Earlier runs: tbx_01m3kd4az1xf7eem60mwb4nn1h and tbx_01m3kebwrm7ynf3t8dyt085v3f.
  • The initial hosted run failed two hybrid compact-planner cases in test/scripts/ci-node-test-plan.test.ts (failed job). This was traced to an inventory-dependent negative-control input, not treated as a pre-existing-main exception. Auto-merge was disabled while repairing it.
  • Follow-up CI=1 pnpm test test/scripts/ci-node-test-plan.test.ts: 217 passed. Its targeted check-changed gate also passed, including root-test typechecks, dead exports, and lint.
  • Accepted the distinct ring-zero import-boundary review finding and restored that file byte-for-byte from the base. Final CI=1 pnpm test src/agents/agent-tools.ring-zero-context.import-boundary.test.ts src/agents/agent-tools.runtime.test.ts test/scripts/ci-node-test-plan.test.ts: 233 passed. Both previously failing hybrid cases pass, and the import guard passes.
  • Follow-up Testbox run, lease tbx_01m3knwd64btq7hatdx4an2b55, stopped after proof. The final tested tree ba70d83e0a9b5162ea63075abac58a232f74aa37 was verified against the committed tree.
  • Isolated autoreview completed for the original batch and the planner repair: scoped-clean, no findings at the default P0 threshold. The import-boundary restoration narrows the original diff and directly addresses the accepted P2 review finding. The generic compatibility/migration prompts do not apply to this test-only change.

@clawsweeper

clawsweeper Bot commented Sep 28, 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 enabled auto-merge (squash) September 28, 2026 08:58
@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 Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 6:48 AM ET / 10:48 UTC (Revision 2).

ClawSweeper review

What this changes

The branch consolidates and removes agent-tool, embedded-runner, Codex app-server, and configuration tests, while updating a CI planner fixture and shrinking a max-lines baseline.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep this PR open. Current main still has the larger test suite, and the earlier ring-zero import-boundary finding is resolved. One distinct authorization-origin guard was removed without equivalent producer-side coverage.

Priority: P3
Reviewed head: 59978403da69bdd795e260a73b6569a0737a9070

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The test reduction and follow-up validation are substantial, but one distinct authorization-origin guard is missing.
Proof confidence 🌊 off-meta tidepool Not applicable: The introduced change is tests and a shrinking baseline; the PR reports focused Testbox validation of the retained suites and planner fixture. No production behavior or stored-data contract changes require after-fix runtime proof.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The introduced change is tests and a shrinking baseline; the PR reports focused Testbox validation of the retained suites and planner fixture. No production behavior or stored-data contract changes require after-fix runtime proof.
Evidence reviewed 9 items Introduced coverage deletion: The pinned introduced diff removes tests for missing or forged conversation-read origins resolving to delegated and for a trusted direct-operator origin.
Producer and final-effect path: The plugin-tool context producer normalizes the origin and forwards owner identity; plugin delivery subsequently passes both to message-action dispatch.
Downstream test boundary: The retained channel security test supplies conversationReadOrigin directly to dispatch, so it does not test the agent-to-plugin context producer.
Findings 1 actionable finding [P2] Keep a producer-side plugin-origin authorization guard
Security Needs attention Fail-closed plugin origin loses producer-side coverage: The branch deletes the only focused checks of origin normalization before plugin-tool context passes that value toward message-action dispatch. No current bypass is demonstrated.

How this fits together

OpenClaw assembles agent tools from run and configuration facts, then passes plugin-tool context into message-action checks before a channel effect. These test suites and the CI planner verify that path and related Codex app-server behavior.

flowchart LR
A[Run facts and config] --> B[Agent tool assembly]
B --> C[Plugin tool context]
C --> D[Message action checks]
D --> E[Channel effect]
F[Test suites] --> B
F --> C
F --> D
F --> G[CI result]
Loading

Before merge

  • Keep a producer-side plugin-origin authorization guard (P2) - The deletion removes the checks that missing or forged conversation-read origins become delegated and that a trusted operator origin remains direct-operator. The retained channel security tests inject the origin downstream, so they cannot catch a regression in agent-to-plugin projection. Restore one focused check at tool assembly. This gap was visible at the prior reviewed head; I missed it then.
  • Resolve security concern: Fail-closed plugin origin loses producer-side coverage - The branch deletes the only focused checks of origin normalization before plugin-tool context passes that value toward message-action dispatch. No current bypass is demonstrated.
  • Resolve merge risk (P1) - A later change to agent-to-plugin context projection could misclassify a delegated conversation read as direct-operator without the retained downstream dispatch tests detecting the producer error.
  • Complete next step (P2) - Restore a compact producer-side plugin-origin regression check and validate it with the channel read-policy suite before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P2] Keep a producer-side plugin-origin authorization guard — src/agents/openclaw-tools.plugin-context.test.ts:16-17
  • [medium] Fail-closed plugin origin loses producer-side coverage — src/agents/openclaw-tools.plugin-context.test.ts:16
Agent review details

Security

Needs attention: Production authorization code is unchanged, but removing its producer-side origin tests leaves a concrete security regression gap.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain one origin projection guard (recommended)
    Add a focused registered-tool check for delegated defaults, forged input, and trusted direct-operator origin before merging the test cleanup.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Restore one compact producer-side test for plugin-tool conversation-read origin: missing and forged values must reach plugin tools as delegated, while a trusted direct-operator value stays direct-operator. Include the host-owned sender/owner facts in the same focused boundary check, run that test and the channel read-policy suite, and leave production code and CHANGELOG.md unchanged.

Technical review

Best possible solution:

Keep the consolidated suites while preserving one compact test at agent-tool assembly that checks fail-closed origin projection and trusted operator provenance.

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

Not applicable: this PR removes and consolidates tests. The coverage gap is visible in the pinned diff and surviving test boundaries; no runtime failure is claimed.

Is this the best way to solve the issue?

No. The consolidation is useful and the follow-up repairs address the earlier finding, but the plugin-origin producer still needs a focused guard.

Full review comments:

  • [P2] Keep a producer-side plugin-origin authorization guard — src/agents/openclaw-tools.plugin-context.test.ts:16-17
    The deletion removes the checks that missing or forged conversation-read origins become delegated and that a trusted operator origin remains direct-operator. The retained channel security tests inject the origin downstream, so they cannot catch a regression in agent-to-plugin projection. Restore one focused check at tool assembly. This gap was visible at the prior reviewed head; I missed it then.
    Confidence: 0.85
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.82

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 14f65626bd25.

Labels

Label changes:

  • add merge-risk: 🚨 security-boundary: The removed producer-side tests uniquely checked an authorization origin before it entered plugin message-action handling.

Label justifications:

  • P3: This is test-suite cleanup with no changed production behavior, though one focused guard needs restoration.
  • merge-risk: 🚨 security-boundary: The removed producer-side tests uniquely checked an authorization origin before it entered plugin message-action handling.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The introduced change is tests and a shrinking baseline; the PR reports focused Testbox validation of the retained suites and planner fixture. No production behavior or stored-data contract changes require after-fix runtime proof.

Evidence

Security concerns:

  • [medium] Fail-closed plugin origin loses producer-side coverage — src/agents/openclaw-tools.plugin-context.test.ts:16
    The branch deletes the only focused checks of origin normalization before plugin-tool context passes that value toward message-action dispatch. No current bypass is demonstrated.
    Confidence: 0.82

Acceptance criteria:

  • [P1] CI=1 pnpm test src/agents/openclaw-tools.plugin-context.test.ts src/channels/plugins/message-actions.security.test.ts.
  • [P1] node scripts/check-changed.mjs -- src/agents/openclaw-tools.plugin-context.test.ts.

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Avant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore a compact registered-tool check for fail-closed and trusted plugin-origin projection.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-28T09:01:51.732Z sha 4d53e58 :: blocked before merge. :: [P2] Retain the ring-zero import-boundary guard

@steipete
steipete disabled auto-merge September 28, 2026 09:31
@steipete
steipete enabled auto-merge (squash) September 28, 2026 10:42
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the import-boundary finding in 5997840: the original 18-line ring-zero guard is restored byte-for-byte and is no longer part of the PR diff. It protects a different import boundary from Code Mode. Its focused Testbox run passed with the adjacent runtime suite (16 tests).

The same follow-up repairs the CI planner's inventory-dependent negative-control fixture without changing worker policy or weakening the mutation-rejection assertion. All 217 planner tests passed, including both previously failing hybrid cases, and the targeted changed-file gate passed. The final three-file rerun passed 233 tests. Details and run links are in the updated PR body.

The diff contains only tests and one shrinking max-lines baseline entry. There are no production configuration/default, schema, or persistent-data changes requiring migration proof.

@steipete
steipete merged commit d8e7a8d into main Sep 28, 2026
279 of 281 checks passed
@steipete
steipete deleted the tcr/land-d083-1790578399 branch September 28, 2026 12:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…law#160309)

* test(codex): deslop t0052 tests

* test(agents): deslop t0046 tests

* test(agents): deslop t0042 tests

* test(codex): deslop t0053 tests

* test(config): deslop t0063 tests

* test(agents): deslop t0048 tests

* test(config): deslop t0056 tests

* test(agents): deslop t0043 tests

* test(agents): deslop t0047 tests

* test(config): deslop t0058 tests

* test(agents): retain requester yield regression matcher

* test: retain independent planner and import boundary checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant