Skip to content

fix(browser): remove dead requireRef import and void expression in register.navigation.ts#91185

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
whiteyzy:fix/83878-remove-dead-requireref-import
Jun 13, 2026
Merged

fix(browser): remove dead requireRef import and void expression in register.navigation.ts#91185
vincentkoc merged 2 commits into
openclaw:mainfrom
whiteyzy:fix/83878-remove-dead-requireref-import

Conversation

@whiteyzy

@whiteyzy whiteyzy commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the unused requireRef import and void requireRef expression from register.navigation.ts. The void expression was used to suppress lint warnings but does not create a real compile-time or runtime dependency.

Linked context

Closes #83878

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: Dead import + void expression that silences lint without a real dependency.
  • Real environment tested: macOS, Node v22.22.3, latest upstream/main, OpenClaw v2026.6.2
  • Exact steps or command run after this patch:
# 1. Real CLI: browser subcommands still work correctly
npx openclaw browser resize --help
npx openclaw browser navigate --help

# 2. Unit tests with new regression test
node scripts/run-vitest.mjs run extensions/browser/src/cli/browser-cli-actions-input/register.navigation.test.ts --reporter=verbose
  • Evidence after fix (copied live output):

Real CLI output:

$ npx openclaw browser resize --help
OpenClaw 2026.6.2 (e9202a6) — All your chats, one OpenClaw.

Usage: openclaw browser resize [options]

Resize the viewport

Options:
  -h, --help  Display help for command

$ npx openclaw browser navigate --help
OpenClaw 2026.6.2 (e9202a6) — All your chats, one OpenClaw.

Usage: openclaw browser navigate [options]

Navigate the current tab to a URL

Options:
  -h, --help  Display help for command

Unit test output (3/3 passing):

 ✓ |extension-browser| register.navigation.test.ts > browser navigation commands > rejects non-decimal resize dimensions before dispatch
 ✓ |extension-browser| register.navigation.test.ts > browser navigation commands > rejects excessive resize dimensions before dispatch
 ✓ |extension-browser| register.navigation.test.ts > browser navigation commands > navigate and resize commands are registered after removing dead import (#83878)

 Test Files  1 passed (1)
      Tests  3 passed (3)
  • Observed result after fix: Browser resize and navigate commands still work in real CLI. Unit tests pass including new regression test verifying command registration. requireRef is still exported from shared.js for other modules.
  • What was not tested: N/A — dead code removal with no runtime behavior change.
  • Proof limitations or environment constraints: None.

Tests and validation

Which commands did you run?

node scripts/run-vitest.mjs run extensions/browser/src/cli/browser-cli-actions-input/register.navigation.test.ts --reporter=verbose
# 3 passed (1 test file)

What regression coverage was added or updated?
Added "navigate and resize commands are registered after removing dead import" — verifies both commands register correctly after the import removal.

Risk checklist

Did user-visible behavior change? No
Did config, environment, or migration behavior change? No
Did security, auth, secrets, network, or tool execution behavior change? No
What is the highest-risk area? None — dead code removal only.
How is that risk mitigated? Existing tests + new regression test pass. CLI commands work correctly.

Current review state

What is the next action? Maintainer review.
What is still waiting on author, maintainer, CI, or external proof? None.


🤖 Generated with Claude Code
Co-Authored-By: Claude Code [email protected]

@openclaw-barnacle openclaw-barnacle Bot added size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 8, 2026, 1:03 PM ET / 17:03 UTC.

Summary
This PR removes an unused requireRef import and void requireRef anchor from browser navigation command registration and adds a regression test for navigate/resize registration.

PR surface: Source -3, Tests +14. Total +11 across 2 files.

Reproducibility: yes. Current main source shows requireRef imported in register.navigation.ts and only referenced by void requireRef, while real requireRef usage lives in sibling element commands.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Land one narrow cleanup branch that removes the phantom import while preserving browser command registration, then close the duplicate PR path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

Security
Cleared: The diff only removes an unused import/void reference and adds a colocated unit test, with no dependency, script, workflow, secret, or package-resolution changes.

Review details

Best possible solution:

Land one narrow cleanup branch that removes the phantom import while preserving browser command registration, then close the duplicate PR path.

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

Yes. Current main source shows requireRef imported in register.navigation.ts and only referenced by void requireRef, while real requireRef usage lives in sibling element commands.

Is this the best way to solve the issue?

Yes. Removing the dead import and void expression is the narrow maintainable fix; the added registration test is acceptable, with the only remaining choice being which duplicate cleanup PR to land.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a low-risk browser CLI cleanup with no config, migration, auth, security, or user-visible behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied live CLI help output for openclaw browser resize and openclaw browser navigate, plus targeted regression test output after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live CLI help output for openclaw browser resize and openclaw browser navigate, plus targeted regression test output after the patch.
Evidence reviewed

PR surface:

Source -3, Tests +14. Total +11 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 4 -3
Tests 1 14 0 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 4 +11

What I checked:

Likely related people:

  • Cameron Beeley: git blame attributes the current register.navigation.ts file, including the dead requireRef import and void anchor, to commit d7b9b21f. (role: current-line author; confidence: high; commits: d7b9b21fb80a; files: extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts)
  • steipete: git log --follow shows repeated earlier browser CLI navigation refactors and the original split of register.navigation.ts under this author before the file moved into the browser plugin. (role: feature-history contributor; confidence: high; commits: bcbfb357bec7, e7fdccce3905, 457e5308a9cd; files: src/cli/browser-cli-actions-input/register.navigation.ts, extensions/browser/src/cli/browser-cli-actions-input/register.navigation.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 7, 2026
@whiteyzy
whiteyzy force-pushed the fix/83878-remove-dead-requireref-import branch from 1611b48 to 33d91dc Compare June 8, 2026 15:14
@whiteyzy

whiteyzy commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated:

@clawsweeper

clawsweeper Bot commented Jun 8, 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:

@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@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: 🦪 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. labels Jun 8, 2026
@whiteyzy
whiteyzy force-pushed the fix/83878-remove-dead-requireref-import branch from 33d91dc to 52e30bc Compare June 8, 2026 16:57
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Jun 8, 2026
secooond added 2 commits June 13, 2026 21:34
…gister.navigation.ts

The 'void requireRef' expression was used to suppress lint warnings about an
unused import, but it does not create a real compile-time or runtime dependency.
Remove both the import and the void workaround.

Fixes openclaw#83878
…fter dead import removal

Verify that navigate and resize commands are still registered after
removing the dead requireRef import. Also verify that requireRef is
still exported from shared.js for other modules.

Fixes openclaw#83878
@vincentkoc
vincentkoc force-pushed the fix/83878-remove-dead-requireref-import branch from 52e30bc to cd59b2d Compare June 13, 2026 13:35
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 13, 2026

@vincentkoc vincentkoc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings.

Best-fix verdict: best. The deleted import/void anchor is not a real runtime or compile-time dependency; requireRef remains exported from shared.ts and remains used by sibling element commands.

Alternatives considered: keeping the phantom import preserves noise in the plugin import graph; moving the export assertion to production code would be worse than the focused registration test already added here.

Proof: local git diff --check, oxfmt, oxlint, focused Vitest; autoreview clean; GitHub CI exact head cd59b2d green.

@vincentkoc
vincentkoc merged commit 2e8a2d6 into openclaw:main Jun 13, 2026
156 checks passed
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. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

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

2 participants