Repository navigation
test(gateway,agents,infra,sessions): remove low-value tests (batch d081) - #160205
Conversation
Port t0002 onto the campaign lane, retaining the two newer default-token identity tests and their suite-owned home directories unchanged. Preserve the lane assertion baseline while applying the shard fixture cleanup and intended test consolidations. Validation: 104 tests across six files passed on Blacksmith Testbox with zero skips (79.95s); oxlint exited 0; oxfmt and diff checks passed; independent P2 review was clean. The first source sync timed out before tests; the unchanged retry passed without timeout increases.
|
Codex review: needs changes before merge. Reviewed September 28, 2026, 2:41 AM ET / 06:41 UTC. ClawSweeper reviewWhat this changesConsolidates Gateway, agent, session, and migration tests and lowers three assertion-safety baseline counts without changing production code. Merge readiness⛔ Needs changes before merge - 4 items remain Keep this useful consolidation open: three distinct exec and Doctor migration regression checks were removed without equivalent surviving coverage. Priority: P3 Review scores
Verification
How this fits togetherThese suites exercise OpenClaw's exec tool, Gateway, session store, and Doctor migrations. CI uses their assertions to detect regressions in those production paths. flowchart LR
Behavior[Production behavior] --> Suites[Consolidated test suites]
Fixtures[Commands and legacy state] --> Suites
Suites --> Assertions{Contracts retained?}
Assertions -->|Yes| CI[CI results]
Assertions -->|No| Gaps[Missed regressions]
CI --> Signal[Maintainer signal]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -352, Tests -6220, Other 0. Total -6572 across 70 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the smaller suites while restoring focused settled-exec, canonical-conflict, and orphan-alias assertions at their existing test owners. Do we have a high-confidence way to reproduce the issue? Yes. The pinned diff removes the named assertions, and surviving tests do not exercise those specific paths; this read-only review did not run tests. Is this the best way to solve the issue? No. The consolidation is useful, but these independent lifecycle and migration contracts need focused keeper tests before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf6899819d15. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…81) (openclaw#160205) * test(gateway): deslop t0004 tests * test(gateway): deslop t0003 tests * test(infra): deslop t0020 tests * test(exec): deslop t0027 tests * test(agents): deslop t0035 tests * test(sessions): deslop t0016 tests * test(infra): deslop t0024 tests * test(agents): deslop t0030 tests * test(agents): deslop t0031 tests * test(gateway): deslop t0002 tests Port t0002 onto the campaign lane, retaining the two newer default-token identity tests and their suite-owned home directories unchanged. Preserve the lane assertion baseline while applying the shard fixture cleanup and intended test consolidations. Validation: 104 tests across six files passed on Blacksmith Testbox with zero skips (79.95s); oxlint exited 0; oxfmt and diff checks passed; independent P2 review was clean. The first source sync timed out before tests; the unchanged retry passed without timeout increases. * test: retain batch contracts and repair replay fixtures
Block 4 of the presentation cut: the message_end delivered-ledger reconciliation, Responses multi-item delivery, the block-reply delivery generation fence on compaction retry, and failed-block-reply retry. None of it is needed by continuation: with continuation deleted, every hunk would still be there. b875d57 records that upstream's own message_end reconciliation (openclaw#146361) already runs first, and the generation bump keys on any compaction_end.willRetry, not only volitional compaction. HOME: its own PR (ledger reconciliation + delivery generation/retry). Restored to upstream b51feb9 bytes: embedded-agent-subscribe.ts, handlers.ts, handlers.lifecycle.ts, handlers.types.ts, handlers.tools.start.ts, handlers.tools.progress.ts, handlers.messages.replies.ts, reply-delivery.ts, run-state.ts, sanitize-user-facing-text.ts and their test fixtures/expectations. Deleted fork-only files: handlers.messages.final-reconciliation.ts, compaction-retry.ts, and the line-cap splits that only existed for the ledger growth (logger.ts, reply-text.ts, reply-delivery.serial.ts, reply-delivery.types.ts, stream-block-tags.ts); the ledger tests block-reply-rejections.test.ts (upstream deleted it in openclaw#160205), handlers.lifecycle.deferred-replies.test.ts (+ test-support) and continuation-reconciliation.test.ts (no continuation input in any case). What stayed (continuation): stripContinuationSignalFromDisplayText on the message_end parsed text and on emitBlockChunk chunks; the commentary deltaBuffer accumulation across all transports so markers can span deltas; the two Responses marker-hiding cases in continuation-responses.test.ts. Untouched here: snapshot.ts and messages.stream.ts strip hunks, compaction attribution (other block). blockCoverageSourceText is re-grafted onto the upstream emit path so #1373 can leave in its own commit. Refs #1418 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings the branch onto current main; GitHub reported it CONFLICTING. - media-reference.ts: openclaw#158720 moved parseInboundMediaUri, MediaReferenceError and normalizeMediaReferenceSource into inbound-media-uri.ts. The raw-authority check that rejects port and userinfo forms moved with them; media-reference.ts keeps the grounding exports and re-exports the parser as main does. - embedded-agent-tool-media.ts: main now collects structured media into a Set. The candidate caps, acceptMediaUrl and hadCandidate apply to that Set (size in place of length); recordToolResultLocalMediaReplayAuthorization and filterPersistedToolResultMediaUrls are unchanged. - session-tool-result-guard-wrapper.ts: main's GuardedSessionManager type and preparedUserTurn handoff, plus setTrustedLocalMediaToolNames. - session-accessor.sqlite-active-events.ts: main moved the page types to session-accessor.sqlite-projection-read.ts, which session-accessor.ts now re-exports them from. The snapshot row type joins them there, and readSessionTranscriptConversationSnapshot imports DEFAULT_VISIBLE_MESSAGE_MAX_MESSAGES from the visible-cursor module. - attempt-session-runtime-prepare.test.ts: both fixture fields kept. - embedded-agent-subscribe.tools.media.test.ts: main deleted the file in its low-value test batches (openclaw#158721, openclaw#160205, openclaw#166619). Only this branch's own tests are kept: the candidate bounds, the legacy details.path acceptMediaUrl check, and the persisted replay authority cases.
What Problem This Solves
Redundant test variants and repeated fixtures make Gateway, agent, session, and migration tests more expensive to maintain without adding independent behavioral coverage.
User Impact
No production behavior changes. This batch removes or consolidates overlapping tests while retaining security, authority, migration, cleanup, rollback, and delivery regressions at their owning boundaries.
Why This Change Was Made
Replays the ten reviewed campaign shards in batch d081 onto main. All ten commits applied; none were skipped. Replay had no conflicts. After validation, the config-patch suite and its shared helper were retained unchanged from main because the consolidated execution order exposed an unresolved timing failure. Review also restored the distinct multi-agent migration case and four focused schema, delivery, and authentication contracts. Current-main additions were preserved. Replay type repairs use the canonical session runtime scope and the seed helper result type. Two metadata tests explicitly pre-pair their test device through the existing fixture helper after a diagnostic run exposed an implicit pairing dependency. The auth fixture gives each SQLite identity its own directory and closes its state handle before cleanup; the assertion-safety baseline shrinks exactly three existing counts.
Production LOC: +0 / -0. Tests and suites: +7,511 / -19,972 (net -12,461). Test support: +20 / -45 (net -25). Baseline metadata: +3 / -3, with three count reductions. Total test/support reduction: 12,486 lines across 267 fewer lexical test declaration sites. Declaration sites count line-start
it/testcalls, including parameterized declarations; they are not expanded test-case counts.No changed paths match the current CODEOWNERS entries.
Evidence
oxfmt --write, plainoxlint -c .oxlintrc.jsonon changed TypeScript, andgit diff --check: passed.702e9f7e115a8f893b9f1f665347b02799730812exactly matches the committed tree. Testbox run, leasetbx_01m3k8c0y4kdkjekdrzb3e6rw4, stopped.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <changed paths>: all core-test typechecks (including the repaired session shard), root-test types, repository guards, dead-export checks, and preceding lint stripes passed. It stopped on the untouchedui/src/pages/chat/components/chat-attachments.tsmax-lines violation (716 vs 700), reproduced from the exact main-base blob using plain Oxlint. Current main fixes it in2e95cdba84c2b7f697123aa0561da3e454605d7e(fix(ci): keep chat attachment controls within lint limit #160159). Later lint stages were not reached. Changed-gate run, leasetbx_01m3k9cnkchdq7bsgq6n45bznz, stopped automatically. Hosted CI evaluates the merge with current main.agent-tools.schema.test.ts. No accepted/actionable finding remains.The shard coverage results below are the original in-shard before/after measurements, not a newly aggregated coverage measurement on current main. All statement and branch drops are below 1%. t0016 uses the final repair comparison, which restored SQL/consumer failure, raw-delta, rollback, preparation-failure, and revocation cases. t0002 coverage also includes instrumented suite bodies, so these totals should not be interpreted as unique production coverage.
Per-shard replay size and campaign coverage
LOC and declaration deltas use only files actually touched by each replay commit. Campaign report test counts can include unchanged shard inputs and expanded parameter rows.
t0004 files:
src/gateway/server.config-policy-response.test.ts,src/gateway/server.config-security-policy.test.ts,src/gateway/server.context-prewarm.remote-proof.test.ts,src/gateway/server.cron.test.ts,src/gateway/server.device-pair-approve-authz.test.ts,src/gateway/server.device-pair-approve-supersede.test.ts,src/gateway/server.device-scope-upgrade.test.ts,src/gateway/server.device-token-rotate-authz.test.tst0003 files:
src/gateway/server.channels.test.ts,src/gateway/server.chat-abort-dispatch-rejection.test.ts,src/gateway/server.chat-abort-sibling-fanout.test.ts,src/gateway/server.chat-adopted-failure.test.ts,src/gateway/server.chat-goal.test.ts,src/gateway/server.chat-history-cursor.test.ts,src/gateway/server.chat-queued-followup.test.ts,src/gateway/server.chat.acp-completion.test.ts,src/gateway/server.chat.gateway-server-chat-b.test.ts,src/gateway/server.chat.gateway-server-chat.test.tst0020 files:
src/infra/state-migrations.channel-pairing.test.ts,src/infra/state-migrations.commitments.test.ts,src/infra/state-migrations.config-machine-state.test.ts,src/infra/state-migrations.cron-run-logs.test.ts,src/infra/state-migrations.device-auth.test.ts,src/infra/state-migrations.device-identity.test.ts,src/infra/state-migrations.exec-approvals.test.ts,src/infra/state-migrations.fs.test.ts,src/infra/state-migrations.legacy-json.test.ts,src/infra/state-migrations.legacy-session-store.test.ts,src/infra/state-migrations.managed-outgoing-images.test.tst0027 files:
src/agents/bash-tools.exec-target.test.ts,src/agents/bash-tools.exec-timeout-seconds.test.ts,src/agents/bash-tools.exec-workdir.test.tst0035 files:
src/agents/embedded-agent-subscribe.tools.extract.test.ts,src/agents/embedded-agent-subscribe.tools.media.test.ts,src/agents/embedded-agent-subscribe.tools.reconcile-thread.test.ts,src/agents/embedded-agent-subscribe.tools.test.tst0016 files:
src/config/sessions/session-accessor.sqlite-archive.byte-limit.test.ts,src/config/sessions/session-accessor.sqlite-archive.worker.test.ts,src/config/sessions/session-accessor.sqlite-bounded-context.test.ts,src/config/sessions/session-accessor.sqlite-byte-size.test.ts,src/config/sessions/session-accessor.sqlite-cap-archive.test.ts,src/config/sessions/session-accessor.sqlite-cleanup-race.test.ts,src/config/sessions/session-accessor.sqlite-cleanup-reclamation.test.ts,src/config/sessions/session-accessor.sqlite-context-accounting.test.ts,src/config/sessions/session-accessor.sqlite-data-version.test.ts,src/config/sessions/session-accessor.sqlite-deletion.test.ts,src/config/sessions/session-accessor.sqlite-entry-admission.test.ts,src/config/sessions/session-accessor.sqlite-excluded-rows.test.tst0024 files:
src/infra/state-migrations.workspace-setup-sandbox.test.ts,src/infra/state-migrations.workspace-setup-shared-root.test.ts,src/infra/state-migrations.workspace-setup.test.tst0030 files:
src/agents/bash-tools.test.tst0031 files:
src/agents/embedded-agent-subscribe.before-terminal-delivery.test.ts,src/agents/embedded-agent-subscribe.block-reply-rejections.test.ts,src/agents/embedded-agent-subscribe.callback-fatal.test.ts,src/agents/embedded-agent-subscribe.deferred-reply-supersession.test.ts,src/agents/embedded-agent-subscribe.directive-delivery.block-code.test-support.ts,src/agents/embedded-agent-subscribe.directive-delivery.inline-code.test-support.ts,src/agents/embedded-agent-subscribe.directive-delivery.test.tst0002 files:
config/assertion-safety-baseline.txt,src/gateway/server.auth.browser-hardening.test.ts,src/gateway/server.auth.compat-baseline.test.ts,src/gateway/server.auth.control-ui.bootstrap-lifecycle.suite.ts,src/gateway/server.auth.control-ui.mobile-bootstrap.suite.ts,src/gateway/server.auth.control-ui.pairing.suite.ts,src/gateway/server.auth.control-ui.trusted-proxy.suite.ts,src/gateway/server.auth.default-token.suite.ts,src/gateway/server.auth.identity-fixture.test-support.ts,src/gateway/server.auth.identity-scopes.test.ts,src/gateway/server.auth.trusted-proxy-device-autoapprove.test.tsIndependent review disposition
Five accepted gaps were restored: the hand-projected node timeout schema and ambiguous-key exclusion, accepted delivery followed by rejection, device-less Control UI rejection after failed proxy authentication, explicit requested scopes intersecting the declared proxy cap, and distinct per-agent workspace migrations.
Eight original findings were rejected after checking the surviving owners: configured-pattern sanitization remains in
embedded-agent-tool-results.cache.test.ts; parent-segment rejection is common to both exec backends; browser-origin lockout with loopback exemption remains covered; CDP credential redaction remains in the snapshot owner (and this batch ultimately retains the original config-patch file); the removed cursor getter no longer created its claimed transaction race, while the real concurrent-writer snapshot test remains; transcript and recovery markers are asserted inside ACK callbacks; superseded pairing approval is rejected indevice-pairing-churn.test.ts; and linked migration-source rejection is covered through the shared source-snapshot owner.The follow-up review's sole finding requested a duplicate full-exec field-presence assertion.
agent-tools.schema.test.tsalready requires the publictimeoutSecondsdescription to containseconds, so removing the field fails that owner test. No accepted finding remains unresolved.