Skip to content

fix(ci): diagnose and fix Cypress E2E test failures#2249

Merged
amikofalvy merged 10 commits intomainfrom
fix/cypress-ci-diagnostics
Feb 22, 2026
Merged

fix(ci): diagnose and fix Cypress E2E test failures#2249
amikofalvy merged 10 commits intomainfrom
fix/cypress-ci-diagnostics

Conversation

@amikofalvy
Copy link
Collaborator

@amikofalvy amikofalvy commented Feb 22, 2026

Summary

  • Pin DoltgreSQL to v0.55.4 to fix inkeep push INSERT failures that broke seed data
  • Disable OTEL instrumentation in test environment to prevent Next.js SSR errors
  • Increase Cypress timeouts for CI reliability (defaultCommandTimeout: 15s, Monaco/ReactFlow: 20s)
  • Add CI diagnostic steps (env vars, DB state, API verification) for easier future debugging
  • Always upload screenshots/videos artifacts (not just on failure)
  • Add cy.task('log') handler for CI-visible stdout logging

Root causes found and fixed

  1. DoltgreSQL latest tag broke INSERT compatibility — pinned to 0.55.4
  2. OTEL auto-instrumentation crashed Next.js server components in test — disabled via ENVIRONMENT !== 'test' check
  3. Cypress default 4s command timeout too short for CI — increased to 15s globally
  4. Missing URL redirect wait after agent creation caused React Flow nodes to not render — added cy.url().should('include', '/agents/')
  5. typeInMonaco timeout too short for CI — increased to 20s

Pre-existing failures (not addressed by this PR)

Three tests fail on main as well (introduced between Feb 19-20, unrelated to CI config):

  • agent-tools.cy.ts "Editing sub-agent ID" — save action fails ("Agent saved" toast never appears)
  • components.cy.ts — sonner toast element not found
  • skills.cy.ts "should create a skill" — Server Components render error on skills page

Test plan

  • CI runs: 7/10 specs fully green, 17/20 tests passing
  • All 3 remaining failures confirmed as pre-existing on main (not regressions from this PR)
  • Diagnostic steps provide useful DB/API state logging for future debugging
  • Screenshots and videos always uploaded for debugging

🤖 Generated with Claude Code

Cypress tests fail on CI because the React Flow canvas renders empty -
agent nodes/edges are not present despite the agent page loading
successfully. This suggests a data loading issue rather than a
rendering issue.

Changes:
- Add diagnostic steps to CI composite action:
  - Log environment variable presence (without exposing secrets)
  - Query DoltgreSQL after seeding to verify agents, sub-agents exist
    on both default and project-scoped branches
  - Curl the full agent API endpoint to check subAgents in response
- Pin DoltgreSQL to 0.54.10 in cypress.yml (matches docker-compose.yml)
- Skip OTEL instrumentation when ENVIRONMENT=test to prevent
  getNodeAutoInstrumentations() from interfering with Next.js SSR
- Add OTEL_SDK_DISABLED=true env var (belt-and-suspenders)
- Add 10-min timeout to Cypress test step so artifact uploads run
  before the 30-min job timeout
- Change artifact uploads to if: always() with if-no-files-found: ignore

Root cause investigation:
The CI screenshots show the agent page loads correctly (breadcrumb
shows "Activities planner") but the React Flow canvas is completely
empty. This means the agent record exists but subAgents data is
missing from the API response. The diagnostics will reveal whether
this is a Dolt branch/commit issue or an API data loading issue.

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

changeset-bot bot commented Feb 22, 2026

⚠️ No Changeset found

Latest commit: b0c6dc2

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 22, 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 22, 2026 10:14am
agents-manage-ui Ready Ready Preview, Comment Feb 22, 2026 10:14am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
agents-docs Skipped Skipped Feb 22, 2026 10:14am

Request Review

The embedded Python script with f-strings at column 0 broke the
GitHub Actions YAML parser ("could not find expected ':'"). Replace
with jq which handles the same JSON parsing without indentation issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ilure

Key findings from CI run:
- inkeep push fails 3/3 attempts with 500 error:
  "Failed query: insert into "projects" ("tenant_id", "id", ..., "stop_w..."
- The project never gets seeded, explaining the empty React Flow canvas
- Diagnostic steps were skipped because push step exited non-zero

Changes:
- Bump DoltgreSQL from 0.54.10 to 0.55.4 (latest stable) to rule out
  version-specific query/schema issues
- Make push step defer failure (store result in PUSH_SUCCESS env var)
  so diagnostic steps can run and provide visibility
- Add explicit "Fail if push was unsuccessful" step before Cypress tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use `grep -o --` to prevent `---` from being interpreted as options
- Use `SELECT dolt_checkout()` instead of `CALL dolt_checkout()` for DoltgreSQL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove 600s timeout wrapper (rely on job's 30-min timeout instead)
- Add defaultCommandTimeout: 15s in cypress.config.ts (was 4s default)
- Increase typeInMonaco timeout to 20s for slow Monaco editor loading
- Increase .react-flow__node timeouts to 20s in agent-tools tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After submitting the create agent form, wait for the URL to include
'/agents/' before checking for React Flow nodes. Without this wait,
the test looks for nodes while still on the projects page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Log the HTTP method, URL, status code, and error response body
when saving an agent to debug why 'Agent saved' toast doesn't appear.
Also broadened intercept pattern to catch all HTTP methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel vercel bot temporarily deployed to Preview – agents-docs February 22, 2026 09:10 Inactive
cy.log() only appears in the Cypress UI command log, not in terminal
output. Using cy.task('log', ...) writes to stdout/CI logs instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove save diagnostic cy.task() calls from agent-tools test.
Restore original 'POST', '**/agents/*' intercept (the change to
'**/agent/*' was matching wrong URLs and breaking cy.wait).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel vercel bot temporarily deployed to Preview – agents-docs February 22, 2026 10:11 Inactive
@github-actions github-actions bot deleted a comment from claude bot Feb 22, 2026
@amikofalvy amikofalvy merged commit 8805635 into main Feb 22, 2026
8 of 9 checks passed
@amikofalvy amikofalvy deleted the fix/cypress-ci-diagnostics branch February 22, 2026 14:38
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