Repository navigation
Add a scenario harness to test the apps against a real opencode server - #714
Merged
Merged
Conversation
scripts/scenario-harness runs a real `opencode serve` (classic v1 or v2 from an opencode checkout) whose only model is a scripted OpenAI-compatible fake, puts a fault proxy in front of it for the apps, and serves a web UI to arm scenarios, act as another client, inject SSE faults, and watch app requests, server events and model calls on one timeline. check.mjs plays scenarios headless and reports what each produced. The catalog has 40 scenarios (13 P0, 17 P1, 10 P2): streaming, tool rows, permissions and questions answered in the app or from outside, subagents, retries and errors, aborts, reconnects, compaction, revert, rename, delete, concurrent sessions and unicode edge cases. All plays pass headless on v1 1.19.1 and v2 dev. HarnessSeedTest seeds an Android Connection Profile for the harness; the scenario-harness skill documents setup, device seeding and known traps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b865434. Configure here.
…h exemption. - Observer restarts clear the busy map and release idle waiters, so a protocol switch doesn't leave old sessions busy forever. - check.mjs exits 1 when any non-skipped play fails, not only on timeouts. - The all-requests 401 fault exempts every health probe (/global/health, /api/health, /api/info), so v1 and v2 behave the same. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
A local harness for running the iOS and Android apps against a real
opencode serve(classic v1 or v2) where the only model is a scripted fake, so behaviour is repeatable and costs nothing.scripts/scenario-harness/): launches v1 (installed binary) or v2 (from an opencode checkout) in isolated data/config dirs against a throwaway git project. The fake OpenAI-compatible model plays the armed scenario, auto-answers title and summary/compaction requests, and routes calls by session id so subagent child sessions get their own scripts.:4096for the apps: drop SSE, go offline, 401 everything or only event streams, stall, heartbeats-only, latency.:4500: arm or run scenarios and variants, answer asks and act as another client, inject faults, and watch app requests, server events and model calls on one timeline.check.mjs: plays scenarios headless and reports model calls, tool states and event types per play.HarnessSeedTest(androidTest): seeds an Android Connection Profile viaam instrument.scenario-harnessskill: setup, device seeding, control API, traps, and known app gaps.No app code changes.
Verification
check.mjs --variants: 51/51 plays pass on v1 1.19.1, 50/50 on v2dev(todo-list-progressis v1-only).node --check, 40 scenarios) and:app:compileDebugAndroidTestKotlinpasses.App gaps the harness found (not fixed here)
patchrenders as a generic row on both apps (v1apply_patchis fine).Usage
See
.agents/skills/scenario-harness/SKILL.mdor--help.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.Note
Low Risk
Adds dev/test tooling and androidTest seeding only; no production app or server runtime paths are modified.
Overview
Adds a scenario harness under
scripts/scenario-harness/so iOS and Android can be exercised against a realopencode serve(v1 or v2) with a scripted fake model instead of a paid provider.The harness launches isolated server state and a throwaway git project, exposes a fault proxy on
:4096for apps (SSE drops, offline, auth faults, stall), and a web UI/control API on:4500to arm or run scenarios, act as another client, and inspect traffic.check.mjsreplays scenarios headlessly for CI-style verification.40 scripted scenarios (P0–P2) cover streaming, tools, permissions, questions, subagents, errors, aborts, reconnects, and session lifecycle, with v1/v2 differences encoded in the scenario definitions. A small
project-templateand fixtures support tool scenarios (shell streaming, webfetch, patch).Android-only test support: new
HarnessSeedTestinstruments a connection profile, worktree, and onboarding flags for emulator runs (documented in.agents/skills/scenario-harness/SKILL.md). No changes to production app code.Reviewed by Cursor Bugbot for commit b865434. Bugbot is set up for automated code reviews on this repo. Configure here.