Skip to content

feat(tool): add experimental rlm_repl tool#29018

Open
BowTiedSwan wants to merge 2 commits into
anomalyco:devfrom
BowTiedSwan:continue-rlm-repl
Open

feat(tool): add experimental rlm_repl tool#29018
BowTiedSwan wants to merge 2 commits into
anomalyco:devfrom
BowTiedSwan:continue-rlm-repl

Conversation

@BowTiedSwan
Copy link
Copy Markdown

@BowTiedSwan BowTiedSwan commented May 23, 2026

Issue for this PR

Related: #8555

This is a fresh port of the closed rlm_repl PR onto current dev.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an experimental rlm_repl tool for VM-backed JavaScript execution during tool calls. It includes pointer-based context storage, sub_llm / sub_llm_parallel helpers, sandbox guardrails, and resource limits.

The tool is opt-in only via OPENCODE_EXPERIMENTAL_RLM_REPL / experimentalRlmRepl, and registration is gated in the current Effect-based tool registry. This intentionally ports the idea from #8555 instead of rebasing it because the old flag module and registry wiring changed upstream.

Thanks @androolloyd, @mwalol, and @cloudpresser for the original direction and discussion.

How did you verify your code works?

  • bun test test/effect/runtime-flags.test.ts test/tool/registry.test.ts test/tool/rlm-repl.test.ts — 60 pass
  • bun run typecheck — pass
  • bunx prettier --check packages/opencode/src/tool/rlm-repl.ts packages/opencode/src/tool/registry.ts packages/opencode/src/effect/runtime-flags.ts packages/opencode/test/tool/rlm-repl.test.ts packages/opencode/test/tool/registry.test.ts packages/opencode/test/effect/runtime-flags.test.ts — pass
  • bun run build — pass
  • Full test suite earlier in this branch: 2906 pass, 0 fail
  • Pre-push hook reran bun turbo typecheck successfully

Screenshots / recordings

Not applicable; this is a non-UI tool/runtime change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Adds an experimental RLM REPL tool with a VM-backed JavaScript execution context, pointer-style context storage, sub-LLM call helpers, and runtime guardrails for sandbox escapes and resource limits.
Wires the new tool into the current Effect-based registry behind OPENCODE_EXPERIMENTAL_RLM_REPL so it stays opt-in while preserving default tool lists.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

1 participant