Skip to content

feat(opencli): expose bundled site adapters to browser tools - #1272

Merged
Astro-Han merged 44 commits into
devfrom
codex/pr3-opencli-adapters
Jun 12, 2026
Merged

feat(opencli): expose bundled site adapters to browser tools#1272
Astro-Han merged 44 commits into
devfrom
codex/pr3-opencli-adapters

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a desktop-only deferred OpenCLI adapter group with opencli_search and opencli_run tools.
  • Loads the bundled OpenCLI manifest and command metadata, while blocking adapters that require unsupported browser internals.
  • Runs adapters against the visible embedded browser page through a narrow compatibility layer for CDP-backed file input, text insertion, native click, and timeout helpers.
  • Packages OpenCLI adapter assets and runtime dependencies with the embedded server so adapter discovery works from the built desktop artifact.

Why

The browser series needs a practical bridge from PawWork's embedded browser surface to site-specific OpenCLI adapters. This PR keeps that bridge opt-in through tool_info, exposes searchable command metadata to the model, and verifies that the built embedded server can still discover packaged adapters after bundling.

Related Issue

Refs #1186

Human Review Status

Pending

Review Focus

  • Whether the adapter execution boundary is narrow enough: argument preparation, blocked command filtering, and visible-page-only browser access.
  • Whether the capability guard is strict enough to keep unsupported OpenCLI page APIs from silently shipping.
  • Whether the desktop packaging rules include the required OpenCLI runtime assets without pulling unrelated generated artifacts into the server bundle.

Risk Notes

  • Packaging surface changed: OpenCLI and its runtime dependencies are now extra desktop resources for the embedded server.
  • Browser adapter surface changed: browser commands run only when a visible page is supplied, and unsupported daemon/Page import commands remain blocked.
  • No visible UI or copy changed, so the visual UI checklist item is not applicable.
  • No new dependency files, credentials, deletion behavior, or docs/release notes were introduced.

How To Verify

OpenCLI focused tests: 182 passed across adapter registry, runner, capability guard, permissions, tool-info, registry, build-node, and built embedded-server smoke.
packages/opencode typecheck: passed with tsgo --noEmit.
desktop packaging/build tests: 21 passed across electron-builder app-update config, electron-vite config, and embedded-server build artifact checks.
packages/desktop-electron typecheck: passed with tsgo -b.
desktop smoke: PAWWORK_CI_SMOKE_CDP=true bun run smoke:ci passed and discovered the renderer CDP target.
Diff check: no whitespace errors.
Worktree check: clean after tests and review fixes.

Screenshots or Recordings

Not applicable, no visible UI or copy changes.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

Summary by CodeRabbit

  • New Features

    • Desktop bundles OpenCLI adapters and adds two tools: search bundled site commands and run selected adapter commands (with automatic browser handling).
  • Packaging

    • Desktop build now includes OpenCLI runtime artifacts so bundled adapters run from the packaged app.
  • Permissions

    • OpenCLI tools are gated by the browser permission key; denying browser access disables them.
  • Tests

    • Added extensive tests for discovery, packaging, search, execution, capability guards, and browser integration.

@Astro-Han Astro-Han added enhancement New feature or request P0 Blocking / highest priority app Application behavior and product flows platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions harness Model harness, prompts, tool descriptions, and session mechanics labels Jun 11, 2026
@github-actions github-actions Bot removed the app Application behavior and product flows label Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 42 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cb553fe7-0c5c-4b6c-8edd-3382daa50e98

📥 Commits

Reviewing files that changed from the base of the PR and between f28128e and 222f223.

📒 Files selected for processing (17)
  • README.md
  • README_CN.md
  • THIRD_PARTY_NOTICES.md
  • packages/desktop-electron/electron-builder-app-update.test.ts
  • packages/desktop-electron/opencli-runtime.ts
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/opencli/adapter-registry.ts
  • packages/opencode/src/opencli/adapter-runner.ts
  • packages/opencode/src/tool/opencli-run.ts
  • packages/opencode/src/tool/opencli-search.ts
  • packages/opencode/test/fake/cdp-server.ts
  • packages/opencode/test/opencli/adapter-capabilities.test.ts
  • packages/opencode/test/opencli/adapter-registry.test.ts
  • packages/opencode/test/opencli/adapter-runner.test.ts
  • packages/opencode/test/opencli/opencli-contract.test.ts
  • packages/opencode/test/permission/pawwork-defaults.test.ts
  • packages/opencode/test/tool/opencli-tools.test.ts
📝 Walkthrough

Walkthrough

Adds OpenCLI runtime discovery/packaging, adapter registry and search, adapter runner with CDP-backed page fallbacks, two desktop-only tools (opencli_search, opencli_run) wired into deferred tool_info, permission mapping for opencli tools, and extensive tests including built-artifact validation.

Changes

OpenCLI Adapter Integration

Layer / File(s) Summary
Packaging & build externals
packages/opencode/script/build-node.ts, packages/desktop-electron/opencli-runtime.ts, packages/desktop-electron/electron.vite.config.ts, packages/desktop-electron/electron-builder.config.ts, tests
Adds OPENCLI_EXTERNALS for Node bundling, computes OpenCLI runtime package file-sets with filters, copies selected runtime files into Electron output during writeBundle, exposes runtime file-sets via electron-builder extraResources, and adds tests asserting externals and packaged file filters.
Adapter Registry & Search
packages/opencode/src/opencli/adapter-registry.ts, packages/opencode/test/opencli/adapter-{registry,capabilities}.test.ts
Parses cli-manifest.json, lazily loads adapter modules with failure reporting, indexes canonical/exposed commands, applies blocked-command filtering, and implements scored/deduplicated search with tests asserting manifest count, capability gaps, and search behavior.
Adapter Runner & Page adaptation
packages/opencode/src/opencli/adapter-runner.ts, packages/opencode/test/opencli/adapter-runner.test.ts
Implements argument coercion/validation, session/pre-nav helpers, run orchestration, and a page Proxy that provides CDP-backed shims (setFileInput/insertText/nativeClick) when native page APIs are missing; covered by unit tests.
Tool Integration & Surface
packages/opencode/src/tool/opencli-search.ts, packages/opencode/src/tool/opencli-run.ts, packages/opencode/src/tool/registry.ts, packages/opencode/src/tool/tool-info.ts, tests
Adds opencli_search and opencli_run tools and docs, registers them as desktop-only deferred opencli group in tool_info, wires them into ToolRegistry, maps opencli_* to browser permission gating, and adds tests for tool execution, permission gating, and registry/tool-info exposure.
End-to-End Built Artifact Test & CI
packages/opencode/test/server/built-node-opencli-adapters.test.ts, .github/workflows/windows-advisory.yml, related test updates
Builds the embedded-server artifact and runs a subprocess importing the built registry to execute opencli_search, asserting expected title/output/metadata; updates Windows CI/test invocation to include opencli tests.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Registry
  participant AdapterRunner
  participant Page
  participant Adapter

  Client->>Registry: openCliCommand(name) / searchOpenCliCommands(query)
  Registry-->>Client: CliCommand / search results
  Client->>AdapterRunner: runOpenCliAdapterCommand(cmd, page?, args)
  AdapterRunner->>AdapterRunner: prepareOpenCliCommandArgs(args)
  alt navigateBefore
    AdapterRunner->>Page: navigate(url)
  end
  alt browser mode
    AdapterRunner->>AdapterRunner: createOpenCliAdapterPage (CDP shims if needed)
    AdapterRunner->>Adapter: cmd.func(page, args) or pipeline
  else non-browser mode
    AdapterRunner->>Adapter: cmd.func(null, args)
  end
  Adapter-->>AdapterRunner: result
  AdapterRunner-->>Client: result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Astro-Han/pawwork#590: Overlaps embedded-server build test assertions around bundled artifacts in out/main/chunks.
  • Astro-Han/pawwork#146: Related Windows CI shard/test-path adjustments; overlaps updated test invocation for opencli tests.
  • Astro-Han/pawwork#1237: Related deferred-tool activation and tool_info wiring that this PR extends for desktop-only opencli tools.

Suggested labels

desktop

Poem

A rabbit hops through manifests bright,
Copies runtimes into the night,
It asks for browser keys with care,
Wraps pages with a CDP flair,
Then searches, runs — and twitches its whiskers with delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 'feat(opencli): expose bundled site adapters to browser tools' accurately and concisely describes the main objective of the PR: adding OpenCLI adapter functionality to browser tools. It is specific, uses conventional commits format, and reflects the core feature addition.
Description check ✅ Passed The PR description comprehensively follows the template with all required sections: Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, and a fully completed Checklist. It provides clear context, identifies the issue reference, explains reasoning, and includes verification results.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pr3-opencli-adapters

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions 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.

Suggested priority: P2 (includes non-doc, non-test paths outside the low-risk bucket).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request integrates OpenCLI site adapters into the PawWork desktop-electron and opencode packages, introducing the opencli_search and opencli_run tools along with their registry, runner, and testing infrastructure. The review feedback highlights several important improvements: refining commandPermissionPatterns to prevent overly restrictive browser permissions when navigateBefore is set, resolving a defaulting discrepancy for the browser property in search scoring, preventing empty strings from silently coercing to 0 for numeric arguments, and enriching the search tool's output with detailed argument metadata (types, choices, defaults, and help text) to ensure the model can successfully execute commands.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/opencode/src/tool/opencli-run.ts Outdated
Comment thread packages/opencode/src/opencli/adapter-registry.ts
Comment thread packages/opencode/src/opencli/adapter-runner.ts
Comment thread packages/opencode/src/tool/opencli-search.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
packages/opencode/src/opencli/adapter-registry.ts (1)

44-47: ⚡ Quick win

Verify package structure assumption in path navigation.

The function assumes @jackwener/opencli package structure where browser/cdp is exactly 3 directories deep from the package root. If the OpenCLI package structure changes, this will break.

Consider using a more robust resolution:

 function openCliPackageRoot() {
-  const cdp = fileURLToPath(import.meta.resolve("`@jackwener/opencli/browser/cdp`"))
-  return path.resolve(path.dirname(cdp), "../../..")
+  // Resolve package.json directly if exported, or use a well-known entrypoint
+  try {
+    return path.dirname(fileURLToPath(import.meta.resolve("`@jackwener/opencli/package.json`")))
+  } catch {
+    // Fallback to current approach
+    const cdp = fileURLToPath(import.meta.resolve("`@jackwener/opencli/browser/cdp`"))
+    return path.resolve(path.dirname(cdp), "../../..")
+  }
 }

Or verify with the package maintainer that the structure is stable.

🤖 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 `@packages/opencode/src/opencli/adapter-registry.ts` around lines 44 - 47, The
current openCliPackageRoot() assumes the package file path ends with
"browser/cdp" and walks up three directories which is fragile; change it to
resolve a stable entry such as the package manifest instead (use
import.meta.resolve("`@jackwener/opencli/package.json`") or another canonical
package entry) and compute the package root from the dirname of that resolved
file (update references to cdp/import.meta.resolve and the return logic in
openCliPackageRoot to use package.json resolution), so the root discovery does
not depend on the internal "browser/cdp" layout.
packages/opencode/test/opencli/adapter-capabilities.test.ts (1)

59-72: <!-- [scratchpad_start]
[task review_file_4/7 review_segment_2/4]
[observations]

  • packages/opencode/src/opencli/adapter-registry.ts: BLOCKED_OPENCLI_COMMANDS = new Set(["instagram/reel"]); command gating only applies to whole commands.

  • packages/opencode/test/opencli/adapter-capabilities.test.ts:

    • ACCEPTED_CAPABILITY_GAPS includes instagram/post with kind "page-method" value "closeWindow".
    • SUPPORTED_PAGE_METHODS set in the test does not include "closeWindow".
    • EXPECTED gaps are pinned via expect(gaps).toEqual(ACCEPTED_CAPABILITY_GAPS) and browser-page-import commands match BLOCKED_OPENCLI_COMMANDS.
  • packages/opencode/src/opencli/adapter-runner.ts:

    • createOpenCliAdapterPage proxy only special-cases setFileInput, insertText, nativeType, nativeClick, and waitForTimeout; it does not shim/handle closeWindow.
    • No closeWindow references found in adapter-runner.ts.
      [analysis]
  • instagram/post stays exposed because only instagram/reel is blocked at the registry level.

  • The repo treats closeWindow as an unsupported "page-method" in the capability-guard baseline; without a shim/runtime guard, invoking it depends on whether the underlying page backend provides closeWindow (otherwise it will fail).
    [pending]

  • None; enough evidence to rewrite the comment.
    [actions]

  • Rewrite to reflect: avoid recommending adding instagram/post to BLOCKED_OPENCLI_COMMANDS without design change; suggest shim or documentation consistent with existing test baseline.
    [done]
    scratchpad_end] -->
    Handle instagram/post’s unsupported closeWindow capability more explicitly.

  • BLOCKED_OPENCLI_COMMANDS only blocks instagram/reel, so instagram/post stays exposed.

  • The capability-guard test pins instagram/post’s unsupported "page-method" closeWindow (not in SUPPORTED_PAGE_METHODS), and adapter-runner.ts doesn’t shim/guard closeWindow—it will only work if the underlying page provides it.

  • Either add a closeWindow implementation/runtime capability check, or document that "page-method" gaps are intentionally tolerated while only daemon Page imports are blocked.

🤖 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 `@packages/opencode/test/opencli/adapter-capabilities.test.ts` around lines 59
- 72, The test reveals instagram/post advertises an unsupported page-method
closeWindow while only instagram/reel is blocked by BLOCKED_OPENCLI_COMMANDS;
fix by either (A) adding a shim/guard for closeWindow in
createOpenCliAdapterPage (same pattern as
setFileInput/insertText/nativeType/nativeClick) so the adapter safely handles or
no-ops that method at runtime, or (B) keep behavior explicit by updating
documentation/tests: ensure ACCEPTED_CAPABILITY_GAPS and SUPPORTED_PAGE_METHODS
reflect that closeWindow is intentionally unsupported and mention that only
commands in BLOCKED_OPENCLI_COMMANDS are gated (do not add instagram/post to
BLOCKED_OPENCLI_COMMANDS without a design change).
packages/opencode/test/tool/opencli-tools.test.ts (1)

25-35: ⚡ Quick win

Use the Effect test harness helpers instead of ad hoc runtime wiring.

This helper manually composes runtime/execution (Instance.provide + custom exec) for an Effect workflow. Please migrate this test to testEffect(...) (and fixture instance helpers like provideTmpdirInstance(...) / tmpdir) to stay aligned with the repo’s test contract.

As per coding guidelines: packages/opencode/test/**/*.test.{ts,tsx} should use testEffect(...) for Effect-based workflows and fixture helpers for instance-scoped setup.

🤖 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 `@packages/opencode/test/tool/opencli-tools.test.ts` around lines 25 - 35,
Replace the ad-hoc runtime wiring in the exec helper with the repo test harness:
remove the manual Instance.provide-based exec function and rework the test to
use testEffect(...) and the provided fixture helpers (e.g.,
provideTmpdirInstance(...) / tmpdir) to supply the instance and tmpdir;
instantiate and initialize the tool by calling the AnyToolEffect init via the
testEffect environment, then call the tool.execute within testEffect so you can
rely on the harness to provide Layer.mergeAll(Truncate.defaultLayer,
Agent.defaultLayer) and proper lifecycle management instead of calling
Instance.provide, Effect.runPromise, or using ctx directly.

Source: Coding guidelines

🤖 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 `@packages/opencode/src/opencli/adapter-registry.ts`:
- Around line 128-131: Add the module-as-namespace self-reexport at the end of
the file so consumers can import the namespace; specifically, after the existing
resetOpenCliAdaptersForTest function (and other exports like
loadOpenCliAdapters), add the line that reexports the module as AdapterRegistry:
export * as AdapterRegistry from "./adapter-registry" so callers can use
AdapterRegistry.loadOpenCliAdapters,
AdapterRegistry.resetOpenCliAdaptersForTest, etc.

In `@packages/opencode/src/opencli/adapter-runner.ts`:
- Line 210: Add a module-as-namespace self-reexport at the end of the
adapter-runner module: append an export line that re-exports the module
namespace so consumers can import the namespace and call members like
AdapterRunner.runOpenCliAdapterCommand; specifically add the statement exporting
the module as AdapterRunner (export * as AdapterRunner from "./adapter-runner")
to the bottom of the file that defines the AdapterRunner symbols.

In `@packages/opencode/src/tool/opencli-run.ts`:
- Around line 50-55: The code unconditionally requests "browser" permission via
ctx.ask even for commands with browser explicitly disabled; update the call that
yields ctx.ask in opencli-run.ts so it only includes permission: "browser" and
browserAlwaysPatterns(...) (and metadata.browser true) when command.browser !==
false (or adapter supports browser), otherwise call ctx.ask without the browser
permission/patterns or set permission to undefined; locate the ctx.ask
invocation, the variables patterns and browserAlwaysPatterns, and the
metadata.browser/command.browser usage to implement the conditional branch.

---

Nitpick comments:
In `@packages/opencode/src/opencli/adapter-registry.ts`:
- Around line 44-47: The current openCliPackageRoot() assumes the package file
path ends with "browser/cdp" and walks up three directories which is fragile;
change it to resolve a stable entry such as the package manifest instead (use
import.meta.resolve("`@jackwener/opencli/package.json`") or another canonical
package entry) and compute the package root from the dirname of that resolved
file (update references to cdp/import.meta.resolve and the return logic in
openCliPackageRoot to use package.json resolution), so the root discovery does
not depend on the internal "browser/cdp" layout.

In `@packages/opencode/test/opencli/adapter-capabilities.test.ts`:
- Around line 59-72: The test reveals instagram/post advertises an unsupported
page-method closeWindow while only instagram/reel is blocked by
BLOCKED_OPENCLI_COMMANDS; fix by either (A) adding a shim/guard for closeWindow
in createOpenCliAdapterPage (same pattern as
setFileInput/insertText/nativeType/nativeClick) so the adapter safely handles or
no-ops that method at runtime, or (B) keep behavior explicit by updating
documentation/tests: ensure ACCEPTED_CAPABILITY_GAPS and SUPPORTED_PAGE_METHODS
reflect that closeWindow is intentionally unsupported and mention that only
commands in BLOCKED_OPENCLI_COMMANDS are gated (do not add instagram/post to
BLOCKED_OPENCLI_COMMANDS without a design change).

In `@packages/opencode/test/tool/opencli-tools.test.ts`:
- Around line 25-35: Replace the ad-hoc runtime wiring in the exec helper with
the repo test harness: remove the manual Instance.provide-based exec function
and rework the test to use testEffect(...) and the provided fixture helpers
(e.g., provideTmpdirInstance(...) / tmpdir) to supply the instance and tmpdir;
instantiate and initialize the tool by calling the AnyToolEffect init via the
testEffect environment, then call the tool.execute within testEffect so you can
rely on the harness to provide Layer.mergeAll(Truncate.defaultLayer,
Agent.defaultLayer) and proper lifecycle management instead of calling
Instance.provide, Effect.runPromise, or using ctx directly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a96db0eb-ad43-4694-b323-66e08cf35167

📥 Commits

Reviewing files that changed from the base of the PR and between 6db4738 and 5892e41.

📒 Files selected for processing (21)
  • packages/desktop-electron/electron-builder-app-update.test.ts
  • packages/desktop-electron/electron-builder.config.ts
  • packages/desktop-electron/electron-vite.config.test.ts
  • packages/desktop-electron/electron.vite.config.ts
  • packages/opencode/script/build-node.ts
  • packages/opencode/src/opencli/adapter-registry.ts
  • packages/opencode/src/opencli/adapter-runner.ts
  • packages/opencode/src/tool/opencli-run.ts
  • packages/opencode/src/tool/opencli-run.txt
  • packages/opencode/src/tool/opencli-search.ts
  • packages/opencode/src/tool/opencli-search.txt
  • packages/opencode/src/tool/registry.ts
  • packages/opencode/src/tool/tool-info.ts
  • packages/opencode/test/opencli/adapter-capabilities.test.ts
  • packages/opencode/test/opencli/adapter-registry.test.ts
  • packages/opencode/test/opencli/adapter-runner.test.ts
  • packages/opencode/test/script/build-node.test.ts
  • packages/opencode/test/server/built-node-opencli-adapters.test.ts
  • packages/opencode/test/tool/opencli-tools.test.ts
  • packages/opencode/test/tool/registry.test.ts
  • packages/opencode/test/tool/tool-info.test.ts

Comment thread packages/opencode/src/opencli/adapter-registry.ts
Comment thread packages/opencode/src/opencli/adapter-runner.ts
Comment thread packages/opencode/src/tool/opencli-run.ts Outdated
@github-actions github-actions Bot added the ci Continuous integration / GitHub Actions label Jun 11, 2026
@github-actions github-actions Bot added the app Application behavior and product flows label Jun 12, 2026
Comment thread packages/opencode/test/opencli/adapter-runner.test.ts Fixed
Comment thread packages/opencode/test/opencli/adapter-runner.test.ts Fixed
Comment thread packages/opencode/test/opencli/adapter-runner.test.ts Fixed
Comment thread packages/opencode/test/tool/opencli-tools.test.ts Fixed
@Astro-Han
Astro-Han merged commit 521b01e into dev Jun 12, 2026
33 checks passed
@Astro-Han
Astro-Han deleted the codex/pr3-opencli-adapters branch June 12, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows ci Continuous integration / GitHub Actions enhancement New feature or request harness Model harness, prompts, tool descriptions, and session mechanics P0 Blocking / highest priority platform Electron shell, OS integration, packaging, updater, signing, paths, and permissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants