Skip to content

restart dead tunnels#964

Open
rasdani wants to merge 6 commits intomainfrom
daniel/restart-dead-tunnels
Open

restart dead tunnels#964
rasdani wants to merge 6 commits intomainfrom
daniel/restart-dead-tunnels

Conversation

@rasdani
Copy link
Contributor

@rasdani rasdani commented Feb 27, 2026

Description

monitors and restarts tunnels that have died in CliAgentEnv and RolloutGatewayEnv

depends on PrimeIntellect-ai/prime#403

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Medium Risk
Touches tunnel lifecycle and rollout execution paths for CliAgentEnv/gateway mode; failures could surface as new TunnelErrors or change rollout timing/behavior if liveness detection is too aggressive.

Overview
Improves robustness of CliAgentEnv and RolloutGatewayMixin by detecting dead prime-tunnel processes, recreating them on demand, and surfacing mid-rollout tunnel failures as a new vf.TunnelError (including recent frpc output for debugging).

In gateway mode, adds a background tunnel health monitor that periodically restarts dead tunnels, tracks tunnel_id in state/logs, and ensures teardown_gateway() cancels the monitor before shutting down tunnels. Also bumps prime-tunnel/prime-sandboxes versions, increases gateway default timeout, and adds integration tests covering dead-tunnel recreation, health monitoring, teardown cancellation, and error raising.

Written by Cursor Bugbot for commit 3d9df75. This will update automatically on new commits. Configure here.

@rasdani rasdani marked this pull request as draft February 27, 2026 01:19
@rasdani rasdani marked this pull request as ready for review February 28, 2026 14:45
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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