Skip to content

move openclaw tlon plugin to the monorepo#5930

Open
patosullivan wants to merge 6 commits into
developfrom
po/move-openclaw-tlon-plugin-to-monorepo
Open

move openclaw tlon plugin to the monorepo#5930
patosullivan wants to merge 6 commits into
developfrom
po/move-openclaw-tlon-plugin-to-monorepo

Conversation

@patosullivan

Copy link
Copy Markdown
Member

Summary

Moves the Tlon plugin for OpenClaw (@tloncorp/openclaw, npm v0.4.3) from the standalone tloncorp/openclaw-tlon repo into this monorepo at packages/openclaw, following the tlon-skill import precedent (#5892) and the plan in packages/tlon-skill/MONOREPO_PROPOSAL.md. The plugin's two Tlon dependencies (@tloncorp/api, @tloncorp/tlon-skill) already live here; this removes the stale npm dist-tag pin on @tloncorp/api (presence = 0.0.7) and ends the need for multi-PR cross-repo changes. Source: openclaw-tlon master @ 9871a16e3c76f0558d4e85935a7dbea415362534 (flat copy, no history rewrite).

Changes

Structured as 5 commits, best reviewed in order:

  1. import openclaw-tlon plugin into monorepo: faithful flat copy (139 files). Dropped repo-level files that don't apply here: lockfiles, pnpm-workspace.yaml, .tool-versions, oxlint/oxfmt configs, .npmignore, old GitHub workflows, and npm-link dev scripts (obsoleted by workspace deps).
  2. openclaw: reformat with monorepo prettier: mechanical reformat only (108 files), plus regenerated .prettierignore.
  3. openclaw: convert package to monorepo conventions: the substantive diff.
    • Tlon deps switched to workspace:^.
    • New scripts/resolve-workspace-deps.mjs rewrites workspace specs to concrete semver in publish staging and Docker container installs (npm publish and bare-mounted containers don't understand the workspace protocol); prepare-publish-package.js resolves and fails on any leftover workspace: spec.
    • Dev/test Docker entrypoints copy the plugin to /workspace/tlon before installing, since workspace deps can't be installed from a bare package mount, and this avoids mutating the host checkout.
    • Restored package .npmrc (node-linker=hoisted, required for tlon-skill binary hydration in standalone container installs).
    • Vitest config split: default config covers src/ only so the monorepo recursive test sweep never touches Docker integration tests; the integration suite uses vitest.integration.config.ts.
    • ESLint/Prettier scripts replace oxlint/oxfmt; path fixes for the new location (TLONBOT_DIR defaults to a sibling of the monorepo root, tlon-apps/tlon-skill overrides come from the containing repo).
  4. openclaw: wire into monorepo root; fix build/lint under workspace deps: root build:openclaw script; pinned vite ^8 in devDeps (vitest 4 declares vite as a peer and pnpm satisfied it with the hoisted workspace vite 5, which lacks the module-runner export and crashed on startup); adapted src/monitor/media.ts to @tloncorp/api 0.0.8, whose post-blob union gained the a2ui entry type (skipped in attachment downloads; generated openclaw.plugin.json is byte-identical so the config schema is unchanged); fixed an import cycle in test/lib and two prefer-const errors; root .eslintrc.cjs scopes no-inner-declarations off for packages/openclaw (legal block-scoped ESM declarations; avoids churning the monitor loop while old-repo PRs are still being ported).
  5. ci: add path-filtered OpenClaw plugin workflow: .github/workflows/openclaw-ci.yml runs on PRs touching packages/openclaw, packages/api, or packages/tlon-skill, porting the old repo's unit + security test and Docker integration jobs. The integration job's TEST_STORAGE_* env vars map onto the E2E_S3_* secrets this repo already has for the tlon-web e2e suite (same S3-compatible ship-storage setup); .env.example and test/README.md document the mapping (plus remaining tlonbot-path doc fixes).

How did I test?

  • pnpm install clean (postinstall generates src/version.generated.ts)
  • pnpm --filter @tloncorp/openclaw build clean; regenerated openclaw.plugin.json byte-identical to the old repo's
  • 558/558 unit tests pass; simulated the root recursive test sweep and confirmed it excludes test/cases/
  • pnpm -r tsc (package) clean; lint 0 errors; prettier check and prettierignore idempotence pass
  • Packed tarball diffed against published @tloncorp/openclaw@0.4.3: file list identical except dist/src/shared-state.js (added on master post-0.4.3); package.json differs only in the repository field, dep specs (presence tag to ^0.0.8, ^0.3.6 to ^0.4.0), publishConfig, and the openclaw peer range master had already bumped; zero workspace: strings
  • bash -n on all modified shell scripts; docker compose config validation for dev/test/local compose files
  • Full Docker integration suite run locally (pnpm test:integration with .env credentials): all green — validates the new copy-to-/workspace/tlon + workspace-dep-resolution entrypoint flow end to end

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area:
    • Other: OpenClaw plugin (new packages/openclaw), CI workflows, root ESLint config

Known gaps and follow-ups:

  • All secrets the integration job needs are now configured in this repo: OPENROUTER_API_KEY and E2E_S3_* already existed, and TLONBOT_TOKEN (fresh fine-grained PAT scoped to tloncorp/tlonbot, Contents: read) and BRAVE_API_KEY were added for this PR. This PR's CI run is the first live validation of the E2E_S3_*TEST_STORAGE_* mapping against the shared bucket.
  • @tloncorp/api jumps from 0.0.7 (presence dist-tag) to 0.0.8. The only type-level impact found was the a2ui blob entry (handled), but api owners should confirm 0.0.8 supersedes the presence dist-tag features.
  • Dev-container regression: the container copy has no .git, so PLUGIN_COMMIT reports "unknown" in dev containers. CI publishes still get the real SHA.
  • Publishing, deploy (ship restarts), and tlonbot smoke-dispatch workflows are follow-up PRs. The npm Trusted Publisher must be re-pointed to tloncorp/tlon-apps before the first monorepo publish. The old repo stays open during a transition window with 7 open PRs to land or port (sync recipe: copy changed files from the old repo at the merge commit, prettier --write, review the reduced diff).

Rollback plan

Revert.

Flat copy of tloncorp/openclaw-tlon@9871a16
into packages/openclaw, following the tlon-skill import precedent (db3477d).

Dropped at import: standalone lockfiles and pnpm-workspace.yaml, .npmrc and
.tool-versions (root governs), oxlint/oxfmt configs (converting to
ESLint/Prettier), .npmignore (publish stages through .publish/), .github
workflows (ported separately), and the dev npm-link scripts for
@tloncorp/api / @tloncorp/tlon-skill (obsoleted by workspace deps).
Mechanical reformat (quotes, import sorting) — no logic changes.
- @tloncorp/api (was npm dist-tag 'presence') and @tloncorp/tlon-skill now
  resolve via workspace:^; add scripts/resolve-workspace-deps.mjs to
  substitute concrete versions wherever the package.json leaves the
  workspace (publish staging, Docker container installs)
- prepare-publish-package.js resolves workspace deps into .publish/ and
  fails on any leftover workspace: spec
- dev/test entrypoints copy the plugin to /workspace/tlon (container-local)
  before installing, since workspace deps can't resolve from the bare
  package mount; node_modules volumes repointed accordingly
- restore package .npmrc (node-linker=hoisted) — required by the standalone
  container installs for tlon-skill binary hydration
- split vitest config: default covers src/ only (keeps the monorepo's
  recursive test sweep away from Docker integration tests); integration
  suite moves to vitest.integration.config.ts
- lint/format scripts now use monorepo ESLint/Prettier; drop oxlint/oxfmt
- repoint tlonbot/tlon-apps/tlon-skill path assumptions for the new
  location (TLONBOT_DIR defaults to a checkout next to the monorepo root;
  api/skill overrides come from the containing repo)
- update repository field, drop packageManager, add publishConfig
- root build:openclaw script; lockfile picks up the new package
- pin vite ^8 in openclaw devDeps: vitest 4 declares vite as a peer and
  pnpm would otherwise satisfy it with the workspace's hoisted vite 5,
  which lacks the module-runner export vitest needs
- adapt src/monitor/media.ts to @tloncorp/api 0.0.8 (workspace), whose
  post-blob union gained the a2ui entry type (no fileUri/size/name):
  skip a2ui in attachment downloads
- fix import cycle in test/lib (fixtures -> index -> fixtures) and two
  prefer-const errors surfaced by the ESLint conversion
- root .eslintrc.cjs: scope no-inner-declarations off for the package
  (legal block-scoped ESM declarations; avoids churning the monitor loop
  while openclaw-tlon PRs are still being ported over)
Port of openclaw-tlon's ci.yml: unit + security tests and the Docker
integration suite, running only on PRs that touch the plugin or its
workspace deps (packages/api, packages/tlon-skill).

The integration job's TEST_STORAGE_* env vars map onto the E2E_S3_*
secrets already configured for the tlon-web e2e suite (same
S3-compatible ship-storage setup); only OPENROUTER_API_KEY,
TLONBOT_TOKEN, and BRAVE_API_KEY need to be added to this repo.
@patosullivan patosullivan changed the title Po/move openclaw tlon plugin to monorepo move openclaw tlon plugin to the monorepo Jun 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22a6ec3b73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/openclaw/src/urbit/send.ts
# Conflicts:
#	pnpm-lock.yaml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a503703eca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/openclaw/src/monitor/media.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants