Skip to content

feat(sleep): add OpenCode tool-aware replay - #227

Open
YingqiDuan wants to merge 3 commits into
microsoft:mainfrom
YingqiDuan:feat/opencode-tool-replay
Open

feat(sleep): add OpenCode tool-aware replay#227
YingqiDuan wants to merge 3 commits into
microsoft:mainfrom
YingqiDuan:feat/opencode-tool-replay

Conversation

@YingqiDuan

@YingqiDuan YingqiDuan commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Part of #56

Summary

  • Add OpenCode tool replay for tasks with a non-empty tool_called rule.
  • For each required tool, create a randomly named temporary JavaScript tool with fixed input and output in a fresh temporary Git workspace. Count it as called only when OpenCode reports the exact call as completed.
  • Keep each tool replay limited to those temporary tools. MCP servers and snapshots stay disabled for the call, all other tools stay blocked, and subprocess, timeout, configuration, and JSONL failures are reported without exposing sensitive details.

Safety and compatibility

Tool replay is off by default. Turn it on with --opencode-tool-replay or set opencode_tool_replay to the boolean true. Values such as "true" and 1 do not enable it.

Historical tool inputs and outputs are not replayed. OpenCode may load global custom tools at startup, but only SkillOpt's temporary tools are available to the model. The fixed synthetic call and temporary project metadata may still be recorded in OpenCode's normal history.

Compatibility is currently documented for OpenCode CLI 1.18.15.

Validation

  • Focused test suite: 132 passed, 2 skipped. The skipped tests are opt-in real-model smoke tests.
  • Targeted Ruff checks, py_compile, git diff --check, and python -m mkdocs build --strict: passed.

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