Skip to content

test(fleet): use load-compatible relaycast engine - #1473

Merged
khaliqgant merged 1 commit into
mainfrom
fix/fleet-load-compatible-engine-0810
Aug 12, 2026
Merged

test(fleet): use load-compatible relaycast engine#1473
khaliqgant merged 1 commit into
mainfrom
fix/fleet-load-compatible-engine-0810

Conversation

@barryollama

Copy link
Copy Markdown
Contributor

Summary

  • pin Fleet E2E to released relaycast v7.0.0, which accepts omitted/null heartbeat load
  • keep the active-agent and least-loaded placement assertions unchanged
  • update the mailbox TTL fixture for relaycast scheduled expiry maintenance without weakening dead-letter or sender-notification checks

Root cause

0b43dbe3 (post-#1445) fails against the old v6.0.1 engine because an unbounded broker-provider heartbeat omits load; that engine stops applying the heartbeat, so active_agents never advances. 1ae49812 (pre-#1445) passes. This is the same wire contract covered by relaycast#307 and requires the server release before the relay release.

Verification

  • 1ae49812: Fleet E2E exit 0 (27 passed, 4 skipped)
  • 0b43dbe3: Fleet E2E exit 1 (heartbeat/load failures)
  • updated branch full Fleet E2E: exit 0 twice (27 passed, 4 skipped each)
  • focused TTL E2E: exit 0
  • Prettier check: exit 0
  • git diff --check: exit 0

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates the relaycast engine to v7.0.0, documents heartbeat compatibility requirements, and adjusts fleet E2E TTL checks for scheduled mailbox expiry maintenance.

Changes

Fleet E2E compatibility

Layer / File(s) Summary
Relaycast engine compatibility
.github/workflows/fleet-e2e.yml, tests/e2e/fleet/README.md
The workflow uses relaycast v7.0.0. Documentation records compatibility fixes for node-provider wire data and omitted or null heartbeat load values.
Scheduled TTL maintenance assertions
tests/e2e/fleet/fleet-e2e.test.ts, tests/e2e/fleet/harness.ts
The TTL test waits for scheduled expiry maintenance. The harness documents polling as the way to observe mailbox TTL transitions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: khaliqgant, willwashburn

Poem

A rabbit checks the engine’s beat,
While timed-out mail leaves its seat.
Heartbeats carry loads just right,
And scheduled sweeps keep tests in sight.
Hop, relaycast, through the night!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Fleet E2E test change to use a relaycast engine compatible with omitted or null heartbeat load values.
Description check ✅ Passed The description explains the change, root cause, verification results, and affected tests; the missing template headings do not prevent understanding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fleet-load-compatible-engine-0810

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/e2e/fleet/README.md`:
- Around line 59-61: Move the compatibility note above the local test command,
then ensure the RELAYCAST_ENGINE_DIR assignment ends with the line-continuation
backslash as its final character so it correctly combines with
BROKER_BINARY_PATH and npm run test:e2e.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6802bf5c-4739-4607-90e3-895d85a57708

📥 Commits

Reviewing files that changed from the base of the PR and between 0b43dbe and 8d5d681.

📒 Files selected for processing (4)
  • .github/workflows/fleet-e2e.yml
  • tests/e2e/fleet/README.md
  • tests/e2e/fleet/fleet-e2e.test.ts
  • tests/e2e/fleet/harness.ts

Comment thread tests/e2e/fleet/README.md
Comment on lines +59 to 61
RELAYCAST_ENGINE_DIR=/path/to/relaycast \ # must carry relaycast#194 and #307 compat fixes
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
npm run test:e2e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | grep -F 'tests/e2e/fleet/README.md' || true

echo "== relevant README section =="
if [ -f tests/e2e/fleet/README.md ]; then
  nl -ba tests/e2e/fleet/README.md | sed -n '1,90p' | sed -n '50,68p'
fi

echo "== bash continuation behavior probe =="
set +e
tmpfile="$(mktemp)"
# emulate the exact line shape in docs: backslash, spaces, inline comment, newline.
cat > "$tmpfile" <<'SH'
#!/usr/bin/env bash
set -u
RELAYCAST_ENGINE_DIR=/path/to/relaycast \            # must carry relaycast#194 and `#307` compat fixes
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash "$tmpfile"
ret=$?
echo "bash_exit=$ret"
rm -f "$tmpfile"

echo "== probe valid continuation equivalent =="
set +e
tmpfile2="$(mktemp)"
cat > "$tmpfile2" <<'SH'
#!/usr/bin/env bash
set -u
# The compatibility note is not part of the command.
RELAYCAST_ENGINE_DIR=/path/to/relaycast \
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash "$tmpfile2"
ret2=$?
echo "bash_exit=$ret2"
rm -f "$tmpfile2"

Repository: AgentWorkforce/relay

Length of output: 272


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | grep -F 'tests/e2e/fleet/README.md' || true

echo "== relevant README section =="
if [ -f tests/e2e/fleet/README.md ]; then
  nl -ba tests/e2e/fleet/README.md | sed -n '1,90p' | sed -n '50,68p'
fi

echo "== bash continuation behavior probe =="
tmpfile="$(mktemp)"
# emulate the exact line shape in docs: backslash, spaces, inline comment, newline.
cat > "$tmpfile" <<'SH'
#!/usr/bin/env bash
set -u
RELAYCAST_ENGINE_DIR=/path/to/relaycast \            # must carry relaycast#194 and `#307` compat fixes
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash "$tmpfile"
ret=$?
echo "bash_exit=$ret"
rm -f "$tmpfile"

echo "== probe valid continuation equivalent =="
tmpfile2="$(mktemp)"
cat > "$tmpfile2" <<'SH'
#!/usr/bin/env bash
set -u
# The compatibility note is not part of the command.
RELAYCAST_ENGINE_DIR=/path/to/relaycast \
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash "$tmpfile2"
ret2=$?
echo "bash_exit=$ret2"
rm -f "$tmpfile2"

Repository: AgentWorkforce/relay

Length of output: 272


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== raw README section =="
awk 'NR>=55 && NR<=65 { printf "%6d  %s\n", NR, $0 }' tests/e2e/fleet/README.md

echo "== bash syntax probe exact backslash+spaces+comment =="
tmpfile="$(mktemp)"
cat > "$tmpfile" <<'SH'
set -u
RELAYCAST_ENGINE_DIR=/path/to/relaycast \            # must carry relaycast#194 and `#307` compat fixes
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash -n "$tmpfile"
status=$?
if [ "$status" -eq 0 ]; then
  bash "$tmpfile"
else
  echo "syntax_check_failed_status=$status"
fi
rm -f "$tmpfile"

echo "== bash syntax probe valid continuation equivalent =="
tmpfile2="$(mktemp)"
cat > "$tmpfile2" <<'SH'
set -u
RELAYCAST_ENGINE_DIR=/path/to/relaycast \
BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
  printf 'RELAYCAST_ENGINE_DIR=%q has_trailing=%s\n' "$RELAYCAST_ENGINE_DIR" 'trailing' || true
printf 'exit_status=%s\n' "$?"
SH
bash -n "$tmpfile2"
status2=$?
if [ "$status2" -eq 0 ]; then
  bash "$tmpfile2"
else
  echo "syntax_check_failed_status=$status2"
fi
rm -f "$tmpfile2"

Repository: AgentWorkforce/relay

Length of output: 950


Fix the shell continuation in the local command.

The backslash on Line 59 is not the last character before the newline, so Bash does not continue to the next command line. Move the compatibility note above the command so RELAYCAST_ENGINE_DIR can be passed to npm run test:e2e.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/e2e/fleet/README.md` around lines 59 - 61, Move the compatibility note
above the local test command, then ensure the RELAYCAST_ENGINE_DIR assignment
ends with the line-continuation backslash as its final character so it correctly
combines with BROKER_BINARY_PATH and npm run test:e2e.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/e2e/fleet/fleet-e2e.test.ts">

<violation number="1" location="tests/e2e/fleet/fleet-e2e.test.ts:732">
P3: The two sequential inner waitFor budgets now sum exactly to the test's 35s timeout (25s dead-letter poll + 10s sender-notification poll), with the observer/sendDM setup before the first poll sitting outside that budget. In practice the dead-letter lands within the documented 15s sweep, but on slow CI the scheduled maintenance interval can drift and the dead-letter poll can burn close to its full budget — leaving the 10s notification poll no headroom and causing a spurious vitest timeout. Consider widening the outer test timeout (e.g. 45_000) so the two inner waits plus setup have slack, keeping the reliability improvement from this PR robust.</violation>
</file>

<file name="tests/e2e/fleet/README.md">

<violation number="1" location="tests/e2e/fleet/README.md:59">
P3: The trailing inline comment after the `\` on this line breaks the Bash line continuation (the backslash must be the last character before the newline), so `RELAYCAST_ENGINE_DIR` won't actually be passed to `npm run test:e2e` when following these instructions verbatim. Consider moving the compatibility note above the command instead of appending it after the continuation backslash.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

expect(failed).toMatchObject({ target_agent_name: 'ttl-recipient' });
senderWs.close();
}, 25_000);
}, 35_000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The two sequential inner waitFor budgets now sum exactly to the test's 35s timeout (25s dead-letter poll + 10s sender-notification poll), with the observer/sendDM setup before the first poll sitting outside that budget. In practice the dead-letter lands within the documented 15s sweep, but on slow CI the scheduled maintenance interval can drift and the dead-letter poll can burn close to its full budget — leaving the 10s notification poll no headroom and causing a spurious vitest timeout. Consider widening the outer test timeout (e.g. 45_000) so the two inner waits plus setup have slack, keeping the reliability improvement from this PR robust.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/e2e/fleet/fleet-e2e.test.ts, line 732:

<comment>The two sequential inner waitFor budgets now sum exactly to the test's 35s timeout (25s dead-letter poll + 10s sender-notification poll), with the observer/sendDM setup before the first poll sitting outside that budget. In practice the dead-letter lands within the documented 15s sweep, but on slow CI the scheduled maintenance interval can drift and the dead-letter poll can burn close to its full budget — leaving the 10s notification poll no headroom and causing a spurious vitest timeout. Consider widening the outer test timeout (e.g. 45_000) so the two inner waits plus setup have slack, keeping the reliability improvement from this PR robust.</comment>

<file context>
@@ -729,7 +729,7 @@ describe.skipIf(!pre.ok)('bounded durable mailbox', () => {
     expect(failed).toMatchObject({ target_agent_name: 'ttl-recipient' });
     senderWs.close();
-  }, 25_000);
+  }, 35_000);
 
   // Overflow reject-new is enforced by `belowDepthCapSql` (counts queued+delivered
</file context>
Suggested change
}, 35_000);
}, 45_000);

Comment thread tests/e2e/fleet/README.md
npm run build:core # relay CLI + fleet + harness-driver
cargo build --release --bin agent-relay-broker # broker
RELAYCAST_ENGINE_DIR=/path/to/relaycast \ # must carry relaycast#194's compat fixes
RELAYCAST_ENGINE_DIR=/path/to/relaycast \ # must carry relaycast#194 and #307 compat fixes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The trailing inline comment after the \ on this line breaks the Bash line continuation (the backslash must be the last character before the newline), so RELAYCAST_ENGINE_DIR won't actually be passed to npm run test:e2e when following these instructions verbatim. Consider moving the compatibility note above the command instead of appending it after the continuation backslash.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/e2e/fleet/README.md, line 59:

<comment>The trailing inline comment after the `\` on this line breaks the Bash line continuation (the backslash must be the last character before the newline), so `RELAYCAST_ENGINE_DIR` won't actually be passed to `npm run test:e2e` when following these instructions verbatim. Consider moving the compatibility note above the command instead of appending it after the continuation backslash.</comment>

<file context>
@@ -55,14 +56,14 @@ engine⇄broker mismatches this E2E surfaced (fixed in relaycast#194).
 npm run build:core                                   # relay CLI + fleet + harness-driver
 cargo build --release --bin agent-relay-broker       # broker
-RELAYCAST_ENGINE_DIR=/path/to/relaycast \            # must carry relaycast#194's compat fixes
+RELAYCAST_ENGINE_DIR=/path/to/relaycast \            # must carry relaycast#194 and #307 compat fixes
 BROKER_BINARY_PATH="$PWD/target/release/agent-relay-broker" \
   npm run test:e2e
</file context>
Suggested change
RELAYCAST_ENGINE_DIR=/path/to/relaycast \ # must carry relaycast#194 and #307 compat fixes
# must carry relaycast#194 and #307 compat fixes
RELAYCAST_ENGINE_DIR=/path/to/relaycast \

@khaliqgant
khaliqgant merged commit 8958ab1 into main Aug 12, 2026
37 checks passed
@khaliqgant
khaliqgant deleted the fix/fleet-load-compatible-engine-0810 branch August 12, 2026 07:57
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.

3 participants