Skip to content

Update Linear plugin for latest OpenClaw runtime#8

Merged
calltelemetry-jason merged 1 commit into
masterfrom
fix/openclaw-latest-compat
Jun 2, 2026
Merged

Update Linear plugin for latest OpenClaw runtime#8
calltelemetry-jason merged 1 commit into
masterfrom
fix/openclaw-latest-compat

Conversation

@calltelemetry-jason

Copy link
Copy Markdown
Contributor

Summary

  • switch the plugin package entrypoint to built dist/ output and add a build script
  • pin the OpenClaw dev SDK to 2026.6.1-beta.1 for the latest runtime contract surface
  • declare startup activation, tool contracts, and CLI binary config keys in openclaw.plugin.json
  • move dispatch-history context injection from before_agent_start to before_prompt_build

Verification

  • npm run build
  • npm run typecheck
  • npm test — 42 files / 1202 tests passed
  • stable compatibility probe with openclaw@2026.5.28: npm run typecheck and npm test passed in a temp copy

Copilot AI review requested due to automatic review settings June 2, 2026 14:28
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added configurable CLI binary path settings for Codex, Claude, and Gemini tools.
    • Plugin now supports explicit startup activation so it can activate automatically on launch.
  • Chores

    • Improved build output and packaging to include compiled distribution files.
    • Updated compatibility metadata and dependency versions.

Walkthrough

The PR shifts the dispatch-history context injection to the before_prompt_build event phase, adds CLI binary path configuration fields (codexBin, claudeBin, geminiBin) to the plugin schema, and establishes a dist/ build output directory with compiled distribution and updated extension entry point.

Changes

Plugin Updates and Build Configuration

Layer / File(s) Summary
Event timing and prompt context injection
index.ts
Dispatch-history injection listener moves from before_agent_start to before_prompt_build event, with handler parameters updated to accept unused _event and ctx: any.
Plugin manifest: activation and tools
openclaw.plugin.json
Plugin manifest adds activation.onStartup: true and a contracts.tools array enumerating supported tool/diagnostic identifiers (including cli_codex, cli_claude, cli_gemini, and dispatch/agent tools).
Plugin configuration schema extension
openclaw.plugin.json
Plugin schema adds three new optional string fields—codexBin, claudeBin, and geminiBin—each specifying the path to the respective CLI binary used by diagnostic tools.
Build and distribution configuration
package.json
Build script now outputs to dist/ directory, which is added to published files; extension entry point switches from source ./index.ts to compiled ./dist/index.js; openclaw devDependency version is bumped.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hop from start to prompt with glee,
I tuck three binaries beneath a tree,
Dist/ gleams bright with compiled cheer,
The plugin wakes, the path is clear,
A little rabbit applauds this spree.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main objective: updating the Linear plugin to be compatible with the latest OpenClaw runtime, which aligns with all file changes (SDK version bump, entrypoint updates, event hook migration).
Description check ✅ Passed The description covers the four main changes and provides verification details, but omits the Testing section and incomplete Checklist from the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/openclaw-latest-compat

Comment @coderabbitai help to get the list of available commands and usage tips.

@calltelemetry-jason calltelemetry-jason force-pushed the fix/openclaw-latest-compat branch from 247e502 to f2527b4 Compare June 2, 2026 14:31

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
index.ts (1)

371-371: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Update the outdated comment.

The comment refers to "agent start" but this hook now runs during before_prompt_build.

📝 Suggested fix
-      // Never block agent start for telemetry
+      // Never block prompt build for telemetry
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@index.ts` at line 371, Update the outdated inline comment that reads "Never
block agent start for telemetry" to reference the current hook name and behavior
(e.g., "Never block before_prompt_build for telemetry" or "Never block telemetry
in before_prompt_build") so it accurately reflects that this hook runs during
before_prompt_build; modify the comment near the before_prompt_build hook
(around index.ts line where the current comment exists) to use the new wording.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 45: The package.json currently pins the openclaw dependency exactly as
"openclaw": "2026.6.1-beta.1", which prevents automatic minor/patch updates;
confirm whether this exact pin is intentional for strict beta reproducibility,
and if not, change the version string to allow semver updates (for example use
"^2026.6.1-beta.1") in package.json so the plugin will pick up compatible
patch/beta revisions—update the value associated with the "openclaw" key
accordingly.

---

Outside diff comments:
In `@index.ts`:
- Line 371: Update the outdated inline comment that reads "Never block agent
start for telemetry" to reference the current hook name and behavior (e.g.,
"Never block before_prompt_build for telemetry" or "Never block telemetry in
before_prompt_build") so it accurately reflects that this hook runs during
before_prompt_build; modify the comment near the before_prompt_build hook
(around index.ts line where the current comment exists) to use the new wording.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e5355289-2586-45d3-b657-a81a616fd0d8

📥 Commits

Reviewing files that changed from the base of the PR and between 826bc3b and 9cd5aa1.

⛔ Files ignored due to path filters (48)
  • dist/index.js is excluded by !**/dist/**
  • dist/src/agent/agent.js is excluded by !**/dist/**
  • dist/src/agent/watchdog.js is excluded by !**/dist/**
  • dist/src/api/auth.js is excluded by !**/dist/**
  • dist/src/api/linear-api.js is excluded by !**/dist/**
  • dist/src/api/oauth-callback.js is excluded by !**/dist/**
  • dist/src/gateway/dispatch-methods.js is excluded by !**/dist/**
  • dist/src/infra/cli.js is excluded by !**/dist/**
  • dist/src/infra/codex-worktree.js is excluded by !**/dist/**
  • dist/src/infra/commands.js is excluded by !**/dist/**
  • dist/src/infra/doctor.js is excluded by !**/dist/**
  • dist/src/infra/file-lock.js is excluded by !**/dist/**
  • dist/src/infra/multi-repo.js is excluded by !**/dist/**
  • dist/src/infra/notify.js is excluded by !**/dist/**
  • dist/src/infra/observability.js is excluded by !**/dist/**
  • dist/src/infra/resilience.js is excluded by !**/dist/**
  • dist/src/infra/shared-profiles.js is excluded by !**/dist/**
  • dist/src/infra/template.js is excluded by !**/dist/**
  • dist/src/infra/tmux-runner.js is excluded by !**/dist/**
  • dist/src/infra/tmux.js is excluded by !**/dist/**
  • dist/src/infra/token-refresh-timer.js is excluded by !**/dist/**
  • dist/src/infra/validation.js is excluded by !**/dist/**
  • dist/src/infra/webhook-provision.js is excluded by !**/dist/**
  • dist/src/pipeline/active-session.js is excluded by !**/dist/**
  • dist/src/pipeline/artifacts.js is excluded by !**/dist/**
  • dist/src/pipeline/dag-dispatch.js is excluded by !**/dist/**
  • dist/src/pipeline/dispatch-service.js is excluded by !**/dist/**
  • dist/src/pipeline/dispatch-state.js is excluded by !**/dist/**
  • dist/src/pipeline/guidance.js is excluded by !**/dist/**
  • dist/src/pipeline/intent-classify.js is excluded by !**/dist/**
  • dist/src/pipeline/pipeline.js is excluded by !**/dist/**
  • dist/src/pipeline/planner.js is excluded by !**/dist/**
  • dist/src/pipeline/planning-state.js is excluded by !**/dist/**
  • dist/src/pipeline/taskflow-bridge.js is excluded by !**/dist/**
  • dist/src/pipeline/tier-assess.js is excluded by !**/dist/**
  • dist/src/pipeline/webhook.js is excluded by !**/dist/**
  • dist/src/tools/claude-tool.js is excluded by !**/dist/**
  • dist/src/tools/cli-shared.js is excluded by !**/dist/**
  • dist/src/tools/code-tool.js is excluded by !**/dist/**
  • dist/src/tools/codex-tool.js is excluded by !**/dist/**
  • dist/src/tools/dispatch-history-tool.js is excluded by !**/dist/**
  • dist/src/tools/gemini-tool.js is excluded by !**/dist/**
  • dist/src/tools/linear-issues-tool.js is excluded by !**/dist/**
  • dist/src/tools/orchestration-tools.js is excluded by !**/dist/**
  • dist/src/tools/planner-tools.js is excluded by !**/dist/**
  • dist/src/tools/steering-tools.js is excluded by !**/dist/**
  • dist/src/tools/tools.js is excluded by !**/dist/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • index.ts
  • openclaw.plugin.json
  • package.json

Comment thread package.json
"@vitest/coverage-v8": "^4.0.18",
"commander": "^14.0.3",
"openclaw": "^2026.5.9-beta.1",
"openclaw": "2026.6.1-beta.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Confirm that pinning to exact beta version is intentional.

The openclaw dependency changed from ^2026.5.9-beta.1 to 2026.6.1-beta.1 (caret removed). Pinning to an exact version prevents automatic minor/patch updates. This is appropriate for beta compatibility but means the plugin won't automatically pick up patches like 2026.6.1-beta.2.

Is this exact pinning intentional, or should it be ^2026.6.1-beta.1 to allow patch updates within the same minor version?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 45, The package.json currently pins the openclaw
dependency exactly as "openclaw": "2026.6.1-beta.1", which prevents automatic
minor/patch updates; confirm whether this exact pin is intentional for strict
beta reproducibility, and if not, change the version string to allow semver
updates (for example use "^2026.6.1-beta.1") in package.json so the plugin will
pick up compatible patch/beta revisions—update the value associated with the
"openclaw" key accordingly.

Copilot AI 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.

Pull request overview

Updates the Linear integration plugin to align with the latest OpenClaw runtime contract, switching the plugin entrypoint to built dist/ output and expanding the declared plugin contracts/config surface.

Changes:

  • Package now ships/loads compiled dist/ output and pins the OpenClaw dev SDK to 2026.6.1-beta.1.
  • Declares startup activation + tool contracts and adds new plugin config keys in openclaw.plugin.json.
  • Adds/updates compiled runtime code for dispatch lifecycle, planning tools, CLI backends, and observability helpers.

Reviewed changes

Copilot reviewed 4 out of 52 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Switches extension entrypoint to dist/ and adds a build script / SDK pin.
openclaw.plugin.json Declares activation, tool contracts, and additional config schema keys.
index.ts Moves dispatch-history context injection to before_prompt_build.
dist/src/tools/tools.js Registers the plugin’s tool set (code/orchestration/issues/steering).
dist/src/tools/steering-tools.js Adds tmux steering tools (steer/capture/abort).
dist/src/tools/planner-tools.js Adds planning tools + plan snapshot/audit helpers.
dist/src/tools/orchestration-tools.js Adds agent delegation tools (spawn_agent, ask_agent).
dist/src/tools/linear-issues-tool.js Adds direct Linear issue management tool (linear_issues).
dist/src/tools/gemini-tool.js Implements Gemini CLI runner with streaming + tmux support.
dist/src/tools/dispatch-history-tool.js Adds dispatch history search tool over state + memory files.
dist/src/tools/codex-tool.js Implements Codex CLI runner with streaming + tmux support.
dist/src/tools/code-tool.js Implements backend selection + tool wrappers for CLI coding tools.
dist/src/tools/cli-shared.js Adds shared helpers for CLI runners (session/prompt/progress).
dist/src/tools/claude-tool.js Implements Claude CLI runner with streaming + tmux support.
dist/src/pipeline/tier-assess.js Adds LLM-based issue tier assessment with fallback logic.
dist/src/pipeline/taskflow-bridge.js Bridges dispatch lifecycle into OpenClaw durable task-flow API.
dist/src/pipeline/planning-state.js Adds file-backed planning session state with locking.
dist/src/pipeline/planner.js Adds planning session orchestration + cross-model review flow.
dist/src/pipeline/intent-classify.js Adds intent classification for comment routing and planning control.
dist/src/pipeline/guidance.js Extracts/caches workspace guidance and formats prompt appendix.
dist/src/pipeline/dispatch-state.js Adds persistent dispatch state v2 + CAS transitions and session map.
dist/src/pipeline/dispatch-service.js Adds background monitor for stale/zombie dispatch detection + pruning.
dist/src/pipeline/dag-dispatch.js Adds DAG-based project dispatch queue/state scaffolding.
dist/src/pipeline/artifacts.js Adds .claw/ artifact conventions and dispatch memory writing.
dist/src/pipeline/active-session.js Tracks active sessions + issue-agent affinity and hydration on startup.
dist/src/infra/webhook-provision.js Adds webhook provisioning/inspection helpers.
dist/src/infra/validation.js Adds shared ID validation + prompt sanitization helper.
dist/src/infra/token-refresh-timer.js Adds proactive OAuth token refresh timer.
dist/src/infra/tmux.js Adds tmux availability + session naming + shell escaping helpers.
dist/src/infra/tmux-runner.js Adds tmux-based runner with JSONL tailing + completion detection.
dist/src/infra/template.js Adds shared {{key}} template rendering helper.
dist/src/infra/shared-profiles.js Consolidates agent profile loading/resolution and validation helpers.
dist/src/infra/resilience.js Adds retry + circuit breaker wrappers for external calls.
dist/src/infra/observability.js Adds diagnostic log emitter.
dist/src/infra/notify.js Adds unified notification routing (in-process + CLI fallback).
dist/src/infra/multi-repo.js Adds multi-repo resolution for dispatches.
dist/src/infra/file-lock.js Adds shared file lock implementation for state files.
dist/src/infra/commands.js Adds /dispatch command handlers (list/status/retry/escalate).
dist/src/infra/codex-worktree.js Adds worktree management + PR creation helpers.
dist/src/gateway/dispatch-methods.js Adds gateway RPC methods for dispatch lifecycle management.
dist/src/api/oauth-callback.js Adds OAuth callback handler and token storage.
dist/src/api/auth.js Adds Linear auth provider registration and token refresh helper.
dist/src/agent/watchdog.js Adds inactivity watchdog + per-agent watchdog config resolution.
dist/src/agent/agent.js Adds agent runner with embedded streaming + read-only enforcement + retries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines 24 to 30
"files": [
"index.ts",
"dist/",
"src/",
"openclaw.plugin.json",
"prompts.yaml",
"README.md"
],

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
index.ts (1)

451-453: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider using absolute paths or validating CLI binary paths.

The CLI binary paths default to ~/.npm-global/bin/<name>, but this directory may not exist on all systems. The current implementation checks availability at startup (lines 456-475), which is good, but it might be clearer to use process.env.PATH-based resolution or require absolute paths in the config.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@index.ts` around lines 451 - 453, The plugin CLI entries currently use a
default relative/home-based bin path via defaultBinDir and pluginConfig (e.g.,
the "codex"/"claude"/"gemini" array items) which may not exist on all systems;
update the resolution to require/normalize absolute paths by expanding "~" and
calling path.resolve on pluginConfig.*Bin if provided, otherwise resolve the
binary via process.env.PATH (using a "which" lookup or fs.existsSync on
candidate paths) before accepting it, and add validation logic in the existing
startup availability check (the code that verifies binaries at boot) to fail
fast with a clear error if neither an absolute path nor a PATH-resolvable binary
is found; ensure you reference and update the places that construct those array
entries (using defaultBinDir and pluginConfig.*Bin) so configs must supply
absolute paths or the code auto-resolves via PATH.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@index.ts`:
- Around line 451-453: The plugin CLI entries currently use a default
relative/home-based bin path via defaultBinDir and pluginConfig (e.g., the
"codex"/"claude"/"gemini" array items) which may not exist on all systems;
update the resolution to require/normalize absolute paths by expanding "~" and
calling path.resolve on pluginConfig.*Bin if provided, otherwise resolve the
binary via process.env.PATH (using a "which" lookup or fs.existsSync on
candidate paths) before accepting it, and add validation logic in the existing
startup availability check (the code that verifies binaries at boot) to fail
fast with a clear error if neither an absolute path nor a PATH-resolvable binary
is found; ensure you reference and update the places that construct those array
entries (using defaultBinDir and pluginConfig.*Bin) so configs must supply
absolute paths or the code auto-resolves via PATH.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 75f2033b-c96c-4246-a05a-e9d5242fe4bb

📥 Commits

Reviewing files that changed from the base of the PR and between 9cd5aa1 and f2527b4.

⛔ Files ignored due to path filters (48)
  • dist/index.js is excluded by !**/dist/**
  • dist/src/agent/agent.js is excluded by !**/dist/**
  • dist/src/agent/watchdog.js is excluded by !**/dist/**
  • dist/src/api/auth.js is excluded by !**/dist/**
  • dist/src/api/linear-api.js is excluded by !**/dist/**
  • dist/src/api/oauth-callback.js is excluded by !**/dist/**
  • dist/src/gateway/dispatch-methods.js is excluded by !**/dist/**
  • dist/src/infra/cli.js is excluded by !**/dist/**
  • dist/src/infra/codex-worktree.js is excluded by !**/dist/**
  • dist/src/infra/commands.js is excluded by !**/dist/**
  • dist/src/infra/doctor.js is excluded by !**/dist/**
  • dist/src/infra/file-lock.js is excluded by !**/dist/**
  • dist/src/infra/multi-repo.js is excluded by !**/dist/**
  • dist/src/infra/notify.js is excluded by !**/dist/**
  • dist/src/infra/observability.js is excluded by !**/dist/**
  • dist/src/infra/resilience.js is excluded by !**/dist/**
  • dist/src/infra/shared-profiles.js is excluded by !**/dist/**
  • dist/src/infra/template.js is excluded by !**/dist/**
  • dist/src/infra/tmux-runner.js is excluded by !**/dist/**
  • dist/src/infra/tmux.js is excluded by !**/dist/**
  • dist/src/infra/token-refresh-timer.js is excluded by !**/dist/**
  • dist/src/infra/validation.js is excluded by !**/dist/**
  • dist/src/infra/webhook-provision.js is excluded by !**/dist/**
  • dist/src/pipeline/active-session.js is excluded by !**/dist/**
  • dist/src/pipeline/artifacts.js is excluded by !**/dist/**
  • dist/src/pipeline/dag-dispatch.js is excluded by !**/dist/**
  • dist/src/pipeline/dispatch-service.js is excluded by !**/dist/**
  • dist/src/pipeline/dispatch-state.js is excluded by !**/dist/**
  • dist/src/pipeline/guidance.js is excluded by !**/dist/**
  • dist/src/pipeline/intent-classify.js is excluded by !**/dist/**
  • dist/src/pipeline/pipeline.js is excluded by !**/dist/**
  • dist/src/pipeline/planner.js is excluded by !**/dist/**
  • dist/src/pipeline/planning-state.js is excluded by !**/dist/**
  • dist/src/pipeline/taskflow-bridge.js is excluded by !**/dist/**
  • dist/src/pipeline/tier-assess.js is excluded by !**/dist/**
  • dist/src/pipeline/webhook.js is excluded by !**/dist/**
  • dist/src/tools/claude-tool.js is excluded by !**/dist/**
  • dist/src/tools/cli-shared.js is excluded by !**/dist/**
  • dist/src/tools/code-tool.js is excluded by !**/dist/**
  • dist/src/tools/codex-tool.js is excluded by !**/dist/**
  • dist/src/tools/dispatch-history-tool.js is excluded by !**/dist/**
  • dist/src/tools/gemini-tool.js is excluded by !**/dist/**
  • dist/src/tools/linear-issues-tool.js is excluded by !**/dist/**
  • dist/src/tools/orchestration-tools.js is excluded by !**/dist/**
  • dist/src/tools/planner-tools.js is excluded by !**/dist/**
  • dist/src/tools/steering-tools.js is excluded by !**/dist/**
  • dist/src/tools/tools.js is excluded by !**/dist/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .github/dependabot.yml
  • index.ts
  • openclaw.plugin.json
  • package.json

@calltelemetry-jason calltelemetry-jason merged commit d5a5b25 into master Jun 2, 2026
4 checks passed
@calltelemetry-jason calltelemetry-jason deleted the fix/openclaw-latest-compat branch June 2, 2026 14:36
@sentry

sentry Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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