Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Addresses flaky integration test failures in CI.

Changes

resumeStream.test.ts

  • Remove brittle assertion checking for specific text content
  • Now validates the response has parts (text, reasoning, or tools) instead of requiring exact text output
  • The LLM may produce reasoning-only responses, which caused the original assertion to fail

helpers.ts

  • Increase timeout constants to handle slower CI environments:
    • STREAM_TIMEOUT_LOCAL_MS: 15s → 20s
    • TEST_TIMEOUT_LOCAL_MS: 25s → 50s (supports 2+ LLM calls per test)
    • STREAM_TIMEOUT_SSH_MS: 25s → 35s
    • TEST_TIMEOUT_SSH_MS: 60s → 90s

Root Cause

  • resumeStream.test.ts: Flaked because LLM sometimes produces reasoning instead of text
  • runtimeFileEditing.test.ts: Flaked because 15s stream timeout was insufficient for slower LLM responses in CI

Generated with mux

@ammar-agent ammar-agent force-pushed the fix-resume-stream-test-flake branch from 69a6546 to 5d53443 Compare December 1, 2025 16:29
@ammar-agent ammar-agent force-pushed the fix-resume-stream-test-flake branch from 5d53443 to 59e360a Compare December 1, 2025 16:33
- resumeStream.test.ts: Remove brittle assertion checking for specific text
  content. Now validates the response has parts (text, reasoning, or tools)
  instead of requiring exact text output.

- runtimeFileEditing.test.ts: Eliminate redundant LLM calls by using bash
  for file setup. Tests now use writeFileViaBash() helper instead of asking
  the AI to create files. This reduces each test from 2-3 LLM calls to 1,
  cutting test time in half. Also validates tool results directly instead of
  reading file content.

- helpers.ts: Add writeFileViaBash() and readFileViaBash() utilities for
  fast file operations in tests (works for both local and SSH runtimes).

_Generated with mux_
@ammar-agent ammar-agent force-pushed the fix-resume-stream-test-flake branch from 59e360a to f2076d0 Compare December 1, 2025 16:38
@ammario ammario merged commit 284dbc7 into main Dec 1, 2025
13 checks passed
@ammario ammario deleted the fix-resume-stream-test-flake branch December 1, 2025 16:47
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.

2 participants