Skip to content

refactor: tighten runtime lifecycle and remove maintenance debt#3713

Open
seratch wants to merge 1 commit into
mainfrom
refactor/runtime-maintenance-cleanups
Open

refactor: tighten runtime lifecycle and remove maintenance debt#3713
seratch wants to merge 1 commit into
mainfrom
refactor/runtime-maintenance-cleanups

Conversation

@seratch

@seratch seratch commented Jul 1, 2026

Copy link
Copy Markdown
Member

This pull request improves reliability and maintainability across Realtime sessions, model retries, sandbox providers, logging, and lint configuration without changing public APIs.

Changes

  • Removes unused private helpers and stale lint suppressions.
  • Converts eager logging to lazy formatting.
  • Marks shared mutable class state with ClassVar.
  • Uses time.monotonic() for Realtime audio playback timing.
  • Cancels and awaits Realtime guardrail and tool tasks during session close.
  • Avoids creating untracked tasks from Realtime completion callbacks.
  • Tracks Daytona PTY workers and Docker cleanup tasks through provider shutdown.
  • Tracks Unix PTY file descriptor close tasks without allowing a blocked macOS os.close() to hang session teardown.
  • Consolidates PTY output collection across Unix local, Docker, Blaxel, and Daytona.
  • Consolidates E2B and Runloop rclone bootstrap and mount option handling.
  • Consolidates retry error-chain and metadata normalization shared by provider advice and runner retries.
  • Enables DTZ005, G004, RUF006, RUF012, and RUF100 after clearing the corresponding source debt.
  • Adds regression coverage for Realtime timing and cleanup, sandbox lifecycle handling, bounded Unix PTY cleanup, rclone setup, and retry normalization parity.

Compatibility

  • Does not change public APIs, import paths, dataclass field order, or __all__ membership.
  • Preserves retry decisions, PTY output ordering, mount behavior, log contents, and exception information.
  • Treats v0.17.7 as the compatibility boundary.

Verification

  • make format, make lint, make typecheck, and make tests all pass.
  • Focused Unix sandbox tests pass: 9 tests.
  • All 21 unique auto-runnable sandbox entrypoints were validated successfully.
  • After the Unix PTY cleanup fix, the affected UnixLocal PTY, UnixLocal runner, and local Temporal examples were rerun and all passed.
  • External-provider entrypoints passed for Blaxel, Cloudflare, Daytona, E2B, Modal, and Runloop.
  • Vercel and other auto-skipped helper/server entrypoints were not forced.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant