power-loop 6.47.0__tar.gz → 6.48.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {power_loop-6.47.0 → power_loop-6.48.0}/PKG-INFO +1 -1
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/__init__.py +1 -1
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/stateful_loop.py +1 -1
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/default_manifest.py +3 -1
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/default_tools.py +46 -20
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop.egg-info/PKG-INFO +1 -1
- {power_loop-6.47.0 → power_loop-6.48.0}/LICENSE +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/README.md +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/anthropic_factory.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/capabilities.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/interface.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/llm_factory.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/llm_tooling.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/llm_utils.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/multimodal.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/_vendor/llm_client/proxy_fallback.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/follow_up.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/sink.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/system_prompt.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/agent/types.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/errors.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/event_payloads.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/events.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/handlers.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/hook_contexts.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/hooks.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/messages.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/protocols.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contracts/tools.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/_redact.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/jsonl_sink.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/logging_sink.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/mcp.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/metrics_sink.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/contrib/otel_sink.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/agent_context.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/events.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/hooks.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/phase.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/pipeline.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/runner.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/core/state.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/py.typed +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/blackboard.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/budget.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/cancellation.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/capability_probe.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/compact.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/env.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/exec_backend.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/fold.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/fold_adapter.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/history_projector.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/history_sanitize.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/human_input.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/image_recall.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/memory.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/notes.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/provider.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/representation.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/retry.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/runtime_state.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/session_store.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/skills.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/spec.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/steer.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/stop_policy.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/backends/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/backends/mysql.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/backends/postgres.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/backends/sqlite.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/capabilities.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/db.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/dialect.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/factory.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/schema.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/store.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/store/types.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/structured.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/stub_provider.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/timers.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/todos.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/runtime/usage_estimate.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/blackboard.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/command_policy.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/command_rules.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/registry.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/tools/spawn_agent.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/__init__.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/api.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/engine.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/introspect.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/journal.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/result.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/resume.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/runner.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/spec.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/subprocess_executor.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/tool.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop/workflow/worker.py +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop.egg-info/SOURCES.txt +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop.egg-info/dependency_links.txt +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop.egg-info/requires.txt +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/power_loop.egg-info/top_level.txt +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/pyproject.toml +0 -0
- {power_loop-6.47.0 → power_loop-6.48.0}/setup.cfg +0 -0
|
@@ -15,7 +15,7 @@ Stability tiers
|
|
|
15
15
|
无版本承诺,可随时变更或删除。
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
|
-
__version__ = "6.
|
|
18
|
+
__version__ = "6.48.0"
|
|
19
19
|
|
|
20
20
|
# Public LLM contract (SDK-free) re-exported so callers (e.g. writing llm.* hooks or
|
|
21
21
|
# a custom LLMService) don't reach into the internal vendored transport package (H3.4).
|
|
@@ -1272,7 +1272,7 @@ class StatefulAgentLoop:
|
|
|
1272
1272
|
jobs.append({"id": "send", "kind": "foreground", "title": "当前这一轮",
|
|
1273
1273
|
"status": "running", "started_at": None, "origin": ""})
|
|
1274
1274
|
for t in await store.list_background_tasks(session_id):
|
|
1275
|
-
if t.status
|
|
1275
|
+
if t.status not in ("queued", "running"):
|
|
1276
1276
|
continue
|
|
1277
1277
|
jobs.append({"id": f"bg:{t.task_id}", "kind": "background",
|
|
1278
1278
|
"title": str(t.command or "")[:80], "status": t.status,
|
|
@@ -357,7 +357,9 @@ DEFAULT_TOOL_DEFINITIONS: list[ToolDefinition] = [
|
|
|
357
357
|
"task_id immediately. action=tool runs one async-capable TOOL in the background "
|
|
358
358
|
"(tool=<name>, args={…}) and returns a task_id at once — use it for long, "
|
|
359
359
|
"side-effect-free calls (image generation, web fetches) whose result you do not "
|
|
360
|
-
"need immediately.
|
|
360
|
+
"need immediately. Up to 8 submitted tools execute per session; excess calls are accepted "
|
|
361
|
+
"as queued and start automatically in submission order when a slot opens. No check is needed "
|
|
362
|
+
"to release a slot. **Results are delivered to you automatically on completion "
|
|
361
363
|
"(in the background updates block or a wake message) — do not poll for them.** "
|
|
362
364
|
"While a task runs, do other work, or pass_turn if there is nothing else to do. "
|
|
363
365
|
"action=check is a fallback: call it only when a wake message explicitly asks you to, "
|
|
@@ -1262,6 +1262,7 @@ class BackgroundManager:
|
|
|
1262
1262
|
# agent when they settle — the user said stop).
|
|
1263
1263
|
self._stop_tokens: dict[str, Any] = {}
|
|
1264
1264
|
self._stopped: set[str] = set()
|
|
1265
|
+
self._tool_slots: dict[tuple[Any, int, str | None], tuple[asyncio.Semaphore, int]] = {}
|
|
1265
1266
|
# Live daemon threads (so shutdown can drain them) and terminal write-backs that
|
|
1266
1267
|
# could not be delivered to their owning loop (so a later check / shutdown can
|
|
1267
1268
|
# still persist them instead of leaving the row stuck at 'running' forever).
|
|
@@ -1274,7 +1275,7 @@ class BackgroundManager:
|
|
|
1274
1275
|
Running tasks are never evicted. Caller must hold ``self._lock``."""
|
|
1275
1276
|
while len(self.tasks) > _MAX_BG_TASKS:
|
|
1276
1277
|
for tid, t in self.tasks.items(): # insertion order = oldest first
|
|
1277
|
-
if t.get("status")
|
|
1278
|
+
if t.get("status") not in ("queued", "running"):
|
|
1278
1279
|
del self.tasks[tid]
|
|
1279
1280
|
self._threads.pop(tid, None)
|
|
1280
1281
|
break
|
|
@@ -1527,9 +1528,9 @@ class BackgroundManager:
|
|
|
1527
1528
|
计费/活动打标上下文天然跟着走,不需要捕获重播。结果持久化进同一张
|
|
1528
1529
|
background 任务表(command 字段以 ``tool:`` 前缀区分);完成后调用宿主注册的
|
|
1529
1530
|
``on_tool_task_complete``(best-effort),由宿主决定要不要唤醒睡着的 agent。
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1531
|
+
每个 store/sid 的新调用最多 8 个同时执行,超出后按接收顺序等待。
|
|
1532
|
+
队列驻留当前进程;宿主重启时应把旧 queued/running 行标为 interrupted,
|
|
1533
|
+
不自动重放可能已经产生外部副作用的调用。adopt 接管已经执行的调用,不重新排队。
|
|
1533
1534
|
"""
|
|
1534
1535
|
from power_loop.core.agent_context import get_current_loop
|
|
1535
1536
|
|
|
@@ -1579,21 +1580,21 @@ class BackgroundManager:
|
|
|
1579
1580
|
+ ("\n可以后台跑的是:" + "、".join(_others) if _others else "")
|
|
1580
1581
|
)
|
|
1581
1582
|
store, sid = _current_store_and_session()
|
|
1582
|
-
if store is not None and sid is not None:
|
|
1583
|
-
rows = await store.list_background_tasks(sid)
|
|
1584
|
-
running = sum(1 for r in rows if r.status == "running" and r.command.startswith("tool:"))
|
|
1585
|
-
if running >= 8:
|
|
1586
|
-
raise ValueError("后台工具任务已达并发上限(8)——先 check 收结果再发新的。")
|
|
1587
1583
|
task_id = str(uuid.uuid4())[:8]
|
|
1588
1584
|
args = dict(args or {})
|
|
1589
1585
|
label = f"tool:{name} " + json.dumps(args, ensure_ascii=False)[:160]
|
|
1590
|
-
with self._lock:
|
|
1591
|
-
self.tasks[task_id] = {"command": label, "status": "running", "result": None}
|
|
1592
1586
|
if store is not None and sid is not None:
|
|
1593
1587
|
await store.upsert_background_task(
|
|
1594
|
-
sid, task_id=task_id, command=label, status="
|
|
1595
|
-
return_code=None, output_tail="(
|
|
1588
|
+
sid, task_id=task_id, command=label, status="queued",
|
|
1589
|
+
return_code=None, output_tail="(queued)",
|
|
1596
1590
|
)
|
|
1591
|
+
with self._lock:
|
|
1592
|
+
self.tasks[task_id] = {"command": label, "status": "queued", "result": None}
|
|
1593
|
+
# One FIFO admission gate per store/session/event loop. No await between lookup
|
|
1594
|
+
# and registration: concurrent submissions cannot oversubscribe the limit.
|
|
1595
|
+
key = (asyncio.get_running_loop(), id(store), sid)
|
|
1596
|
+
gate, users = self._tool_slots.get(key, (asyncio.Semaphore(8), 0))
|
|
1597
|
+
self._tool_slots[key] = (gate, users + 1)
|
|
1597
1598
|
|
|
1598
1599
|
# Its own ROOT stop token: a background task outlives the send that started it (the
|
|
1599
1600
|
# UI stop button stops the foreground, not this); only a stop by id reaches it.
|
|
@@ -1609,13 +1610,34 @@ class BackgroundManager:
|
|
|
1609
1610
|
async def _invoke() -> Any:
|
|
1610
1611
|
ctok = set_current_cancel_token(tok)
|
|
1611
1612
|
try:
|
|
1612
|
-
|
|
1613
|
+
async with gate:
|
|
1614
|
+
if store is not None and sid is not None:
|
|
1615
|
+
await store.upsert_background_task(
|
|
1616
|
+
sid, task_id=task_id, command=label, status="running",
|
|
1617
|
+
return_code=None, output_tail="(running)",
|
|
1618
|
+
)
|
|
1619
|
+
with self._lock:
|
|
1620
|
+
self.tasks[task_id]["status"] = "running"
|
|
1621
|
+
return await registry.invoke_async(name, args)
|
|
1613
1622
|
finally:
|
|
1614
1623
|
reset_current_cancel_token(ctok)
|
|
1615
1624
|
|
|
1616
|
-
self._supervise(task_id, label, store, sid, _invoke())
|
|
1625
|
+
worker = self._supervise(task_id, label, store, sid, _invoke())
|
|
1626
|
+
|
|
1627
|
+
def release_pool(_task: Any) -> None:
|
|
1628
|
+
semaphore, count = self._tool_slots[key]
|
|
1629
|
+
if count == 1:
|
|
1630
|
+
del self._tool_slots[key]
|
|
1631
|
+
else:
|
|
1632
|
+
self._tool_slots[key] = (semaphore, count - 1)
|
|
1633
|
+
|
|
1634
|
+
worker.add_done_callback(release_pool)
|
|
1635
|
+
# Start supervision before exposing the id, including for immediate cancellation.
|
|
1636
|
+
await asyncio.sleep(0)
|
|
1617
1637
|
return (
|
|
1618
|
-
f"
|
|
1638
|
+
f"后台任务已接收:task_id={task_id}({label[:80]})。"
|
|
1639
|
+
f"当前状态:{self.tasks[task_id]['status']}。"
|
|
1640
|
+
"同一会话最多同时执行 8 个后台工具,超出的自动排队,空出名额后自动执行,无需 check 释放名额。"
|
|
1619
1641
|
"**完成时结果会自动送到你面前,不用去取。** 现在去做别的;"
|
|
1620
1642
|
"手上没有别的可做就 pass_turn 停轮等它——用 check 反复问「好了没」只会空烧回合,"
|
|
1621
1643
|
"任务不会因此快一点,用户还得等你。"
|
|
@@ -1752,6 +1774,10 @@ class BackgroundManager:
|
|
|
1752
1774
|
if worker.done():
|
|
1753
1775
|
return "finished"
|
|
1754
1776
|
self._stopped.add(task_id)
|
|
1777
|
+
if self.tasks.get(task_id, {}).get("status") == "queued":
|
|
1778
|
+
worker.cancel()
|
|
1779
|
+
await asyncio.wait({worker}, timeout=5)
|
|
1780
|
+
return "stopped"
|
|
1755
1781
|
tok = self._stop_tokens.get(task_id)
|
|
1756
1782
|
if tok is not None and hasattr(tok, "cancel"):
|
|
1757
1783
|
tok.cancel("stopped")
|
|
@@ -1784,10 +1810,10 @@ class BackgroundManager:
|
|
|
1784
1810
|
ids = [str(x) for x in (task_ids or []) if str(x).strip()]
|
|
1785
1811
|
if not ids:
|
|
1786
1812
|
if store is not None and sid is not None:
|
|
1787
|
-
ids = [r.task_id for r in await store.list_background_tasks(sid) if str(r.status)
|
|
1813
|
+
ids = [r.task_id for r in await store.list_background_tasks(sid) if str(r.status) in ("queued", "running")]
|
|
1788
1814
|
else:
|
|
1789
1815
|
with self._lock:
|
|
1790
|
-
ids = [tid for tid, tk in self.tasks.items() if tk.get("status")
|
|
1816
|
+
ids = [tid for tid, tk in self.tasks.items() if tk.get("status") in ("queued", "running")]
|
|
1791
1817
|
if not ids:
|
|
1792
1818
|
return "没有在跑的后台任务。"
|
|
1793
1819
|
timeout_s = max(1.0, min(float(timeout_s or 600.0), 3600.0))
|
|
@@ -1797,7 +1823,7 @@ class BackgroundManager:
|
|
|
1797
1823
|
end = loop.time() + timeout_s
|
|
1798
1824
|
while loop.time() < end:
|
|
1799
1825
|
states = [(await self._status_of(store, sid, tid))[0] for tid in ids]
|
|
1800
|
-
if all(s not in ("running", "unknown") for s in states):
|
|
1826
|
+
if all(s not in ("queued", "running", "unknown") for s in states):
|
|
1801
1827
|
return
|
|
1802
1828
|
futs = {self._workers[tid] for tid in ids if tid in self._workers and not self._workers[tid].done()}
|
|
1803
1829
|
await asyncio.wait(futs or {asyncio.ensure_future(asyncio.sleep(1.0))}, timeout=1.0,
|
|
@@ -1810,7 +1836,7 @@ class BackgroundManager:
|
|
|
1810
1836
|
pending = 0
|
|
1811
1837
|
for tid in ids:
|
|
1812
1838
|
status, tail = await self._status_of(store, sid, tid)
|
|
1813
|
-
pending += status
|
|
1839
|
+
pending += status in ("queued", "running")
|
|
1814
1840
|
lines.append(f"{tid}: [{status}] {tail[-1500:] if tail else ''}".rstrip())
|
|
1815
1841
|
head = ("等的时候来了新消息,先停下来等(任务照常在跑)。" if steered
|
|
1816
1842
|
else f"还有 {pending} 件没做完(等了 {int(timeout_s)} 秒,任务照常在跑)。" if pending
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|