Skip to content

fix(browser): remove unused requireRef import and void workaround (#83878)#86847

Closed
1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/remove-void-require-ref
Closed

fix(browser): remove unused requireRef import and void workaround (#83878)#86847
1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/remove-void-require-ref

Conversation

@1052326311

Copy link
Copy Markdown
Contributor

Summary

Removes the unused requireRef import and its void requireRef silencing workaround from register.navigation.ts. The import serves no purpose — the file does not call requireRef, and documenting the public surface of shared.ts belongs in shared.ts itself or a barrel export, not as a phantom import.

Closes #83878

Change Type

  • Code cleanup / Dead code removal

Scope

  • Browser extension / CLI

Linked Issue

Real behavior proof

Behavior or issue addressed: register.navigation.ts imports requireRef from ./shared.js but never calls it. The void requireRef expression at line 84 silences the unused-import lint without creating a real dependency. This is dead code that obscures the actual import graph.

Real environment tested: macOS Darwin 25.4.0 arm64, Node v22.22.0, openclaw branch fix/remove-void-require-ref rebased on upstream main commit 8e110a21.

Exact steps or command run after this patch:

  1. Removed requireRef from the import and deleted the void requireRef + comment block (4 lines removed, 1 line changed).
  2. Verified TypeScript compilation: node scripts/run-tsgo.mjs -p tsconfig.json — exit 0.
  3. Verified formatting: pnpm exec oxfmt --check extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts — clean.
  4. Verified linting: pnpm exec oxlint extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts — 0 warnings, 0 errors.
  5. Drift proof: the removed import (requireRef) and void expression do not exist in the patched version. Reverting the patch restores the dead import.

Evidence after fix:

$ node scripts/run-tsgo.mjs -p tsconfig.json
# exit 0

$ pnpm exec oxfmt --check extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts
Finished in 22ms on 1 files using 10 threads.

$ pnpm exec oxlint extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts
Found 0 warnings and 0 errors.

Diff (1 file, +1 / -4):

-import { requireRef, resolveBrowserActionContext } from "./shared.js";
+import { resolveBrowserActionContext } from "./shared.js";
...
-  // Keep `requireRef` reachable; shared utilities are intended for other modules too.
-  void requireRef;

Observed result: After the patch, register.navigation.ts no longer imports or references requireRef. TypeScript, format, and lint all pass cleanly. The file is functionally identical — resolveBrowserActionContext is still imported and used as before.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the cleanup in this PR is valid, but the same remaining work is now covered by the open replacement at #91185, which removes the same dead import and adds focused coverage plus stronger real CLI proof.

Canonical path: Use #91185 as the canonical landing path for the linked cleanup, then let that merged change close the related issue.

So I’m closing this here and keeping the remaining discussion on #91185.

Review details

Best possible solution:

Use #91185 as the canonical landing path for the linked cleanup, then let that merged change close the related issue.

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

Yes for the structural cleanup: current main still imports requireRef in register.navigation.ts and only references it through void requireRef, while sibling element commands are the real callers.

Is this the best way to solve the issue?

No as a standalone landing path now; this patch is a correct minimal cleanup, but the open replacement PR is the better current path because it carries the same deletion plus focused coverage and real CLI proof.

Security review:

Security review cleared: The diff only removes an unused local import and no longer-used expression; it does not touch dependencies, scripts, secrets, workflows, network behavior, or package metadata.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • Cameron Beeley: Current git blame attributes the Browser action-input split, requireRef helper, and phantom navigation import/comment to d7b9b21. (role: introduced behavior; confidence: high; commits: d7b9b21fb80a; files: extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts, extensions/browser/src/cli/browser-cli-actions-input/shared.ts, extensions/browser/src/cli/browser-cli-actions-input/register.element.ts)
  • Ayaan Zaidi: git show identifies Ayaan Zaidi as the committer on the commit that added the current Browser action-input files containing this cleanup target. (role: committer for current implementation; confidence: medium; commits: d7b9b21fb80a; files: extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts, extensions/browser/src/cli/browser-cli-actions-input/shared.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 4094ef4dcb81.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Pearl Review Wisp

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: keeps receipts.
Image traits: location diff observatory; accessory miniature diff map; palette moonlit blue and soft silver; mood focused; pose peeking out from the egg shell; shell translucent glimmer shell; lighting soft underwater shimmer; background gentle dashboard dots.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Pearl Review Wisp in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 26, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 26, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 29, 2026
@1052326311
1052326311 force-pushed the fix/remove-void-require-ref branch from 82e4e81 to d7883b9 Compare June 1, 2026 01:17
@1052326311

Copy link
Copy Markdown
Contributor Author

Rebased onto latest upstream/main to get fresh CI.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@1052326311
1052326311 force-pushed the fix/remove-void-require-ref branch from d7883b9 to 8cda426 Compare June 1, 2026 15:34
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 1, 2026
@1052326311

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

…enclaw#83878)

The void requireRef expression in register.navigation.ts silences the
unused-import lint but does not create a real dependency. The import and
its comment are dead code — shared.ts surface documentation belongs in
shared.ts or a barrel export, not as a phantom import in an unrelated
file.

Closes openclaw#83878
@1052326311
1052326311 force-pushed the fix/remove-void-require-ref branch from 8cda426 to e55907a Compare June 8, 2026 16:58
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 8, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 8, 2026
@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

void requireRef silences dead-import lint via side-effect expression

2 participants