Skip to content

Remote Scratchpads#136

Draft
MinuraPunchihewa wants to merge 12 commits intomainfrom
scratchpad_service
Draft

Remote Scratchpads#136
MinuraPunchihewa wants to merge 12 commits intomainfrom
scratchpad_service

Conversation

@MinuraPunchihewa
Copy link
Copy Markdown
Contributor

No description provided.

@MinuraPunchihewa MinuraPunchihewa marked this pull request as draft April 25, 2026 00:25
@entelligence-ai-pr-reviews
Copy link
Copy Markdown

EntelligenceAI PR Summary

Adds remote scratchpad execution support via a MindsDB-provisioned AWS Lightsail instance, with dynamic runtime selection, a new /remote provisioning command, and aiohttp as a required dependency.

  • anton/core/backends/remote.py: New RemoteScratchpadRuntime implementing ScratchpadRuntime ABC; delegates all scratchpad ops (start, reset, execute, install, cancel, cleanup) over HTTP/SSE; includes Cloudflare-to-direct-IP resolution with caching; exposes remote_scratchpad_runtime_factory
  • anton/chat.py: New _handle_remote async function handles API key acquisition, GET status check, POST provisioning, and up to 3-minute polling loop with /resolve and /health validation; persists URL to secrets and env; /remote command added to chat loop
  • anton/chat_session.py: New get_runtime_factory dynamically selects remote or local runtime factory; wired into ChatSessionConfig via rebuild_session
  • anton/core/settings.py: New optional remote_scratchpad_url field in CoreSettings from ANTON_REMOTE_SCRATCHPAD_URL
  • anton/chat_ui.py: _print_done_line labels elapsed time as 'Remote work' when remote URL env var is set
  • anton/commands/ui.py: /remote help entry added to print_slash_help under 'Chat Tools'
  • pyproject.toml / uv.lock: aiohttp>=3.9 and dill==0.3.8 added as core dependencies with all transitive packages pinned

Confidence Score: 3/5 - Review Recommended

Likely safe but review recommended — this PR introduces a substantial new RemoteScratchpadRuntime in anton/core/backends/remote.py that delegates scratchpad operations over HTTP/SSE to a MindsDB-provisioned AWS Lightsail instance, which is a meaningful surface area addition that warrants human review even in the absence of automated findings. The Cloudflare-to-direct-IP resolution with caching, the new /remote provisioning command, and the addition of aiohttp as a required dependency all represent non-trivial infrastructure changes that could have runtime, security, or reliability implications not captured by static analysis alone. Only 6 of 8 changed files were reviewed by automated tooling, leaving two files unexamined.

Key Findings:

  • The RemoteScratchpadRuntime in remote.py communicates over HTTP/SSE with a remote instance, introducing network-dependent behavior (timeouts, retries, partial SSE reads) that is difficult to validate without integration tests — failure modes here could silently corrupt scratchpad state.
  • Cloudflare-to-direct-IP resolution with caching in remote.py is a bespoke DNS/routing mechanism; if the cache is not invalidated correctly or if IP rotation occurs on the Lightsail side, requests could be routed to stale or incorrect endpoints without obvious error surfacing.
  • Adding aiohttp as a hard dependency (rather than optional) increases the package's install footprint and async event-loop assumptions; callers using synchronous runtimes may encounter unexpected loop conflicts if not properly isolated.
  • Two of the eight changed files were not covered by the automated review, meaning portions of the provisioning logic or command routing may not have been assessed for correctness or security.
Files requiring special attention
  • anton/core/backends/remote.py
  • anton/core/backends/__init__.py

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