Repository navigation
0.1.3
Fix dequeue-time queue expiration and lock-contention fast-reject semantics in supervisor.
Changes
- Dequeue-time
queue_timeoutenforcement:SupervisorRunner.admit()now evaluates_expired(spec, record)at the top of the admission loop before checkingtarget_waitingortarget_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 withdelivery="rejected",execution="failed",error.code="target_busy"whenspec["on_busy"] == "reject", matching busy-session admission rather than blocking behind an earlier run's target lock. - Tests & Contract: Updated
docs/CONTRACT.mdand added regression teststest_expired_run_rejects_even_when_target_is_idleandtest_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"