Repository navigation
test(opencode): run OpenCode with the plugin against a real Server - #2533
Conversation
Start the pinned OpenCode 1.19.5 with the checked-in plugin bundle against an in-process PowerContext Server and deterministic model fixtures. The cases cover recall in a later session and the transcript boundary, prompt privacy, the Session Scope on resume, the recall and capture settings, and the confirmation before a memory write. The opencode-package job installs the platform binary, runs the cases, and keeps the host logs of a failed run.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hidb4ai
left a comment
There was a problem hiding this comment.
No blocking findings at ee1be21. This closes the real OpenCode/plugin/Server CI coverage gap without adding database tables or public interfaces. The approach is reasonable; merge index: 82/100.
Validated the real OpenCode 1.19.5 and SQLite Server flows locally. The recall case passed unchanged on retry after the shared Server fixture hit its startup deadline. Permission coverage requires the explicit ask rule; default-permission behavior remains tracked in #2534.
The separate SeekDB query timeout and macOS Desktop test timeout still leave CI red. This approval does not establish merge readiness.
…opencode-service-chain
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The shared `serve` helper failed a case when a Server took more than 15 seconds to finish starting, which a loaded host can exceed. It now waits 45 seconds, as `RestartableServer` does; a Server whose thread exits still fails at once.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed d5556da. No blocking findings in the updated test/CI diff, and no new database tables or public interfaces. Merge index: 84/100.
The 45-second startup budget is reasonable: a real HTTP probe with a 16-second startup fails on base and succeeds on head, while an explicit startup failure still returns promptly. The real OpenCode 1.19.5/SQLite scenarios pass locally. Permission coverage still requires explicit ask configuration pending #2534.
CI remains blocked by the Handoff report SQL-count assertion (38 statements versus a limit of 37), with downstream jobs including opencode-package skipped. That test and its runtime paths are unchanged from base; its isolated local Python 3.14 replay passes. This approval does not clear the CI gate.
Which issue or RFC does this PR close?
No tracking issue. This is the OpenCode counterpart of #2531 (Pi). The same real-host coverage is tracked for Hermes in #2438 and for the gateway in #2466.
Rationale for this change
The OpenCode plugin's own tests stub
fetchand OpenCode's plugin API.tests/e2e/test_opencode_plugin_host.pydoes runopencode run, but against a recording HTTP server, and only whenopencodeis onPATH, which no CI job provides. Nothing runs OpenCode, the plugin bundle, and a real Server together. A break between OpenCode's hooks, the bundle, and the Server's HTTP contract would reach users first.What changes are included in this PR?
tests/e2e/test_opencode_service_chain.pystarts three things:opencode serve(pinned 1.19.5) in an isolated home, with the checked-in bundle wherepowercontext setup opencodeinstalls it.@opencode-ai/pluginfrom the plugin package's development install.It covers four cases:
PowerContext host-supplied context.label.[REDACTED].pc_rememberraises an OpenCode permission request forpowercontextwith the patternremember_memory.pc_searchreturns it from the bound Scope.CI,
opencode-packagejob:opencode-<platform>-<arch>@1.19.5, using the baseline build on x64 without AVX2, and checks the version..github/ci-paths.tomlroutes the two ZCode acceptance fixture modules the test imports to theopencodesuite.tests/e2e/zcode_acceptance/runner.py: the sharedservehelper waits up to 45 s for a Server to start, asRestartableServerdoes, so a loaded host does not fail a case before it runs. A Server whose thread exits still fails at once.Defect found by these cases
With OpenCode's default configuration, PowerContext writes run without confirmation.
powercontextis allowed without asking.The permission case therefore configures
"permission": {"powercontext": "ask"}. The fix is #2534, which changes only the plugin and its docs.Are there any user-facing changes?
No. Tests and CI only.
How was this change tested?
OPENCODE_CLI_BIN=<OpenCode 1.19.5> uv run pytest tests/e2e/test_opencode_service_chain.pyon macOS arm64: 4 passed in about 15 s.-n 4, and with an unreachable proxy exported in the parent environment.OPENCODE_CLI_BINthe cases skip.opencode-packagejob on linux x64 withopencode-linux-x64@1.19.5: 4 passed in about 32 s.uv run pytest tests/test_ci_changes.py tests/test_ci_pipeline.py: 157 passed.uv run python -m pytest -n 0 tests/e2e/test_zcode_service_chain.py, which also usesserve: 4 passed.make check: passed./code-review(high), plus an independent review agent.opencode serveprocess behind.tests/e2e/test_pi_service_chain.py. Pi wraps the app in a flush-outage middleware and OpenCode does not, so a shared helper would cover only the settings.opencode. An import error in the modules they import still fails collection in thetestsjob's e2e suite, which collects this file and skips it without the binary.powercontext setup opencodeare outside these cases.serve. They need the Pi package dependencies or a ZCode binary, so they did not run locally.AI usage statement
This PR was prepared with Claude Code (Claude Opus 5.5). It traced OpenCode's plugin loading and permission handling, wrote the test and CI wiring, ran the checks, mutations, and reviews, and drafted this description. I reviewed the changes and the results.