Skip to content

chore: remove unused exports that keep check-dependencies red on main - #207586

Merged
obviyus merged 1 commit into
mainfrom
fix/main-dead-exports
Nov 28, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/main-dead-exports

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The scheduled check-dependencies job (pnpm deadcode:report, hard-zero unused exports) has failed on main in each of the last 10 hourly runs with Unused exports are not allowed. The job does not run on pull requests, so changes that left an export without a reader merged green and turned main red.

Reproduced on main 239a05e: pnpm deadcode:report exits 1 with five findings.

Fix

Each finding is removed or narrowed at its module:

Export Readers on main Change
cli-root-options.mjs getCommandOptionsWithRootOptions none; #207200 removed its only caller, the entrypoint Doctor child remove the function, its .d.mts declaration and the options-return mode of the shared parser that only it used
extensions/codex/src/app-server/dynamic-tool-profile.ts shouldDisableCodexToolSearchForModel own module only un-export
src/agents/harness/types.ts AgentHarnessSideQuestionRequest own module only (reached through AgentHarnessSideQuestionParamsV2) un-export
src/agents/tool-search-catalog-visibility.ts CORE_TOOL_CATALOG_FAMILIES one test only un-export; the test lists the family from its own real tool factories
src/config/sessions/session-pending-input-history.types.ts PendingInputHistoryRunState one field inline the type

No behavior change: the remaining parser modes return the same values. No knip config change.

User Impact

None at runtime. Main's check-dependencies job goes green again.

Evidence

  • Before (main 239a05e): pnpm deadcode:report exit 1, 5 unused exports.
  • After (this head): pnpm deadcode:report exit 0, wall 102.4 s locally (script, production and full-tree scans all pass).
  • pnpm check:changed: typecheck all, dead export scan, format and the other guards pass. Lint's single error is ui/config/control-ui-chunking.ts:178 no-duplicate-case, which is already on main from fix(control-ui): keep Chat startup within its asset budget #207505 and not in this diff.
  • Tests: src/agents/tool-search.repeatable.test.ts, src/infra/cli-root-options.test.ts, extensions/codex/src/app-server/dynamic-tool-profile.test.ts, test/scripts/compose-installed-runtime.test.ts pass.
  • Diff: +8 / -31.

- Remove getCommandOptionsWithRootOptions and its options-return parser mode; #207200 removed its only caller.
- Un-export module-local shouldDisableCodexToolSearchForModel, AgentHarnessSideQuestionRequest, CORE_TOOL_CATALOG_FAMILIES.
- Inline PendingInputHistoryRunState into its one field.
@clawsweeper

clawsweeper Bot commented Nov 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. 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. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR removes unused exports and an unused CLI parser mode while preserving existing runtime behavior.

Example: Running pnpm deadcode:report on the reported base and PR head.

  • Before: The author reports exit 1 with five unused-export findings.
  • After: The author reports exit 0 with the existing scan configuration.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is minimal and source-supported, while validation confidence remains limited by the unresolved CI assertion.
Proof confidence 🦐 gold shrimp (3/6) There is no user-visible runtime change requiring shipped-entry-point proof; the author reports focused tests and a successful deadcode scan.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Unused exports keep the repository's dependency check failing and obscure other actionable failures.
Reason: The maintainer-authored change restores an existing maintenance contract without adding policy, options, or runtime behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR provides a focused cleanup of unused exports still present on main, with no definite introduced defect found.

Reviewed head: 0197f2f71aed10a64a97d3a59269517d19b681e3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Knip reads source exports and their consumers, applies the repository's zero-findings policy, and reports the result to dependency CI.

flowchart LR
  A[Source modules] --> C[Knip scans]
  B[Production and test consumers] --> C
  C --> D[Zero findings policy]
  D --> E[Dependency CI result]
Loading

Technical review

Best possible solution:

Retain this minimal cleanup and resolve the CI gate using evidence about the failing Codex policy assertion.

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

Source searches confirm the unused export relationships and the hard-zero scan policy; the reported failing and passing commands were not rerun during this read-only review.

Is this the best way to solve the issue?

Removing unused surface at its existing owners is the smallest complete repair, and the surviving parser modes remain equivalent.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • CLI options-return parser mode keeps the original intent (2a1402c: Preserve root selectors when launching the entrypoint Doctor child; merged fix(docker): avoid pre-boot Doctor delays on container recreation #207200 subsequently removed that consumer.)
  • Delegation catalog and regression tests keeps the original intent (8eb9596: Keep the delegation family together and preserve dispatched polling exemptions; this PR retains that behavior with independent test inputs.)
  • Codex model-specific tool loading keeps the original intent (9ead0ae: Avoid unsupported tool search for the affected model; only the helper's export visibility changes.)
  • Side-question request type keeps the original intent (b13c10d: Allow host request policy to prepare native side questions; the request remains accessible through the existing public parameter contract.)
  • Pending-input run-state type keeps the original intent (570f3d3: Carry the run-state observation alongside queued history; inlining preserves the same fields and types.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 8eb9596 adds src/agents/tool-search-catalog-visibility.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8eb959678b1f; files: src/agents/tool-search-catalog-visibility.ts)
  • Peter Steinberger: Raw commit 2ce0573 adds cli-root-options.mjs:105 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2ce0573b02ea; files: cli-root-options.mjs)
  • Vincent Koc: Raw commit b13c10d adds src/agents/harness/types.ts:329 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b13c10deed76; files: src/agents/harness/types.ts)

PR surface

Source -2, Tests -2, Other -19. Total -23 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 4 6 -2
Tests 1 1 3 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 3 22 -19
Total 7 8 31 -23

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

  • 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 November 28, 2026, 10:39 AM ET / 15:39 UTC.

@obviyus

obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: checks-node-changed-compact-large-3-1 (and openclaw/ci-gate, whose only failing job is that one) fail on a test that also fails on main.

ci-triage output:

# PR #207586 head 0197f2f71aed; main run 46154601106
checks-node-changed-compact-large-3-1	src/agents/harness/codex-subagent-tool-policy.test.ts	MAIN-ALSO

Failing case: Codex subagent native tool policy > preserves native tools for OpenClaw admin/status-only denial (an AssertionError on a toBeUndefined() check: the value is false). The scheduled main run 46154601106 fails the same file. This PR only removes or un-exports unused symbols; it changes no runtime code on that path.

@obviyus
obviyus merged commit 6d81131 into main Nov 28, 2026
146 of 149 checks passed
@obviyus
obviyus deleted the fix/main-dead-exports branch November 28, 2026 15:52
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…openclaw#207586)

## What Problem This Solves

The scheduled `check-dependencies` job (`pnpm deadcode:report`, hard-zero unused exports) has failed on main in each of the last 10 hourly runs with `Unused exports are not allowed`. The job does not run on pull requests, so changes that left an export without a reader merged green and turned main red.

Reproduced on main 75a0808: `pnpm deadcode:report` exits 1 with five findings.

## Fix

Each finding is removed or narrowed at its module:

| Export | Readers on main | Change |
|---|---|---|
| `cli-root-options.mjs` `getCommandOptionsWithRootOptions` | none; openclaw#207200 removed its only caller, the entrypoint Doctor child | remove the function, its `.d.mts` declaration and the options-return mode of the shared parser that only it used |
| `extensions/codex/src/app-server/dynamic-tool-profile.ts` `shouldDisableCodexToolSearchForModel` | own module only | un-export |
| `src/agents/harness/types.ts` `AgentHarnessSideQuestionRequest` | own module only (reached through `AgentHarnessSideQuestionParamsV2`) | un-export |
| `src/agents/tool-search-catalog-visibility.ts` `CORE_TOOL_CATALOG_FAMILIES` | one test only | un-export; the test lists the family from its own real tool factories |
| `src/config/sessions/session-pending-input-history.types.ts` `PendingInputHistoryRunState` | one field | inline the type |

No behavior change: the remaining parser modes return the same values. No knip config change.

## User Impact

None at runtime. Main's `check-dependencies` job goes green again.

## Evidence

- Before (main 75a0808): `pnpm deadcode:report` exit 1, 5 unused exports.
- After (this head): `pnpm deadcode:report` exit 0, wall 102.4 s locally (script, production and full-tree scans all pass).
- `pnpm check:changed`: typecheck all, dead export scan, format and the other guards pass. Lint's single error is `ui/config/control-ui-chunking.ts:178` no-duplicate-case, which is already on main from openclaw#207505 and not in this diff.
- Tests: `src/agents/tool-search.repeatable.test.ts`, `src/infra/cli-root-options.test.ts`, `extensions/codex/src/app-server/dynamic-tool-profile.test.ts`, `test/scripts/compose-installed-runtime.test.ts` pass.
- Diff: +8 / -31.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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