Skip to content

test(e2e): cover core session streaming, stop, and permission prompts - #427

Merged
chriswritescode-dev merged 1 commit into
feat/tts-visible-messages-shortcutfrom
test/e2e-core-session
Oct 15, 2026
Merged

chriswritescode-dev merged 1 commit into
feat/tts-visible-messages-shortcutfrom
test/e2e-core-session

Conversation

@chriswritescode-dev

Copy link
Copy Markdown
Owner

Summary

Adds end-to-end coverage for the core chat session flow. Before this, e2e only checked that the session page renders.

Stacked on #426: this PR uses e2e/mockProvider.ts, which #426 introduces. The base is feat/tts-visible-messages-shortcut, so the diff shows only this change. Merge #426 first; GitHub then retargets this PR to main.

New spec e2e/session-core.spec.ts

  1. Send and stream: the first reply chunk is visible before the last chunk arrives, then the full reply shows and the session is idle.
  2. Stop: Stop is clicked during a slow reply. The session goes idle, and the test waits past the next chunk's delivery time to confirm it never renders.
  3. Permission, allow: with permission: { bash: 'ask' }, the mock model calls the shell tool. "Allow Once" runs the command (a marker file appears), and the follow-up reply shows.
  4. Permission, deny: "Deny" closes the dialog. The command does not run, and the session is idle.

Mock provider (e2e/mockProvider.ts)

  • Selects replies by a trigger keyword in the latest user message, not by queue order. OpenCode also sends title-generation requests to the same endpoint, so a queue would hand replies to the wrong request.
  • Adds chunked streaming with a delay, OpenAI-format streamed tool_calls, a fixed follow-up after a tool result, and a clean stop when the client disconnects.
  • createMockRepo accepts extra opencode.json config, and waits until OpenCode has loaded the mock model for the new directory. Without the wait, a session could start on OpenCode's default model and fail.
  • setReply(text) is unchanged for the existing specs.

Validation

  • Full e2e suite: 25/25 passed. session-core.spec.ts with --repeat-each=3 --workers=1: all passed.
  • e2e files typecheck clean with strict tsc. They are not covered by pnpm typecheck.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Tests (e2e only, no app code changes)

Checklist

  • Code follows project style (no comments, named imports)
  • TypeScript types are properly defined
  • Tests added/updated (80% coverage target)
  • pnpm lint passes locally
  • pnpm typecheck passes locally

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ce66063f-ae50-48df-a12d-f8f85f39197a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chriswritescode-dev
chriswritescode-dev merged commit f49953d into feat/tts-visible-messages-shortcut Oct 15, 2026
2 checks 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