Skip to content

fix: resolve Cypress E2E test flakiness (tooltip overlay, seed race, bypass secret)#2032

Merged
nick-inkeep merged 2 commits intomainfrom
fix/cypress-agent-renderer-crash
Feb 16, 2026
Merged

fix: resolve Cypress E2E test flakiness (tooltip overlay, seed race, bypass secret)#2032
nick-inkeep merged 2 commits intomainfrom
fix/cypress-agent-renderer-crash

Conversation

@nick-inkeep
Copy link
Collaborator

@nick-inkeep nick-inkeep commented Feb 16, 2026

Summary

  • Split agent.cy.ts (9 tests) into 3 smaller spec files to reduce per-spec Chrome memory pressure
  • Added --js-flags=--max-old-space-size=4096 Chrome flag for headless CI
  • Added force: true to all cy.trigger() calls in drag/connect helpers to bypass tooltip overlays
  • Added retry logic (3 attempts with backoff) to the Push Weather Project CI step
  • Fixed bypass secret env var name mismatch in api-config.ts

Problem

Cypress E2E tests were failing intermittently in CI with ~13-26% failure rate. Investigation of 500+ CI runs over 14 days identified 3 distinct root causes:

1. Tooltip overlay blocking drag operations (~40% of failures)

cy.trigger() calls in dragNode() and connectEdge() helpers were blocked by a tooltip div[data-state=closed] covering React Flow handle nodes. The tooltip element intercepts Cypress actionability checks even though it is visually invisible.

2. Seed/auth race condition (~10-15% of failures)

The Push Weather Example Project CI step sometimes failed with 401 errors when the API server was not fully warmed up after the health check passed. When this failed, no project data was seeded, causing ALL subsequent tests to fail (0 passing).

3. Bypass secret env var name mismatch

api-config.ts checked process.env.INKEEP_AGENTS_API_BYPASS_SECRET but CI sets INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET. This prevented the Next.js server-side API calls from using the bypass secret as a fallback when cookie forwarding failed.

Changes

File Change
agent.cy.ts Reduced to 4 tests (unsaved changes dialog only)
agent-prompt.cy.ts New file with 2 prompt autocomplete/error tests
agent-tools.cy.ts New file with 3 tests plus force: true on all drag/connect triggers
cypress.config.ts Added --js-flags=--max-old-space-size=4096
action.yml Added retry logic (3 attempts, backoff) to project push step
api-config.ts Fixed env var: INKEEP_AGENTS_API_BYPASS_SECRET to INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET

Test plan

  • Cypress CI pipeline passes (the primary validation)
  • Total test count unchanged (9 tests across 3 files)
  • No new typecheck/lint/format regressions (verified locally)

The Chrome renderer process was crashing during agent.cy.ts due to
memory pressure on GitHub Actions runners. Split the 9-test spec into
3 smaller files (4+2+3 tests) so each gets a fresh browser context.
Also added --js-flags=--max-old-space-size=4096 Chrome flag to increase
V8 heap limit for headless CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

⚠️ No Changeset found

Latest commit: a9844f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 16, 2026 3:19am
agents-docs Ready Ready Preview, Comment Feb 16, 2026 3:19am
agents-manage-ui Ready Ready Preview, Comment Feb 16, 2026 3:19am

Request Review

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(0) Total Issues | Risk: Low

This PR is a clean CI stability fix that reorganizes Cypress E2E tests to reduce Chrome renderer memory pressure. All reviewers confirmed no issues.

Verification Summary

Test Parity Verified: All 9 original tests preserved across 3 files:

  • agent.cy.ts (4 tests) — Unsaved changes dialog
  • agent-prompt.cy.ts (2 tests) — Prompt autocomplete and error highlighting
  • agent-tools.cy.ts (3 tests) — Sub-agent ID editing + JSON/JS formatting

Logical Grouping: Tests appropriately organized by functional area

Helper Functions: dragNode() and connectEdge() correctly co-located with agent-tools.cy.ts where they're used

Config Change: The --js-flags=--max-old-space-size=4096 flag is a reasonable V8 heap limit increase for headless CI stability

Existing Patterns: File naming follows conventions in cypress/e2e/ (e.g., projects.cy.ts, skills.cy.ts)


✅ APPROVE

Summary: Clean infrastructure change with no behavioral modifications. The test split strategy is sound — smaller spec files reduce per-spec memory footprint, and the V8 heap flag provides additional headroom. This should address the intermittent CI crashes. Ship it! 🚀

Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 0 0 0 0 0 0 0
pr-review-tests 0 0 0 0 0 0 0
Total 0 0 0 0 0 0 0

@github-actions github-actions bot deleted a comment from claude bot Feb 16, 2026
1. Tooltip overlay blocking drag operations: Add `force: true` to all
   cy.trigger() calls in dragNode/connectEdge helpers so React Flow
   handle interactions bypass tooltip overlay elements (~40% of failures)

2. Seed race condition: Add retry logic (3 attempts with backoff) to
   the "Push Weather Example Project" CI step for when the API server
   isn't fully warmed up after health check passes (~10-15% of failures)

3. Bypass secret env var mismatch: Align api-config.ts to use
   INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET (matching what CI sets and
   what the API server checks) instead of INKEEP_AGENTS_API_BYPASS_SECRET

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nick-inkeep nick-inkeep changed the title fix: split agent.cy.ts to prevent Chrome renderer crash in CI fix: resolve Cypress E2E test flakiness (tooltip overlay, seed race, bypass secret) Feb 16, 2026
Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(0) Total Issues | Risk: Low

This re-review covers the delta since the last automated review (1 commit: a9844f4e — "fix: resolve 3 root causes of Cypress E2E flakiness").

Delta Changes Reviewed

1. Retry Logic for inkeep push (.github/composite-actions/cypress-e2e/action.yml)

  • Added 3-attempt retry with exponential backoff (5s, 10s delays)
  • Correctly handles directory navigation between retries via $GITHUB_WORKSPACE
  • Appropriate pattern for transient CI failures

2. force: true on Drag/Drop Triggers (agents-manage-ui/cypress/e2e/agent-tools.cy.ts)

  • Added to dragstart, dragover, drop, mousedown, mousemove, mouseup triggers
  • Validated as appropriate — React Flow canvas elements have complex z-index/transform positioning that can cause false actionability failures in Cypress
  • Tests still verify actual behavior (node counts, save confirmation) so this doesn't mask real bugs

3. Env Var Rename (agents-manage-ui/src/lib/api/api-config.ts)

  • Renamed from INKEEP_AGENTS_API_BYPASS_SECRETINKEEP_AGENTS_MANAGE_API_BYPASS_SECRET
  • Correctly aligns with domain-specific bypass secret naming convention already used elsewhere in the codebase

✅ APPROVE

Summary: The delta changes are sound CI stability improvements. The retry logic is correctly implemented with proper directory management, the force: true additions are appropriate for React Flow canvas interactions (precedent exists in monaco-editor.cy.ts), and the env var rename maintains consistency with the codebase's domain-specific naming pattern. Ship it! 🚀

Discarded (2)
Location Issue Reason Discarded
action.yml:72 GITHUB_WORKSPACE might be unset Invalid — GITHUB_WORKSPACE is a built-in GitHub Actions env var guaranteed to be set by the runner in all contexts including composite actions
action.yml:67-84 Could capture error output for better debugging INFO severity — improvement suggestion but doesn't meet Main threshold; command output already flows to step logs
Reviewers (2)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-devops 2 0 0 0 0 0 2
pr-review-tests 0 0 0 0 0 0 0
Total 2 0 0 0 0 0 2

@github-actions github-actions bot deleted a comment from claude bot Feb 16, 2026
@nick-inkeep nick-inkeep merged commit 3176cea into main Feb 16, 2026
11 checks passed
@nick-inkeep nick-inkeep deleted the fix/cypress-agent-renderer-crash branch February 16, 2026 03:27
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