Skip to content

[FE Fix]: Keep evaluator chain connected on app-revision change#4489

Open
ardaerzin wants to merge 3 commits into
mainfrom
fe-fix/evaluator-chain-run-reliability
Open

[FE Fix]: Keep evaluator chain connected on app-revision change#4489
ardaerzin wants to merge 3 commits into
mainfrom
fe-fix/evaluator-chain-run-reliability

Conversation

@ardaerzin
Copy link
Copy Markdown
Contributor

Summary

tba...

Testing

Verified locally

Added or updated tests

QA follow-up

Demo

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

changePrimaryNode cleared all output connections when the primary app
node was re-selected. Because the primary node is updated in place (its
id is preserved), the app -> evaluator edge stayed valid, but clearing it
orphaned the still-present evaluator node. connectDownstreamNode then
no-ops on the existing evaluator, so the edge was never recreated and the
evaluator silently stopped running after the first app-revision change.

Preserve connections whose endpoints still reference existing nodes
instead of clearing unconditionally.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment May 29, 2026 6:19pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40466567-738d-4ebb-959a-822df244a3e0

📥 Commits

Reviewing files that changed from the base of the PR and between a2df5cb and 752d3db.

📒 Files selected for processing (3)
  • web/packages/agenta-playground/src/state/controllers/playgroundController.ts
  • web/packages/agenta-playground/src/state/helpers/connectionGraph.ts
  • web/packages/agenta-playground/tests/unit/connectionGraph.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Switching primary nodes now preserves valid downstream connections instead of clearing all connections. Invalid connections pointing to removed nodes are automatically cleaned up.
  • Tests

    • Added unit test coverage for connection validation and pruning operations.

Walkthrough

This PR improves connection preservation when switching primary nodes in the Agenta Playground. A new pruneDanglingConnections utility filters output connections to those with valid endpoints, replacing the prior approach that cleared all connections on primary node swap. The controller imports and applies this helper to retain valid downstream connections while removing only those pointing to missing nodes.

Changes

Preserve Downstream Connections on Primary Node Switch

Layer / File(s) Summary
Connection pruning utility and tests
src/state/helpers/connectionGraph.ts, tests/unit/connectionGraph.test.ts
pruneDanglingConnections(connections, nodes) filters output connections to retain only those whose source and target node IDs both exist in the provided nodes array. Unit tests cover primary node in-place swap, missing source/target nodes, and empty inputs.
Primary node switching logic update
src/state/controllers/playgroundController.ts
changePrimaryNodeAtom now imports and calls pruneDanglingConnections to preserve valid downstream connections when switching primary nodes, instead of unconditionally clearing all connections.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description template is present but largely empty with 'tba...' placeholder, though the PR objectives provide context about the bug fix related to evaluator chain connectivity. Complete the Summary section with a clear explanation of the problem being fixed and the solution implemented, rather than leaving it as 'tba...'.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preserving evaluator chain connections when the app-revision changes by keeping nodes connected on primary node switching.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fe-fix/evaluator-chain-run-reliability

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 and usage tips.

@ardaerzin ardaerzin changed the title fix(frontend): Keep evaluator chain connected on app-revision change [FE Fix]: Keep evaluator chain connected on app-revision change May 29, 2026
@ardaerzin ardaerzin marked this pull request as ready for review May 29, 2026 18:18
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Frontend labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-0b6c.up.railway.app/w
Image tag pr-4489-20e9466
Status Failed
Railway logs Open logs
Logs View workflow run
Updated at 2026-05-29T18:27:29.095Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant