Skip to content

CI: add built plugin singleton smoke#48710

Merged
Takhoffman merged 1 commit intomainfrom
codex/build-smoke-main
Mar 17, 2026
Merged

CI: add built plugin singleton smoke#48710
Takhoffman merged 1 commit intomainfrom
codex/build-smoke-main

Conversation

@Takhoffman
Copy link
Copy Markdown
Contributor

Summary

  • Problem: the existing source-level tests covered the dist-runtime singleton fix, but CI did not run a post-build smoke that proves bundled plugins loaded from dist-runtime still register commands onto the canonical built runtime graph.
  • Why it matters: the original regression broke bundled plugin commands like /pair, /phone, and /voice in built environments. Without a built smoke, future build-layout or loader changes could regress that path without being caught by unit tests alone.
  • What changed: renamed the post-build startup-memory lane to build-smoke, added pnpm test:build:singleton, added a stable built smoke entrypoint at dist/plugins/build-smoke-entry.js, and added a smoke script that stages a temp bundled plugin through dist-runtime, imports openclaw/plugin-sdk, loads it through the built loader, and asserts the canonical built command registry sees /pair.
  • What did NOT change (scope boundary): this does not change plugin runtime behavior, plugin manifests, or command semantics outside of adding a stronger CI regression check.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • None.

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 25 / local repo build
  • Model/provider: N/A
  • Integration/channel (if any): bundled plugins, dist-runtime build smoke
  • Relevant config (redacted): local repo build with default dist/ and dist-runtime/

Steps

  1. Run pnpm build.
  2. Run pnpm test:build:singleton.
  3. Run pnpm test:startup:memory.

Expected

  • The built smoke entrypoint is emitted into dist/plugins/build-smoke-entry.js.
  • A temp bundled plugin loaded from dist-runtime through the built loader can import openclaw/plugin-sdk and still register /pair onto the canonical built command registry.
  • The existing startup memory smoke still passes under the renamed post-build lane.

Actual

  • pnpm build emitted the stable smoke entrypoint.
  • pnpm test:build:singleton passed and verified the built loader + canonical command registry path.
  • pnpm test:startup:memory passed after the lane rename.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: ran pnpm build; verified dist/plugins/build-smoke-entry.js exists; ran pnpm test:build:singleton; ran pnpm test:startup:memory.
  • Edge cases checked: the singleton smoke fixture now imports openclaw/plugin-sdk so the check covers the built root-alias/native-loading path in addition to canonical command registration.
  • What you did not verify: I did not run a live Telegram session or other channel end-to-end flow; this PR is limited to a post-build regression smoke.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert this PR, or remove the new pnpm test:build:singleton step from the build-smoke lane.
  • Files/config to restore: .github/workflows/ci.yml, package.json, tsdown.config.ts, src/plugins/build-smoke-entry.ts, scripts/test-built-plugin-singleton.mjs
  • Known bad symptoms reviewers should watch for: build smoke failing to locate the stable built entrypoint, the bundled temp plugin failing to import openclaw/plugin-sdk, or /pair not appearing in the canonical built command registry during the smoke.

Risks and Mitigations

  • Risk: the new smoke could become coupled to build internals and fail on unrelated bundle-layout churn.

  • Mitigation: the smoke now imports a stable source-owned built entrypoint (dist/plugins/build-smoke-entry.js) rather than scraping hashed chunks.

  • Risk: the smoke could prove only direct api.registerCommand behavior and miss the built openclaw/plugin-sdk alias path.

  • Mitigation: the fixture imports openclaw/plugin-sdk and uses emptyPluginConfigSchema(), so the smoke covers the actual alias/native-loading path involved in the original regression.

@openclaw-barnacle openclaw-barnacle bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Mar 17, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 17, 2026

Greptile Summary

This PR adds a post-build singleton smoke test (scripts/test-built-plugin-singleton.mjs) that verifies bundled plugins loaded from dist-runtime correctly register commands onto the canonical built runtime command registry. It also renames the startup-memory CI job to build-smoke and adds a new stable built entrypoint (src/plugins/build-smoke-entry.ts) compiled into dist/plugins/build-smoke-entry.js. The approach is sound — the test genuinely covers the openclaw/plugin-sdk alias/native-loading path involved in the original regression — but two points deserve attention before merging:

  • CI job rename (startup-memorybuild-smoke): If the old job name was a required status check in the main branch protection rules, this rename will block open and future PRs until the protection rule is updated. Verify (and update if necessary) the branch protection configuration atomically with this change.
  • Smoke artifact in published package: plugins/build-smoke-entry is added to tsdown.config.ts's core dist entries, which means dist/plugins/build-smoke-entry.js is emitted during pnpm build and then included in the published npm package (the files field in package.json includes all of dist/). This CI-only test artifact re-exports internal symbols with no corresponding exports map entry. Consider adding "!dist/plugins/build-smoke-entry.js" to the files array.

Confidence Score: 3/5

  • Safe to merge after verifying the branch protection rule rename; the smoke artifact in the published package is a quality concern but not a blocker.
  • The smoke test logic is correct and the intent is well-motivated. However, the startup-memorybuild-smoke job rename could break required status checks for the main branch (an operational risk that may block other PRs) if not handled in tandem. The inclusion of a CI test artifact in the published npm package is a secondary quality issue. Neither is a runtime regression risk.
  • .github/workflows/ci.yml (job rename / branch protection check) and tsdown.config.ts (smoke artifact published to npm)
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 305-306

Comment:
**Job rename may break branch protection required status checks**

Renaming the job from `startup-memory` to `build-smoke` changes the status check name that GitHub surfaces in branch protection rules. If `startup-memory` was listed as a required status check for merging into `main`, any open PRs will be blocked (showing "startup-memory — Expected — Waiting for status to be reported") and new PRs won't be mergeable until the branch protection rule is updated to reference `build-smoke` instead.

Please verify that the branch protection configuration for `main` is updated atomically with this rename, or that `startup-memory` was not a required check.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tsdown.config.ts
Line: 174

Comment:
**Smoke test artifact included in published npm package**

`dist/plugins/build-smoke-entry.js` will be included in the published npm package because `package.json`'s `files` array includes `"dist/"` without any exclusion for this path. This is a CI-only test artifact — it re-exports internal symbols (`clearPluginCommands`, `executePluginCommand`, `getPluginCommandSpecs`, `matchPluginCommand`, `loadOpenClawPlugins`) from `commands.js` and `loader.js`, which aren't intended as public API. There's also no corresponding entry in `package.json`'s `exports` map, so while it isn't addressable as a package export, it still adds dead weight and exposes internal structure in every published version.

Consider either:
- Adding `"!dist/plugins/build-smoke-entry.js"` to the `files` array in `package.json`, or
- Moving the entry file to a location that's excluded from the publish set (e.g. a separate `smoke/` directory negated in `files`).

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 99f1b38

@Takhoffman Takhoffman force-pushed the codex/build-smoke-main branch from 650cce5 to c3aa2e6 Compare March 17, 2026 04:51
@openclaw-barnacle openclaw-barnacle bot added commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling size: M and removed size: S labels Mar 17, 2026
@Takhoffman Takhoffman force-pushed the codex/build-smoke-main branch 2 times, most recently from ea17a2b to 012d272 Compare March 17, 2026 05:21
@Takhoffman Takhoffman force-pushed the codex/build-smoke-main branch from 012d272 to d07e93e Compare March 17, 2026 19:19
@openclaw-barnacle openclaw-barnacle bot added size: S and removed commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling size: M labels Mar 17, 2026
@Takhoffman Takhoffman merged commit 5a2a4ab into main Mar 17, 2026
28 of 40 checks passed
@Takhoffman Takhoffman deleted the codex/build-smoke-main branch March 17, 2026 20:17
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Mar 17, 2026
* main: (142 commits)
  fix(zalouser): fix setup-only onboarding flow (openclaw#49219)
  CI: add built plugin singleton smoke (openclaw#48710)
  update contributing focus areas
  docs(providers): clarify provider capabilities vs public capability model
  docs(refactor): align plugin SDK plan with public capability model
  docs(cli): add plugins inspect command reference
  docs(plugins): document public capability model, plugin shapes, and inspection
  Plugins: internalize diagnostics OTel imports
  Plugins: internalize diffs SDK imports
  Plugins: internalize more extension SDK imports
  Plugins: add local extension API barrels
  Plugins: add inspect matrix and trim export
  Plugins: add inspect command and capability report
  fix(telegram): unify transport fallback chain (openclaw#49148)
  Plugins: add binding resolution callbacks (openclaw#48678)
  fix(gateway): clear trusted-proxy control ui scopes
  refactor: narrow extension public seams
  test: stabilize memory async search close
  docs(hooks): clarify trust model and audit guidance
  feat(mattermost): add retry logic and timeout handling for DM channel creation (openclaw#42398)
  ...
nikolaisid pushed a commit to nikolaisid/openclaw that referenced this pull request Mar 18, 2026
brandontyler pushed a commit to brandontyler/clawdbot that referenced this pull request Mar 19, 2026
pholpaphankorn pushed a commit to pholpaphankorn/openclaw that referenced this pull request Mar 22, 2026
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 25, 2026
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 25, 2026
* fix(ci): stop serializing push workflow runs

(cherry picked from commit 0a20c5c)

* test: harden path resolution test helpers

(cherry picked from commit 1ad47b8)

* Fix launcher startup regressions (openclaw#48501)

* Fix launcher startup regressions

* Fix CI follow-up regressions

* Fix review follow-ups

* Fix workflow audit shell inputs

* Handle require resolve gaxios misses

(cherry picked from commit 313e5bb)

* refactor(scripts): move container setup entrypoints

(cherry picked from commit 46ccbac)

* perf(ci): gate install smoke on changed-smoke (openclaw#52458)

(cherry picked from commit 4bd90f2)

* Docs: prototype generated plugin SDK reference (openclaw#51877)

* Chore: unblock synced main checks

* Docs: add plugin SDK docs implementation plan

* Docs: scaffold plugin SDK reference phase 1

* Docs: mark plugin SDK reference surfaces unstable

* Docs: prototype generated plugin SDK reference

* docs(plugin-sdk): replace generated reference with api baseline

* docs(plugin-sdk): drop generated reference plan

* docs(plugin-sdk): align api baseline flow with config docs

---------

Co-authored-by: Onur <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 4f1e12a)

* fix(ci): harden docker builds and unblock config docs

(cherry picked from commit 9f08af1)

* Docs: add config drift baseline statefile (openclaw#45891)

* Docs: add config drift statefile generator

* Docs: generate config drift baseline

* CI: move config docs drift runner into workflow sanity

* Docs: emit config drift baseline json

* Docs: commit config drift baseline json

* Docs: wire config baseline into release checks

* Config: fix baseline drift walker coverage

* Docs: regenerate config drift baselines

(cherry picked from commit cbec476)

* Release: add plugin npm publish workflow (openclaw#47678)

* Release: add plugin npm publish workflow

* Release: make plugin publish scope explicit

(cherry picked from commit d41c9ad)

* build: default to Node 24 and keep Node 22 compat

(cherry picked from commit deada7e)

* ci(android): use explicit flavor debug tasks

(cherry picked from commit 0c2e6fe)

* ci: harden pnpm sticky cache on PRs

(cherry picked from commit 29b36f8)

* CI: add built plugin singleton smoke (openclaw#48710)

(cherry picked from commit 5a2a4ab)

* chore: add code owners for npm release paths

(cherry picked from commit 5c9fae5)

* test add extension plugin sdk boundary guards

(cherry picked from commit 77fb258)

* ci: tighten cache docs and node22 gate

(cherry picked from commit 797b6fe)

* ci: add npm release workflow and CalVer checks (openclaw#42414) (thanks @onutc)

(cherry picked from commit 8ba1b6e)

* CI: add CLI startup memory regression check

(cherry picked from commit c0e0115)

* Add bad-barnacle label to prevent barnacle closures. (openclaw#51945)

(cherry picked from commit c449a0a)

* ci: speed up scoped workflow lanes

(cherry picked from commit d17490f)

* ci: restore PR pnpm cache fallback

(cherry picked from commit e1d0545)

* CI: guard gateway watch against duplicate runtime regressions (openclaw#49048)

(cherry picked from commit f036ed2)

* fix: correct domain reference in docker setup script

* fix: adapt cherry-picks for fork TS strictness

* fix: adapt cherry-picked tests for fork structure

- Dockerfile test: OPENCLAW_ → REMOTECLAW_ ARG names
- ci-changed-scope test: add missing runChangedSmoke field
- doc-baseline test: rename to e2e (needs dist/ build artifacts)
- extension boundary test: update baselines and expectations for fork

* fix: adjust ci-changed-scope test for fork's narrower skills regex

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Co-authored-by: Bob <[email protected]>
Co-authored-by: Onur <[email protected]>
Co-authored-by: Altay <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Onur Solmaz <[email protected]>
Co-authored-by: Harold Hunt <[email protected]>
ralyodio pushed a commit to ralyodio/openclaw that referenced this pull request Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant