Skip to content

test: upstream-sync fork hardening and local deployment E2E plan #195

@terisuke

Description

@terisuke

Context

dev has been synced with upstream/dev on 2026-04-29. The fork keeps substantial custom guardrails/team behavior on top of upstream, so validation needs to prove both upstream regressions and fork-only automation paths.

Current sync baseline:

  • upstream: anomalyco/opencode dev
  • fork: Cor-Incorporated/opencode dev
  • local merge commit: cd1dda6bc (Merge remote-tracking branch 'upstream/dev' into dev)
  • push target: origin/dev

Closed issue risk signals reviewed

Fork-side closed issues show recurring risk in these areas:

Upstream closed issues around the synced range show recurring risk in these areas:

  • HTTP API/OpenAPI/SDK parity and request/response shape drift
  • provider transform compatibility, especially thinking/reasoning payloads and GitHub Copilot variants
  • TUI/OpenTUI rendering, paste, theme, Zed selection, and Windows behavior
  • session lifecycle, auto-resume, compaction, question/permission propagation, and background agents
  • desktop/web workspace and project icon persistence
  • performance with large DBs, prompt cache preservation, startup blocking, and install/runtime dependency chains

Local deployment target

Validate against the local deployed binary/server from this checkout, not only unit tests. The local deployment should use isolated temp state so it cannot pass because of existing user data.

Required isolation:

  • temp OPENCODE_CONFIG_DIR
  • temp data/storage directory if supported by this checkout
  • temp project workspace with git and non-git variants
  • no reliance on repo-root test execution
  • package-level commands only, especially from packages/opencode

Test plan

1. Sync and build integrity

  • Confirm origin/dev includes upstream merge and is no longer behind upstream/dev.
  • Run package-level typecheck from packages/opencode: bun typecheck.
  • Run package-level focused tests for the touched surfaces:
    • HTTP API bridge/parity/provider/session tests
    • provider transform tests
    • TUI sync/editor tests
    • guardrail plugin/team tests
  • Regenerate SDK only if API/generated files drift: ./packages/sdk/js/script/build.ts.
  • Verify git status is clean after generation and tests.

2. Local deployment smoke

  • Build or run local package binary from packages/opencode.
  • Verify opencode --version and command help exit cleanly with EOL.
  • Start local server with isolated config and verify readiness.
  • Exercise health/instance/session endpoints with auth enabled and disabled.
  • Confirm server startup does not block on missing remote project, missing well-known URLs, or empty/non-git projects.

3. Session lifecycle E2E

  • Create session in a git project and non-git project.
  • Send a basic prompt and confirm progress/result/log events are visible.
  • Verify user messages are not duplicated under concurrent prompt submission.
  • Verify session title generation does not fail silently for Copilot-compatible provider metadata.
  • Resume session and confirm no stale compaction tail_start_id or context overflow.
  • Move/list/filter sessions by path and confirm relative path storage migration works.

4. Provider compatibility matrix

  • Validate request shaping for OpenAI-compatible, Copilot, OpenRouter, DeepSeek/Qwen thinking/reasoning, and Moonshot sanitization paths using local test doubles where possible.
  • Confirm thinking/reasoning payloads are preserved across multi-turn requests where required.
  • Confirm unsupported extra tool fields such as eager_input_streaming are removed before provider calls.
  • Confirm small/background model selection honors configured provider/model and does not silently force GPT-5 Nano.

5. TUI and editor behavior

  • Start TUI in a controlled PTY and verify no crash on startup.
  • Verify spinner/rendering does not regress after fork spinner fixes.
  • Verify paste path, question dock, status popover, theme loading, and invalid custom theme handling.
  • Verify Zed selection byte offsets with non-ASCII text.
  • Verify session list filtering by path and workspace state sync.

6. Guardrails and team plugin E2E

  • Run /plan -> /auto style workflow with isolated worktrees.
  • Confirm team workers clone/setup from the actual repo and do not create empty git init worktrees.
  • Confirm workers persist run state before preflight waits and keep operating after parent abort.
  • Confirm permission/question propagation does not deadlock nested agents.
  • Confirm guardrails block merge/push/rebase bypass patterns and apply_patch bypasses.
  • Confirm guardrails still allow explicitly permitted .env.example and safe read cases.
  • Confirm secret masking covers bash output and logs.
  • Confirm dual-review/merge gates observe the real review completion state.

7. Web/Desktop/App smoke

  • Run app package tests for workspace/settings/status-popover regressions.
  • Verify project icon override persists through restart/localStorage sync.
  • Verify directory/file distinction in git changes UI.
  • Verify desktop/web can open a non-git project and recover when a remote folder is missing.

8. Security and adversarial checks

  • Try command variants intended to bypass guardrail regexes: reordered git push flags, shell pipes, command substitution, apply_patch mutation, and mixed stdout/stderr secret output.
  • Verify no secrets appear in logs, tool results, issue/PR output, or test artifacts.
  • Verify symlink/process-tree checks on Linux-sensitive notification logic remain covered by tests even when run on macOS locally.

9. Performance and stability

  • Run a startup probe with a seeded large session DB fixture or synthetic session list.
  • Confirm startup and session listing stay responsive.
  • Confirm tool-call prompt loop does not reload static prompt data unnecessarily.
  • Run repeated session prompt/abort/resume cycles to catch hangs.

10. Acceptance criteria

  • origin/dev contains upstream sync and local fork custom behavior.
  • Package-level bun typecheck passes from packages/opencode.
  • Focused tests pass from package directories.
  • Local deployed binary/server passes smoke, session, provider, TUI, guardrail/team, and adversarial scenarios.
  • Every failure found during this plan gets either a fixing commit or a linked follow-up with reproduction and severity.
  • A fork PR is opened only after local deployment validation is complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtest

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions