Skip to content

V0.3.1

Choose a tag to compare

@JohnRichard4096 JohnRichard4096 released this 10 Jun 08:39
1060683

Release v0.3.1 — Panic & Recover, State Reset

This release introduces panic/recovery semantics to the workflow interpreter, improving debuggability and post-crash continuity. It also adds reset() for reinitializing execution state without recreating the interpreter.

✨ New Features

  • Panic & Recover
    Unhandled exceptions now put the interpreter into a panic state, preserving the exception, program pointer, and entire call stack. Execution can be resumed by simply calling run() or run_step_by() again on the same interpreter — ideal for post-crash debugging, auditing, or continuation workflows.

  • get_exception()
    Returns the last panic exception (or None if none occurred). Useful for inspecting crashes immediately after a failed run().

  • reset()
    Resets the interpreter’s internal state (pointer, return stack, jump flag, waiter future, panic exception) to initial values. This is independent of recovery — use it when you want to restart a workflow from scratch without creating a new interpreter.

📖 Documentation

  • Added comprehensive Panic/Recover section to the API reference, including a comparison table with Try-Catch.
  • Documented get_exception() and reset() in both English and Chinese docs.

🔧 Internal Improvements

  • Improved logging on panic: the interpreter logs the exception, pointer location, and interpreter ID before dumping state.
  • Enhanced waiter future finalization to avoid hanging on interpreter reset.

🐛 Fixes

  • Proper handling of waiter future status during reset to prevent stale waits.

Upgrade:

pip install --upgrade amrita-sense

Full Changelog: 0.3.0...0.3.1