Skip to content

fix(ci): remove unused hook type exports - #203074

Merged
vincentkoc merged 1 commit into
mainfrom
fix-ci-hook-type-export-audit-20261121
Nov 21, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix-ci-hook-type-export-audit-20261121

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

The dependency check on main fails because two internal hook type exports have no production consumers. This blocks the unused-export audit.

Related main failure: https://github.com/openclaw/openclaw/actions/runs/44894312439/job/136816906888

User Impact

No user-visible runtime change. The dependency audit passes without adding exceptions or changing the supported Plugin SDK surface.

Why This Change Was Made

Keep the gateway startup context private and type its fixture through the exported event. Remove the unused hook barrel re-export of the exec-request owner type; its canonical definition and both context consumers remain.

Evidence

The original source reproduced both unused-export findings. The committed tree passed the script, production, and full-tree export reports, all seven existing hook tests, core and core-test typechecks, formatting, and scoped lint.

  • pnpm deadcode:report: all three reports passed.
  • pnpm test src/hooks/internal-hook-types.test.ts src/hooks/internal-hooks.test.ts --maxWorkers=1: 7 tests passed in 2 files.
  • pnpm check:changed -- src/hooks/internal-hook-types.ts src/hooks/internal-hook-types.test.ts src/plugins/hook-types.ts: guards, formatting, typechecks, and export scans passed before the remote runner became unavailable during lint. This invocation did not finish successfully.
  • Recovered only the remaining lint command through scripts/run-oxlint.mjs, using the same three paths and core config: 0 warnings, 0 errors; runner exited successfully and its lease stopped.

Validation used isolated Linux runners with Node 24.22.1 and pnpm 12.15.0. Source tree 69dc8ab2d7ea47a9a2060e0b36de385462b37398 matches commit 9692da34b31845d280b7c9725c84deaf816c0f5c.

Fresh local ClawSweeper review covered the complete committed range 23f11754c38e85375e1b1de3425451ab85f49555..9692da34b31845d280b7c9725c84deaf816c0f5c, without a priority filter. It found no actionable correctness or security issues. The reviewer performed source review; it did not run tests.

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

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

@vincentkoc
vincentkoc marked this pull request as ready for review November 21, 2026 12:28
@vincentkoc
vincentkoc enabled auto-merge (squash) November 21, 2026 12:28
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes two unused internal type exports and updates a test fixture to use the retained event type.

Example: The dependency audit examines GatewayStartupHookContext and PluginHookExecRequestOwner.

  • Before: The startup context is exported only for a test, and the exec-owner type has an unused barrel re-export.
  • After: The fixture uses GatewayStartupHookEvent["context"], while the exec-owner definition and its context consumers remain intact.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-verified maintenance fix with appropriate reported validation and passing exact-head type and lint checks.
Proof confidence 🐚 platinum hermit (4/6) There is no user-visible runtime change requiring shipped-entry-point proof; the retained evidence covers export auditing, hook tests, types, and lint.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: The main-branch unused-export audit fails on two unnecessary internal hook exports.
Reason: The maintainer-authored change restores audit hygiene without exceptions, runtime changes, or supported SDK removals.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, correct repair for the unused-export audit; no actionable correctness or security findings remain, and the overall CI gate is still pending.

Priority: P3
Reviewed head: 9692da34b31845d280b7c9725c84deaf816c0f5c

Before merge

None.

Findings

None.

Agent review details

How this fits together

Hook contract modules describe gateway events and plugin contexts; runtime dispatch and SDK entry points consume those contracts without needing the removed internal exports.

flowchart LR
  A[Gateway events] --> B[Internal hook contracts]
  B --> C[Event predicates and fixtures]
  D[Exec owner contract] --> E[Agent and tool contexts]
  E --> F[Plugin hook handlers]
Loading

Technical review

Best possible solution:

Remove the unused internal exports while retaining the canonical contracts, context fields, and existing behavioral tests exactly as this PR does.

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

Source inspection confirms the unused exports and their consumers, and the linked main dependency job failed; no target code was run during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete fix: remove unnecessary export visibility, derive the fixture type from the retained event, and preserve the canonical exec-owner definition.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Gateway startup event context and fixture keeps the original intent (25b89de: Move existing event contracts and predicates away from the runtime registry; this commit establishes their current placement, not their original invention.)
  • Exec-request owner barrel re-export keeps the original intent (d541d8c: Expose starting-turn ancestry through hook contexts without adding a public SDK export; the definition and both context fields remain.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Garry Tan: Raw commit d541d8c adds src/plugins/hook-agent-context.types.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d541d8c9ea1c; files: src/plugins/hook-agent-context.types.ts)

PR surface

Source -1, Tests 0. Total -1 across 3 files. Added test files: 0.

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

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 a narrow internal export cleanup that repairs an audit without changing runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 a narrow internal export cleanup that repairs an audit without changing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 21, 2026, 7:42 AM ET / 12:42 UTC.

@vincentkoc
vincentkoc merged commit c949daa into main Nov 21, 2026
215 checks passed
@vincentkoc
vincentkoc deleted the fix-ci-hook-type-export-audit-20261121 branch November 21, 2026 12:45
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Nov 21, 2026
…3044

* origin/main:
  refactor(test): remove duplicate token startup wait case (#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (#203074)
  fix(test): exercise the sign-in callback path guard (#203075)
  refactor(tts): separate caption eligibility from text helpers (#203068)
  test: reuse worker preload options (#203058)
  refactor(test): share Bun native-policy test launcher (#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (#203056)
  refactor(test): remove duplicate claw origin rejection case (#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (#203047)
  refactor: separate skill queries from workspace discovery (#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (#203043)
  fix: avoid repeated filesystem probes before agent turns (#203057)
  perf(agents): preserve sealed history during endpoint compaction (#203037)
  fix(test): give deferred identity fixtures read scope (#203053)
  refactor(test): remove redundant channel catalog facade (#203052)
  refactor(cli): isolate daemon port presentation (#203020)
  refactor(cron): isolate CLI input parsing (#203031)
vincentkoc added a commit that referenced this pull request Nov 21, 2026
* feat: open shared sessions in their source Control UI

* feat: open shared sessions in their source Control UI

OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  fix(ci): decouple boundary fixture from timing inventory (#203026)
  fix(ci): shard capable compatibility UI targets (#203042)
  perf(agents): restore selected subagent payloads once (#203039)
  fix: keep standalone context from completing QA tool steps
  perf(sessions): reuse sealed ownership for context projections (#203040)
  refactor(hooks): separate event predicates from hook registry (#203017)
  fix(ci): align update export audits with their consumers (#203030)
  fix: keep cold baseline checks within the existing heap limit

* fix(session-share): accept the runtime config snapshot in the source link resolver

The stored-session link resolver took a mutable config, so the plugin's readonly
runtime snapshot failed production and test typechecks. Accept the snapshot type.

Document the real Open original setup: allow the link command on the receiver
Gateway, set the source Control UI origin, reinstall the source node with all
three commands, then approve the widened surface. Move the section ahead of
Security boundary and add a troubleshooting entry.

Assert through the Gateway catalog list that a provider-supplied link survives
streamed and final rows, and drop the menu unit test the browser fixture covers.

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  refactor(test): remove duplicate token startup wait case (#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (#203074)
  fix(test): exercise the sign-in callback path guard (#203075)
  refactor(tts): separate caption eligibility from text helpers (#203068)
  test: reuse worker preload options (#203058)
  refactor(test): share Bun native-policy test launcher (#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (#203056)
  refactor(test): remove duplicate claw origin rejection case (#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (#203047)
  refactor: separate skill queries from workspace discovery (#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (#203043)
  fix: avoid repeated filesystem probes before agent turns (#203057)
  perf(agents): preserve sealed history during endpoint compaction (#203037)
  fix(test): give deferred identity fixtures read scope (#203053)
  refactor(test): remove redundant channel catalog facade (#203052)
  refactor(cli): isolate daemon port presentation (#203020)
  refactor(cron): isolate CLI input parsing (#203031)

* chore(plugin-sdk): record the approved session-discussion surface growth

Open original adds two exports to openclaw/plugin-sdk/session-discussion: the
stored-session Control UI path resolver and the session path parser. Raise the
public export and callable budgets by two for them.

Use neutral fixtures for the rejected-origin and rejected-query URL tests so the
fixtures do not resemble credentials; the same rejections are covered.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
* feat: open shared sessions in their source Control UI

* feat: open shared sessions in their source Control UI

OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  fix(ci): decouple boundary fixture from timing inventory (openclaw#203026)
  fix(ci): shard capable compatibility UI targets (openclaw#203042)
  perf(agents): restore selected subagent payloads once (openclaw#203039)
  fix: keep standalone context from completing QA tool steps
  perf(sessions): reuse sealed ownership for context projections (openclaw#203040)
  refactor(hooks): separate event predicates from hook registry (openclaw#203017)
  fix(ci): align update export audits with their consumers (openclaw#203030)
  fix: keep cold baseline checks within the existing heap limit

* fix(session-share): accept the runtime config snapshot in the source link resolver

The stored-session link resolver took a mutable config, so the plugin's readonly
runtime snapshot failed production and test typechecks. Accept the snapshot type.

Document the real Open original setup: allow the link command on the receiver
Gateway, set the source Control UI origin, reinstall the source node with all
three commands, then approve the widened surface. Move the section ahead of
Security boundary and add a troubleshooting entry.

Assert through the Gateway catalog list that a provider-supplied link survives
streamed and final rows, and drop the menu unit test the browser fixture covers.

* Merge remote-tracking branch 'origin/main' into land/open-original-203044

* origin/main:
  refactor(test): remove duplicate token startup wait case (openclaw#203087)
  fix: keep Plugin SDK declarations within the build limit
  fix(ci): remove unused hook type exports (openclaw#203074)
  fix(test): exercise the sign-in callback path guard (openclaw#203075)
  refactor(tts): separate caption eligibility from text helpers (openclaw#203068)
  test: reuse worker preload options (openclaw#203058)
  refactor(test): share Bun native-policy test launcher (openclaw#203064)
  fix(cron): a chat-created automation's failure notice reaches that chat (openclaw#203056)
  refactor(test): remove duplicate claw origin rejection case (openclaw#203067)
  refactor(channels): move chunk-mode lookup to streaming readers (openclaw#203047)
  refactor: separate skill queries from workspace discovery (openclaw#203045)
  fix: resume new chat turns in retained tasks after a restart
  refactor: separate usage pricing preparation from formatting (openclaw#203043)
  fix: avoid repeated filesystem probes before agent turns (openclaw#203057)
  perf(agents): preserve sealed history during endpoint compaction (openclaw#203037)
  fix(test): give deferred identity fixtures read scope (openclaw#203053)
  refactor(test): remove redundant channel catalog facade (openclaw#203052)
  refactor(cli): isolate daemon port presentation (openclaw#203020)
  refactor(cron): isolate CLI input parsing (openclaw#203031)

* chore(plugin-sdk): record the approved session-discussion surface growth

Open original adds two exports to openclaw/plugin-sdk/session-discussion: the
stored-session Control UI path resolver and the session path parser. Raise the
public export and callable budgets by two for them.

Use neutral fixtures for the rejected-origin and rejected-query URL tests so the
fixtures do not resemble credentials; the same rejections are covered.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
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: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

1 participant