V0.7.0
Release 0.7.0 – Suspend/Resume & Queue Enhancements
We are excited to announce AmritaCore 0.7.0, a major update introducing the new suspend/resume mechanism for fine-grained control over agent execution, along with significant improvements to queue handling, token counting, and documentation.
✨ New Features
🧩 Suspend & Resume Mechanism
- Added a lightweight, non‑blocking suspend/resume system that allows external control over
ChatObjectexecution. - Core internal methods (
_entry,_run,_run_strategy, etc.) are now decorated with@suspendand automatically check for suspend signals. - New methods:
wait_to_suspend(),resume(), and_wait_for_continue()enable pausing and resuming at any point, ideal for debugging, interactive workflows, and multi‑agent coordination. - Full documentation with examples is available in the new Suspend & Resume Guide.
📦 Queue Timeout Control
ChatObjectnow acceptsqueue_timeoutandoverflow_queue_timeoutparameters to control how long it waits when queues are full.- Replaced the previous blocking loop with timeout‑aware async waits, providing more predictable behavior and a clearer error message:
"Can't keep up! Is the consumer still running?".
⚙️ Tokenizer Disable Option
- Added
no_tokenizerflag toFunctionConfig. When set toTrue, the built‑in tokenizer is skipped for responses that do not return token counts, improving performance in certain scenarios.
🔧 Improvements
-
Token Counting
get_tokens()is now a synchronous function.text_generator()gains afull_messageparameter to correctly concatenate message content for token counting, fixing potential under‑counting.
-
Logging
- Removed the unused
replace_logger_handler()function, simplifying the logging module.
- Removed the unused
-
Documentation
- Overhauled event handler examples to use the new
.handle()pattern (e.g.,@on_precompletion().handle()). - Added a new Suspend & Resume concept page in both English and Chinese.
- Updated feature list to highlight the new suspend capability (now 8 core features).
- Fixed broken links and improved several code examples.
- Overhauled event handler examples to use the new
-
Tests
- Added comprehensive tests for the suspend mechanism.
- Updated queue tests to match the new error message.
📦 Version & Compatibility
- Version bumped from 0.6.3.1 to 0.7.0.
- No breaking changes are introduced – all existing code should continue to work as before.
🙏 Acknowledgements
Thanks to all contributors who helped shape this release!
- Update jinja2-templates.md by @JohnRichard4096 in #35
- Docs: refine minimal example endpoint and user prompts by @JohnRichard4096 in #36
- Docs: wrapper usage by @JohnRichard4096 in #37
- Feat/suspend by @JohnRichard4096 in #38
Full Changelog: 0.6.3.1...0.7.0