Skip to content

v0.1.3

Latest

Choose a tag to compare

@x0c x0c released this 15 Nov 08:29

0.1.3

Fix dequeue-time queue expiration and lock-contention fast-reject semantics in supervisor.

Changes

  • Dequeue-time queue_timeout enforcement: SupervisorRunner.admit() now evaluates _expired(spec, record) at the top of the admission loop before checking target_waiting or target_busy / idle fast-return, ensuring runs that exceeded their queue timeout while waiting behind an earlier lock or transition are always rejected (queue_expired) instead of being dispatched late.
  • Fast-fail on_busy="reject" behind target locks: _wait_for_target() now immediately settles with delivery="rejected", execution="failed", error.code="target_busy" when spec["on_busy"] == "reject", matching busy-session admission rather than blocking behind an earlier run's target lock.
  • Tests & Contract: Updated docs/CONTRACT.md and added regression tests test_expired_run_rejects_even_when_target_is_idle and test_on_busy_reject_fails_fast_behind_target_lock.

Install

uv venv
source .venv/bin/activate
VERSION=0.1.3
BASE=https://github.com/x0c/agent-session-control/releases/download/v${VERSION}
SESSKIT=https://github.com/x0c/sesskit/releases/download/v0.3.2/sesskit-0.3.2-py3-none-any.whl

python -m pip install "${BASE}/agent_session_control-${VERSION}-py3-none-any.whl"
# With native-history observation:
python -m pip install "${SESSKIT}" "${BASE}/agent_session_control-${VERSION}-py3-none-any.whl"

简体中文

修复 supervisor 出队时队列超时的检查顺序与锁竞争下的 on_busy="reject" 快速拒绝语义。

变更内容

  • 出队前优先校验 queue_timeout:SupervisorRunner.admit() 现在在准入循环最顶部即先检查 _expired(spec, record)(早于 target_waiting 与 target_busy/空闲快速放行),确保在排队等锁期间已超时的运行在目标变为空闲后不会被滞后派发,而是稳定落盘为 queue_expired。
  • 目标锁竞争下 on_busy="reject" 快速失败:当已有更早的运行持有 target:<session> 锁时,_wait_for_target() 若见 spec["on_busy"] == "reject",会立即结算为 delivery="rejected" / execution="failed" / error.code="target_busy",避免退化为长期排队等待。
  • 契约与测试:更新 docs/CONTRACT.md,补充 test_expired_run_rejects_even_when_target_is_idle 与 test_on_busy_reject_fails_fast_behind_target_lock 回归测试。

安装方式

uv venv
source .venv/bin/activate
VERSION=0.1.3
BASE=https://github.com/x0c/agent-session-control/releases/download/v${VERSION}
SESSKIT=https://github.com/x0c/sesskit/releases/download/v0.3.2/sesskit-0.3.2-py3-none-any.whl

python -m pip install "${BASE}/agent_session_control-${VERSION}-py3-none-any.whl"
# 如需原生历史观测:
python -m pip install "${SESSKIT}" "${BASE}/agent_session_control-${VERSION}-py3-none-any.whl"