Skip to content

Conversation

@MkDev11
Copy link
Contributor

@MkDev11 MkDev11 commented Feb 4, 2026

Closes #3733

Description

Unifies cleanup for all runtimes (Fixes #3733).

  • BaseRuntime: Added abstract cleanup(), default stop() (calls cleanup() and returns self), and __enter__/__exit__ so any runtime can be used with with runtime:.
  • DaytonaRuntime: Renamed _cleanup() to cleanup(); stop() and __del__ call cleanup().
  • RemoteHttpRuntime: Renamed _cleanup() to cleanup(); stop(), __del__, and atexit use cleanup().
  • DockerRuntime: Added cleanup(remove=None) with stop/remove logic; stop(remove=None) calls cleanup().
  • LLMGuardRuntime: Implemented no-op cleanup().

All runtimes now share a single cleanup contract and support context-manager usage.

Checklist

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

- Add cleanup() and stop() to BaseRuntime; stop() calls cleanup() and returns self
- Add __enter__/__exit__ to BaseRuntime so any runtime can be used with 'with'
- DaytonaRuntime: rename _cleanup to cleanup(), stop() and __del__ call cleanup()
- RemoteHttpRuntime: rename _cleanup to cleanup(), stop() and __del__ and atexit use cleanup()
- DockerRuntime: add cleanup(remove=...) with stop/remove logic; stop(remove=...) calls cleanup()
- LLMGuardRuntime: add no-op cleanup()

Closes camel-ai#3733
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Collaborator

@waleedalzarooni waleedalzarooni left a comment

Choose a reason for hiding this comment

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

Great work @MkDev11,

Just a quick point to iron out before merging!

Copy link
Collaborator

@bytecii bytecii left a comment

Choose a reason for hiding this comment

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

Thanks. Left some comments. Also maybe we can add some unit tests?

@MkDev11 MkDev11 requested a review from bytecii February 4, 2026 22:30
@Wendong-Fan Wendong-Fan added this to the Sprint 48 milestone Feb 4, 2026
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

thanks @MkDev11 's contribution! some minor pre-commit issue need to be fixed, i will merge this PR first then would do enhance in another pr

@Wendong-Fan Wendong-Fan merged commit 3aae698 into camel-ai:master Feb 4, 2026
7 of 13 checks passed
@MkDev11
Copy link
Contributor Author

MkDev11 commented Feb 4, 2026

thanks @MkDev11 's contribution! some minor pre-commit issue need to be fixed, i will merge this PR first then would do enhance in another pr

cool, also can you please review my pr #1003 on eigent?

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.

[Feature Request] unify cleanup for the runtimes

4 participants