Skip to content

test(agents): remove orphaned helper code - #201031

Merged
vincentkoc merged 2 commits into
mainfrom
chore/remove-orphan-agent-test-helpers-20261118
Nov 18, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
chore/remove-orphan-agent-test-helpers-20261118

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The test consolidation in #198916 removed the last consumers of several agent test helpers but left their exports, implementations, and exclusive imports behind. Full-tree dead-code checks still report those orphaned helpers.

User Impact

No production behavior changes. Existing tests and their assertions remain intact.

Why This Change Was Made

Remove the unused context-engine mock helpers, fallback auth writer and error fixtures, native-catalog assertion and refresh helpers, and terminal stats input types. Keep three helpers/constants that still have same-file callers private. Retain the fallback success-attempt builder, active rate-limit fixture, and real admission/catalog/terminal helpers used by surviving suites.

Evidence

  • Audited all five owner files and references at base 5e677bad; traced the removed consumers to #198916 (ee3e16e).
  • The shared baseline full-tree Knip scan reports the original unused exports and types. The first candidate scan identified the assertion helper's now-unused refresh helper; the final scan confirms that complete helper chain is gone.
  • Private native frozen dependencies; four retained consumer files passed 67 tests across three normal projects, including the catalog integration, attempt-abort, terminal-preparation, and fallback overflow-recovery suites. Both owning agent test typegraphs, targeted type-aware lint, formatting, normal commit hooks, and whitespace checks passed.
  • Final full-tree Knip remains red for findings outside these five owners: GBrain, requester wake scope, UI test support, hook/metric types, and the standalone PR-cache child script. The production scan retains unrelated baseline findings and the script scan passed; this PR does not claim a globally clean scan.
  • Local ClawSweeper reviewed the complete committed range 5e677bad..dfac330a with all five files and owning context: no actionable correctness or security findings (confidence 0.97).
  • Proof used the exact final five-file candidate through one temporary native overlay, restored byte-for-byte afterward. The originally selected fallback timeout E2E suite stopped before tests at an existing AI declaration-confinement failure involving an outer-checkout dependency. The guard was preserved; the supported fallback overflow-recovery consumer passed instead. No dependencies were installed in the code-only managed checkout, and no live Gateway or provider proof is claimed.

Current CI qualification

Exact-head CI run 44252454022 completed with five SDK declaration/type failures plus their aggregate; all test jobs and security-fast passed. Each failure reports the same six public hook/metrics types missing from their modules. #201044 restored those exports on main. The actual tested merge changes only this PR’s five test-support files; twelve inspected SDK, compiler, workflow, and dependency inputs are byte-identical to its main baseline. This is scoped inherited-failure attribution, not a claim that the failed run was green or that this cleanup repairs the SDK.

@vincentkoc vincentkoc self-assigned this Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 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 agents Agent runtime and tooling size: S labels Nov 18, 2026
@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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes orphaned agent test helpers and imports and makes three internally used exports private.

Example: Maintaining the fallback tests after their consolidation

  • Before: writeFallbackAuthStore remains exported despite having no callers.
  • After: The unused writer is removed while the active multi-profile writer remains available.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cleanup is focused and source-verified, but skipped validation jobs provide no execution confidence.
Proof confidence 🦐 gold shrimp (3/6) Only unused test support is removed, so shipped-entry-point proof is unnecessary; focused suite and typecheck validation remains unreported, and no target code was executed during this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: Removing verified orphaned support reduces maintenance work without changing runtime behavior or active test coverage; the maintainer-authored direction needs no additional product decision.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides useful, focused cleanup of unused test support, with no actionable correctness or security findings.

Priority: P3
Reviewed head: 25e1f198247016c60bdf7f50e40e9426928d7bb9

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent test suites use these support modules to construct runner inputs, isolated auth stores, terminal results, and model-catalog fixtures.

flowchart TD
  A[Agent test suites] --> B[Retained test helpers]
  B --> C[Runner and terminal owners]
  B --> D[Isolated auth fixtures]
  B --> E[Catalog worker fixtures]
  C --> F[Test assertions]
  D --> F
  E --> F
Loading

Technical review

Best possible solution:

Remove only unreachable test support and unused export modifiers while preserving every surviving helper and assertion.

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

There is no runtime bug to reproduce; source inspection verifies the orphaned definitions and surviving internal callers.

Is this the best way to solve the issue?

The diff is the smallest complete cleanup: it removes unused implementations and their exclusive imports without adding machinery or modifying surviving assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 75a31ed2854c.

Provenance checked

  • Context-engine mock helpers keeps the original intent (6a9bcca: These helpers supported context-engine and prompt-cache tests; subsequent consolidation removed their consumers.)
  • Terminal statistics input types keeps the original intent (c8111ab: The types supported terminal-statistics assertions associated with diagnostic content export; their consuming suite was removed by the merged consolidation.)
  • Fallback auth writer and error fixtures keeps the original intent (5454da8: The support served fallback availability and provider-error regressions, including later HTTP classification fixtures; this PR removes only definitions whose consumers were already removed.)
  • Native catalog assertion helper keeps the original intent (6c44634: The helper checked native model availability after worker publication; its native integration caller was removed in the merged consolidation, leaving the assertion function unreachable.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned PR scope: The introduced diff only deletes unused test-support implementations, types, and exclusive imports, or removes export modifiers; it changes no test declarations or production implementations. (25e1f1982470)
  • References and retained callers: Reference searches found no surviving consumers of the deleted helpers; embeddedParams, CATALOG_ALIAS_ID, and UNRELATED_SYNTHETIC_AUTH_ID retain their same-file callers. (src/agents/prepared-model-catalog-worker.test-support.ts:36, 25e1f1982470)
  • Merged consolidation explains the orphaning: The merged consolidation at test(agents): trim and fold low-value regression suites #198916 removed the relevant context-engine, terminal-stats, fallback, and native-catalog helper consumers; this PR completes the leftover support cleanup. (ee3e16ecca72)
  • Current main still needs the cleanup: The four support files are unchanged between the pinned merge base and fetched main, where the orphaned definitions remain. (75a31ed2854c)
  • Draft and validation state: GitHub reports the reviewed head as a cleanly mergeable draft; its five successful checks cover automation or scope detection, while test and typecheck jobs were skipped rather than passed. (25e1f1982470)
  • Policy and history inspection: Read the root and applicable agent/run AGENTS.md files and applied the simplification checklist; the maintainer-notes directory is absent. Historical follow traversal reaches unavailable creation-boundary objects, so earlier introduction remains unknown where not independently established. (src/agents/AGENTS.md:1, 25e1f1982470)

Likely related people:

  • Peter Steinberger: Raw commit 3cda99d adds src/agents/embedded-agent-runner/run/attempt-context-engine.test-support.ts:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3cda99dcbe3c; files: src/agents/embedded-agent-runner/run/attempt-context-engine.test-support.ts)

PR surface

Tests -174. Total -174 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 5 179 -174
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 5 179 -174

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This is low-risk test-support 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 low-risk test-support 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.

Rank-up moves

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

  • Complete focused consumer-suite and typecheck validation on the reviewed head.

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 November 18, 2026, 1:16 AM ET / 06:16 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 18, 2026 06:35
@vincentkoc
vincentkoc enabled auto-merge (squash) November 18, 2026 06:35
@vincentkoc
vincentkoc disabled auto-merge November 18, 2026 07:06
@vincentkoc
vincentkoc merged commit 7840d69 into main Nov 18, 2026
195 of 203 checks passed
@vincentkoc
vincentkoc deleted the chore/remove-orphan-agent-test-helpers-20261118 branch November 18, 2026 07:09
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
* test(agents): remove orphaned helper code

* test(agents): remove orphaned catalog refresh helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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