argo-search 2.14.1 → 2.15.0
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.
- package/AGENTS.md +8 -6
- package/README.es.md +54 -832
- package/README.ja.md +53 -833
- package/README.ko.md +53 -831
- package/README.md +126 -769
- package/README.zh.md +124 -893
- package/SKILL.md +17 -18
- package/assets/readme/counts.json +1 -1
- package/assets/readme/hero.svg +23 -23
- package/backends/concept_vectors.bin +0 -0
- package/backends/domain_profiles.json +42 -0
- package/backends/engine_concept_vectors.json +1525 -1525
- package/backends/engine_registry.yaml +124 -28
- package/backends/quota_profiles.json +70 -0
- package/bin/argo +30 -17
- package/config.yaml +173 -33
- package/docs/ADDING_NEW_ENGINE.md +10 -0
- package/docs/ARGO_INTRO.md +1 -1
- package/docs/CHANGELOG.md +23 -0
- package/docs/ENGINE_CATALOG.md +97 -85
- package/docs/MCP_SETUP.md +1 -1
- package/docs/RELEASE_NOTES_v2.14.1.md +4 -4
- package/docs/RELEASE_NOTES_v2.15.0.md +50 -0
- package/docs/RELEASING.md +1 -1
- package/engines/specs/ai_labs.yaml +89 -0
- package/engines/specs/bilibili_hot.yaml +11 -1
- package/engines/specs/brave.yaml +3 -3
- package/engines/specs/cisa_alerts.yaml +40 -0
- package/engines/specs/cn_ai_news.yaml +10 -8
- package/engines/specs/digup.yaml +11 -6
- package/engines/specs/douyin_hot.yaml +11 -1
- package/engines/specs/dw_news.yaml +4 -2
- package/engines/specs/eng_blogs.yaml +63 -0
- package/engines/specs/europeana.yaml +3 -4
- package/engines/specs/felo.yaml +3 -3
- package/engines/specs/firecrawl.yaml +3 -0
- package/engines/specs/fourget.yaml +5 -2
- package/engines/specs/france24.yaml +6 -4
- package/engines/specs/fxtwitter.yaml +29 -6
- package/engines/specs/grepapp_mcp.yaml +62 -0
- package/engines/specs/guardian_rss.yaml +6 -4
- package/engines/specs/itotii.yaml +13 -1
- package/engines/specs/lobsters.yaml +41 -0
- package/engines/specs/local_seek.yaml +6 -0
- package/engines/specs/open_meteo.yaml +1 -1
- package/engines/specs/redskill.yaml +2 -0
- package/engines/specs/searxng.yaml +4 -2
- package/engines/specs/sec_edgar.yaml +8 -3
- package/engines/specs/tinyfish.yaml +2 -0
- package/engines/specs/tinyfish_news.yaml +2 -0
- package/engines/specs/tinyfish_paper.yaml +2 -0
- package/engines/specs/toutiao_hot.yaml +11 -1
- package/engines/specs/train.yaml +3 -0
- package/engines/specs/twitter.yaml +4 -0
- package/engines/specs/unpaywall.yaml +6 -0
- package/engines/specs/vam.yaml +17 -3
- package/engines/specs/weibo_hot.yaml +11 -1
- package/engines/specs/wolframalpha.yaml +3 -3
- package/engines/specs/xiaohongshu.yaml +2 -0
- package/engines/specs/zhihu.yaml +3 -18
- package/engines/specs/zhihu_kb.yaml +18 -0
- package/engines/specs/zhihu_questions.yaml +19 -0
- package/package.json +3 -2
- package/packages/dsh-plugin/README.md +9 -14
- package/packages/dsh-plugin/dsh/client.js +467 -1024
- package/packages/dsh-plugin/dsh/diagnostics.js +71 -20
- package/packages/dsh-plugin/dsh/runner.js +2 -0
- package/packages/dsh-plugin/package.json +8 -3
- package/packages/dsh-plugin/scripts/sync-local.mjs +87 -0
- package/packages/dsh-plugin/scripts/sync-local.sh +13 -1
- package/packages/dsh-plugin/test/diagnostics.test.js +38 -1
- package/packages/dsh-plugin/test/size-gate.test.js +2 -9
- package/scripts/adaptive.py +7 -1
- package/scripts/archive_run.py +112 -53
- package/scripts/argo_paths.py +40 -3
- package/scripts/badcase_ledger.py +108 -9
- package/scripts/build_concept_table.py +112 -55
- package/scripts/cache.py +5 -1
- package/scripts/caliber_isolation.py +60 -23
- package/scripts/circuit_breaker.py +56 -8
- package/scripts/cli_io.py +20 -2
- package/scripts/config_cache.py +31 -0
- package/scripts/daemon.py +146 -51
- package/scripts/dormant_ledger.py +23 -9
- package/scripts/engine_dispatch.py +3 -3
- package/scripts/engine_env.py +182 -1
- package/scripts/engine_families.py +50 -7
- package/scripts/engine_states.py +3 -50
- package/scripts/engine_validate.py +13 -45
- package/scripts/engines.py +15 -31
- package/scripts/engines_base.py +42 -58
- package/scripts/engines_builders.py +0 -15
- package/scripts/engines_builders_batch10.py +346 -100
- package/scripts/engines_builders_batch11.py +2 -75
- package/scripts/engines_builders_batch9.py +15 -24
- package/scripts/engines_builders_cn.py +0 -194
- package/scripts/engines_builders_feeds.py +55 -5
- package/scripts/engines_builders_intl.py +15 -115
- package/scripts/engines_builders_pixiv.py +2 -16
- package/scripts/engines_builders_search.py +7 -14
- package/scripts/engines_builders_tech.py +5 -14
- package/scripts/engines_builders_weather.py +236 -0
- package/scripts/engines_fields.py +91 -0
- package/scripts/engines_http.py +135 -0
- package/scripts/engines_mcp.py +383 -0
- package/scripts/engines_parsers.py +13 -369
- package/scripts/engines_schema_drift.py +260 -0
- package/scripts/evidence.py +13 -0
- package/scripts/evidence_loop.py +4 -3
- package/scripts/fetch_jsrun.py +15 -11
- package/scripts/fetch_v3.py +28 -28
- package/scripts/fulltext_store.py +42 -1
- package/scripts/fxtwitter_api.py +8 -7
- package/scripts/gen_engine_catalog.py +2 -2
- package/scripts/general_pool.py +15 -4
- package/scripts/health_check.py +1 -1
- package/scripts/link_source.py +65 -24
- package/scripts/local_seek_adapter.py +57 -17
- package/scripts/mcp_handlers.py +53 -31
- package/scripts/mcp_handlers_surface.py +6 -18
- package/scripts/mcp_transport.py +1 -1
- package/scripts/min_version_scan.py +7 -3
- package/scripts/network_aware.py +7 -13
- package/scripts/pre-commit +45 -43
- package/scripts/query_understanding.py +30 -6
- package/scripts/quota.py +6 -1
- package/scripts/rank_signals.py +9 -0
- package/scripts/recompute.py +15 -5
- package/scripts/recovery.py +21 -15
- package/scripts/release.py +14 -26
- package/scripts/release_check.py +5 -25
- package/scripts/replay_eval.py +2 -2
- package/scripts/research_cli.py +40 -0
- package/scripts/research_notes.py +368 -0
- package/scripts/route.py +32 -70
- package/scripts/route_audit.py +259 -0
- package/scripts/route_combo.py +10 -4
- package/scripts/route_domains.py +150 -23
- package/scripts/route_lang.py +20 -7
- package/scripts/route_log.py +26 -9
- package/scripts/route_policy.py +85 -6
- package/scripts/route_telemetry_export.py +199 -0
- package/scripts/rrf_classic.py +5 -22
- package/scripts/search.py +2 -1
- package/scripts/search_attribution.py +33 -10
- package/scripts/search_entry.py +5 -1
- package/scripts/search_output.py +5 -4
- package/scripts/search_pipeline.py +12 -0
- package/scripts/search_rank.py +21 -11
- package/scripts/semantic_evidence.py +375 -168
- package/scripts/settings_page.py +3 -3
- package/scripts/social_engines/xiaohongshu_engine.py +2 -1
- package/scripts/social_engines/zhihu_engine.py +251 -43
- package/scripts/sogou_weixin_browser.py +5 -6
- package/scripts/source_audit.py +2 -2
- package/scripts/source_ledger.py +2 -15
- package/scripts/source_selection.py +45 -20
- package/scripts/straggler_policy.py +1 -2
- package/scripts/sync_backends.py +17 -0
- package/scripts/tfidf_router.py +23 -11
- package/scripts/time_utils.py +54 -1
- package/scripts/train.py +68 -2
- package/scripts/usage_log.py +26 -1
- package/sub-skills/argo-wide-research/SKILL.md +68 -0
- package/sub-skills/ego-search/SKILL.md +1 -1
- package/sub-skills/local-seek/scripts/seek_fts.py +58 -3
- package/scripts/caliber_dedupe.py +0 -66
- package/scripts/engines_builders_batch16.py +0 -13
- package/scripts/health_probe.py +0 -253
- package/scripts/social_engines/twitter_engine.py +0 -514
- package/scripts/sync_installs.py +0 -29
|
@@ -13,6 +13,7 @@ from __future__ import annotations
|
|
|
13
13
|
import hashlib
|
|
14
14
|
import json
|
|
15
15
|
import os
|
|
16
|
+
import re
|
|
16
17
|
import threading
|
|
17
18
|
import time
|
|
18
19
|
from pathlib import Path
|
|
@@ -54,6 +55,13 @@ OPEN_SECONDS = 60 # 熔断冷却
|
|
|
54
55
|
EMPTY_NEGATIVE_TTL = 45 # 空结果负缓存(秒)
|
|
55
56
|
ERROR_NEGATIVE_TTL = 30 # 错误负缓存(秒)
|
|
56
57
|
HALF_OPEN_PROBE = True # 冷却后允许一次探测
|
|
58
|
+
# 限流/封锁类源站行为的指数冷却阶梯(秒):不改变 closed 态、不累计 opens、不触发 auto_disabled,
|
|
59
|
+
# 仅通过 cooldown_until 阻止同类 429/WAF 引擎每 60s 内无效空转。
|
|
60
|
+
RATE_LIMIT_COOLDOWNS = (60, 300, 900)
|
|
61
|
+
_COOLDOWN_KINDS = frozenset({
|
|
62
|
+
engine_states.BREAKER_KIND_RATE_LIMITED,
|
|
63
|
+
engine_states.BREAKER_KIND_BLOCKED,
|
|
64
|
+
})
|
|
57
65
|
|
|
58
66
|
# 自适应禁用(v2.7)
|
|
59
67
|
DISABLE_AFTER_OPENS = 3 # 连续 open 达此次数 → 自动禁用(持久跳过)
|
|
@@ -182,11 +190,15 @@ class CircuitBreaker:
|
|
|
182
190
|
"suspected_stale": self._suspected_stale_locked(st),
|
|
183
191
|
"auth_disabled": bool(st.get("auth_disabled")),
|
|
184
192
|
"auth_streak": int(st.get("auth_streak") or 0),
|
|
193
|
+
"cooldown_streak": int(st.get("cooldown_streak") or 0),
|
|
185
194
|
# 用 time.time()(墙钟)而非 time.monotonic():熔断状态持久化到文件,
|
|
186
195
|
# 跨进程恢复时 opened_at 必须可比较。monotonic 在不同进程间基准不同,
|
|
187
196
|
# 换用会导致跨进程冷却判断错误。时钟回拨风险可控(只会让冷却提前结束)。
|
|
188
|
-
"cooldown_remain": max(
|
|
189
|
-
|
|
197
|
+
"cooldown_remain": max(
|
|
198
|
+
max(0, int(OPEN_SECONDS - (time.time() - opened_at)))
|
|
199
|
+
if state == engine_states.BREAKER_OPEN else 0,
|
|
200
|
+
max(0, int(float(st.get("cooldown_until") or 0) - time.time())),
|
|
201
|
+
),
|
|
190
202
|
}
|
|
191
203
|
|
|
192
204
|
@staticmethod
|
|
@@ -277,6 +289,10 @@ class CircuitBreaker:
|
|
|
277
289
|
return True, "half_open_probe"
|
|
278
290
|
remain = int(OPEN_SECONDS - (time.time() - opened_at))
|
|
279
291
|
return False, f"circuit_open:{remain}s"
|
|
292
|
+
cooldown_until = float(st.get("cooldown_until") or 0)
|
|
293
|
+
soft_remain = cooldown_until - time.time()
|
|
294
|
+
if soft_remain > 0:
|
|
295
|
+
return False, f"rate_limit_cooldown:{max(1, int(soft_remain))}s"
|
|
280
296
|
return True, engine_states.BREAKER_CLOSED
|
|
281
297
|
|
|
282
298
|
def _mutate_locked(self, mutator) -> None:
|
|
@@ -340,6 +356,8 @@ class CircuitBreaker:
|
|
|
340
356
|
and not st.get("empty_streak")
|
|
341
357
|
and not st.get("empty_recent")
|
|
342
358
|
and not st.get("auth_streak")
|
|
359
|
+
and not st.get("cooldown_streak")
|
|
360
|
+
and not st.get("cooldown_until")
|
|
343
361
|
and st.get("ever_nonempty")):
|
|
344
362
|
# 已健康且无任何待清理状态:内存短路,零写盘。
|
|
345
363
|
# ever_nonempty 必须参与短路判定:升级前落盘的存量干净条目没有
|
|
@@ -380,15 +398,16 @@ class CircuitBreaker:
|
|
|
380
398
|
「跨 ≥2 个不同查询」的去重(同一查询反复空不构成引擎失效证据)。
|
|
381
399
|
|
|
382
400
|
empty 语义是「该查询无结果」——查询级信号,不是引擎级故障。
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
401
|
+
它只进 45s 负缓存(EMPTY_NEGATIVE_TTL,防止重复打无效源),
|
|
402
|
+
不设 cooldown、不累计 opens,因此永远不会驱动 auto-disable
|
|
403
|
+
(否则聚合引擎/local 源等易空引擎会被误判为持续故障而静默禁用)。
|
|
386
404
|
|
|
387
405
|
blocked / rate-limited 语义是「源站行为,不是引擎坏了」——前者是
|
|
388
406
|
请求在到达内容前被拦截(反爬/指纹/挑战页),后者是源端限流。
|
|
389
|
-
|
|
390
|
-
auto-disable
|
|
391
|
-
|
|
407
|
+
走指数冷却阶梯(RATE_LIMIT_COOLDOWNS,60/300/900s,经 cooldown_until
|
|
408
|
+
拒绝探测)、不累计 opens:把封锁/限流当引擎故障累计到 auto-disable
|
|
409
|
+
是封错人——引擎实现没有问题,换客户端形态、等冷却或等源站策略
|
|
410
|
+
变化即可恢复。
|
|
392
411
|
"""
|
|
393
412
|
self._mutate_locked(
|
|
394
413
|
lambda: self._mutate_failure(engine, kind, attribution, query))
|
|
@@ -447,11 +466,17 @@ class CircuitBreaker:
|
|
|
447
466
|
st["last_kind"] = kind
|
|
448
467
|
if attribution:
|
|
449
468
|
st["last_attribution"] = dict(attribution)
|
|
469
|
+
self._apply_flat_observation(st, attribution)
|
|
450
470
|
# empty(无结果)与 blocked(被拦截)都是查询级/源站级信号,不驱动
|
|
451
471
|
# open 熔断:否则「空结果→open 60s→half_open→再 open」无效 churn,
|
|
452
472
|
# 还占主位阻塞 6s。仅 error/timeout 驱动稳定 state 切换(空结果由
|
|
453
473
|
# 负缓存短 TTL 保底)。2026-08 修复;blocked 2026-09 并入同语义。
|
|
454
474
|
# 已因 auth 直达 disabled 的不再被 opens 块盖回 open(禁用优先)。
|
|
475
|
+
if kind in _COOLDOWN_KINDS:
|
|
476
|
+
streak = int(st.get("cooldown_streak") or 0) + 1
|
|
477
|
+
st["cooldown_streak"] = streak
|
|
478
|
+
dur = RATE_LIMIT_COOLDOWNS[min(streak - 1, len(RATE_LIMIT_COOLDOWNS) - 1)]
|
|
479
|
+
st["cooldown_until"] = time.time() + dur
|
|
455
480
|
if (drives_opens and st.get("state") != engine_states.BREAKER_DISABLED
|
|
456
481
|
and (st["failures"] >= FAILURE_THRESHOLD
|
|
457
482
|
or st.get("state") == engine_states.BREAKER_HALF_OPEN)):
|
|
@@ -525,10 +550,33 @@ class CircuitBreaker:
|
|
|
525
550
|
def _m() -> None:
|
|
526
551
|
st = self._engines.get(engine) or {"failures": 0, "state": engine_states.BREAKER_CLOSED}
|
|
527
552
|
st["last_attribution"] = dict(attribution)
|
|
553
|
+
self._apply_flat_observation(st, attribution)
|
|
528
554
|
self._engines[engine] = st
|
|
529
555
|
|
|
530
556
|
self._mutate_locked(_m)
|
|
531
557
|
|
|
558
|
+
@staticmethod
|
|
559
|
+
def _apply_flat_observation(st: dict[str, Any],
|
|
560
|
+
attribution: dict[str, Any] | None) -> None:
|
|
561
|
+
"""把归因平铺成状态文件里可直接读的 last_http/last_error。
|
|
562
|
+
|
|
563
|
+
HTTP 码在 engine_failure.classify 的输出里编在 reason/evidence 字符串
|
|
564
|
+
(http-403 形态),诊断时得解析嵌套 dict——平铺后 403/401/402 一眼可见
|
|
565
|
+
(2026-11-14 运行时审计 C 类:bocha 欠费 403 只能碰巧从 quota.json
|
|
566
|
+
看到,熔断台账自己答不了「为什么」)。缺码或无归因时不写字段。
|
|
567
|
+
"""
|
|
568
|
+
if not attribution:
|
|
569
|
+
return
|
|
570
|
+
blob = " ".join(str(attribution.get(k) or "")
|
|
571
|
+
for k in ("reason", "evidence"))
|
|
572
|
+
m = re.search(r"http-(\d{3})", blob)
|
|
573
|
+
if m:
|
|
574
|
+
st["last_http"] = int(m.group(1))
|
|
575
|
+
err = (str(attribution.get("reason") or "")
|
|
576
|
+
or str(attribution.get("evidence") or "")).strip()
|
|
577
|
+
if err:
|
|
578
|
+
st["last_error"] = err[:120]
|
|
579
|
+
|
|
532
580
|
def auto_disabled(self) -> list[str]:
|
|
533
581
|
"""返回所有处于自动禁用状态的引擎。"""
|
|
534
582
|
with self._lock:
|
package/scripts/cli_io.py
CHANGED
|
@@ -55,8 +55,8 @@ import sys
|
|
|
55
55
|
import time
|
|
56
56
|
from typing import Any
|
|
57
57
|
|
|
58
|
-
__all__ = ["stdin_is_piped", "
|
|
59
|
-
"ensure_utf8_stdio"]
|
|
58
|
+
__all__ = ["stdin_is_piped", "stdin_is_memory_stream", "read_stdin_if_piped",
|
|
59
|
+
"dumps", "dumps_pretty", "ensure_utf8_stdio"]
|
|
60
60
|
|
|
61
61
|
# stdout 的紧凑分隔符(无冗余空格):与 mcp_handlers._dumps 的默认计算方式一致。
|
|
62
62
|
_COMPACT = (",", ":")
|
|
@@ -143,6 +143,24 @@ def stdin_is_piped() -> bool:
|
|
|
143
143
|
return mode is not None and (stat.S_ISFIFO(mode) or stat.S_ISREG(mode))
|
|
144
144
|
|
|
145
145
|
|
|
146
|
+
def stdin_is_memory_stream() -> bool:
|
|
147
|
+
"""stdin 是否为无 OS fd 但仍打开的非 TTY 文本流(如单测 io.StringIO)。
|
|
148
|
+
|
|
149
|
+
``stdin_is_piped()`` 依 ``fstat(fileno())`` 判定,对 ``io.StringIO`` 返回 False;
|
|
150
|
+
调用方如需在无真实 fd 的单测里同样走读流路径而非打开 ``/dev/tty``(如
|
|
151
|
+
``getpass.getpass``),可叠加本判据。"""
|
|
152
|
+
import io
|
|
153
|
+
|
|
154
|
+
stdin = getattr(sys, "stdin", None)
|
|
155
|
+
if not isinstance(stdin, io.TextIOBase) or getattr(stdin, "closed", False):
|
|
156
|
+
return False
|
|
157
|
+
try:
|
|
158
|
+
stdin.fileno()
|
|
159
|
+
return False
|
|
160
|
+
except (OSError, ValueError, AttributeError):
|
|
161
|
+
return not stdin.isatty()
|
|
162
|
+
|
|
163
|
+
|
|
146
164
|
def _stdin_mode() -> int | None:
|
|
147
165
|
"""stdin 的 st_mode;取不到(已关闭 / 非法 fd)返回 None。
|
|
148
166
|
|
package/scripts/config_cache.py
CHANGED
|
@@ -23,6 +23,7 @@ from __future__ import annotations
|
|
|
23
23
|
import hashlib
|
|
24
24
|
import json
|
|
25
25
|
import os
|
|
26
|
+
import time
|
|
26
27
|
from pathlib import Path
|
|
27
28
|
from typing import Any
|
|
28
29
|
|
|
@@ -366,6 +367,10 @@ def _save_config_disk_cache(st: os.stat_result, scan: tuple[float, int, int, str
|
|
|
366
367
|
_sweep_orphan_cache_slots(path)
|
|
367
368
|
|
|
368
369
|
|
|
370
|
+
# 存活但陈旧 checkout 槽的回收阈值:槽 mtime = 该 checkout 最后一次加载配置。
|
|
371
|
+
_SLOT_STALE_S = 7 * 86400
|
|
372
|
+
|
|
373
|
+
|
|
369
374
|
def _sweep_orphan_cache_slots(keep: Path) -> None:
|
|
370
375
|
"""回收「config_path 已不存在」的缓存槽;任何失败静默。
|
|
371
376
|
|
|
@@ -377,6 +382,12 @@ def _sweep_orphan_cache_slots(keep: Path) -> None:
|
|
|
377
382
|
config 的旧摘要」来删——那会误删另一个 checkout 正在用的槽。只删 config_path
|
|
378
383
|
在盘上已消失的槽,既不误伤活着的 checkout,又能自愈任何来源的临时副本。
|
|
379
384
|
|
|
385
|
+
2026-11-14 补第三条:槽 7 天未写即回收。自愈机制曾被「还活着的 checkout」
|
|
386
|
+
绕过——~/tmp 评测 checkout 与 argo-history 归档的 config.yaml 永久存在,
|
|
387
|
+
它们的槽按旧判据永远够不着(生产库实测 6 槽约 1.4MB,4 槽属此类)。槽的
|
|
388
|
+
mtime 就是那个 checkout 最后一次加载配置的时刻,一周没写 = 一周没跑过
|
|
389
|
+
搜索;缓存本可再生(重建一次 16-50ms),陈槽无保留价值。
|
|
390
|
+
|
|
380
391
|
时机:只在写缓存时顺带扫(缓存未命中才写,属低频)。临时 checkout 自己写槽
|
|
381
392
|
时就会回收上一批的遗留,所以污染源活跃时回收也随之发生。
|
|
382
393
|
"""
|
|
@@ -386,6 +397,12 @@ def _sweep_orphan_cache_slots(keep: Path) -> None:
|
|
|
386
397
|
siblings = list(keep.parent.glob("config-cache-*.json"))
|
|
387
398
|
except OSError:
|
|
388
399
|
return
|
|
400
|
+
keep_cfg = ""
|
|
401
|
+
try:
|
|
402
|
+
keep_payload = json.loads(keep.read_text(encoding="utf-8"))
|
|
403
|
+
keep_cfg = str(((keep_payload.get("key") or {}).get("config_path")) or "").strip()
|
|
404
|
+
except Exception:
|
|
405
|
+
pass
|
|
389
406
|
for path in siblings:
|
|
390
407
|
if path == keep:
|
|
391
408
|
continue
|
|
@@ -400,3 +417,17 @@ def _sweep_orphan_cache_slots(keep: Path) -> None:
|
|
|
400
417
|
path.unlink()
|
|
401
418
|
except OSError:
|
|
402
419
|
continue
|
|
420
|
+
elif cfg_path and keep_cfg and cfg_path == keep_cfg:
|
|
421
|
+
# 同一 checkout 历史指纹槽且已超 2 小时未动:安全回收,防多轮改配置无界泄漏
|
|
422
|
+
try:
|
|
423
|
+
if (time.time() - path.stat().st_mtime) > 7200:
|
|
424
|
+
path.unlink()
|
|
425
|
+
except OSError:
|
|
426
|
+
pass
|
|
427
|
+
elif cfg_path:
|
|
428
|
+
# 存活但陈旧的 checkout 槽(第三条判据,见 docstring)
|
|
429
|
+
try:
|
|
430
|
+
if (time.time() - path.stat().st_mtime) > _SLOT_STALE_S:
|
|
431
|
+
path.unlink()
|
|
432
|
+
except OSError:
|
|
433
|
+
pass
|
package/scripts/daemon.py
CHANGED
|
@@ -207,29 +207,43 @@ def _pid_path() -> str:
|
|
|
207
207
|
return str(state_path(PID_NAME + "-" + _tree_tag()))
|
|
208
208
|
|
|
209
209
|
|
|
210
|
-
def
|
|
211
|
-
"""核实 pid 的命令行确实是本 daemon(macOS/Linux ps,Windows 视为不是)。
|
|
212
|
-
|
|
213
|
-
误杀的代价不对称:漏杀只是留一个下次 start 时 ping 不到、自己会空闲退出的
|
|
214
|
-
进程;错杀是 SIGTERM 一个无关进程。所以判据从紧——单独出现 "daemon.py"
|
|
215
|
-
子串不够(编辑器/别仓同名脚本都会中)。
|
|
216
|
-
|
|
217
|
-
必须识别两种启动形态(2026-10-13 实测发现第二种此前漏判):
|
|
218
|
-
A. `python <本仓>/scripts/daemon.py start`——直接调用与 autostart 派生;
|
|
219
|
-
B. `./bin/argo daemon start`——bin/argo 经 runpy 原地执行时,Python 层的
|
|
220
|
-
sys.argv 被改写但**内核记录的 argv 不变**,ps 里始终是 bin/argo 形态。
|
|
221
|
-
此前只认 A,B 形态下 stop 的 pid 兜底补刀会漏判,留孤儿进程。
|
|
222
|
-
"""
|
|
210
|
+
def _pid_alive(pid: int) -> bool:
|
|
223
211
|
if os.name == "nt":
|
|
224
|
-
|
|
225
|
-
|
|
212
|
+
import subprocess
|
|
213
|
+
try:
|
|
214
|
+
r = subprocess.run(["tasklist", "/FI", f"PID eq {pid}", "/NH", "/FO", "CSV"],
|
|
215
|
+
capture_output=True, text=True, timeout=5,
|
|
216
|
+
encoding="utf-8", errors="replace")
|
|
217
|
+
return f'"{pid}"' in (r.stdout or "")
|
|
218
|
+
except OSError:
|
|
219
|
+
return False
|
|
226
220
|
try:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
cmd = (r.stdout or "").strip()
|
|
231
|
-
except Exception:
|
|
221
|
+
os.kill(pid, 0)
|
|
222
|
+
return True
|
|
223
|
+
except OSError:
|
|
232
224
|
return False
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _pid_is_daemon(pid: int) -> bool:
|
|
228
|
+
"""核实 pid 的命令行确实是本 daemon(POSIX ps / Windows PowerShell CIM)。"""
|
|
229
|
+
import subprocess
|
|
230
|
+
if os.name == "nt":
|
|
231
|
+
try:
|
|
232
|
+
ps_cmd = f"(Get-CimInstance Win32_Process -Filter 'ProcessId={pid}').CommandLine"
|
|
233
|
+
r = subprocess.run(["powershell", "-NoProfile", "-Command", ps_cmd],
|
|
234
|
+
capture_output=True, text=True, timeout=5,
|
|
235
|
+
encoding="utf-8", errors="replace")
|
|
236
|
+
cmd = (r.stdout or "").strip()
|
|
237
|
+
except OSError:
|
|
238
|
+
return False
|
|
239
|
+
else:
|
|
240
|
+
try:
|
|
241
|
+
r = subprocess.run(["ps", "-p", str(pid), "-o", "command="],
|
|
242
|
+
capture_output=True, text=True, timeout=5,
|
|
243
|
+
encoding="utf-8", errors="replace")
|
|
244
|
+
cmd = (r.stdout or "").strip()
|
|
245
|
+
except OSError:
|
|
246
|
+
return False
|
|
233
247
|
if not cmd:
|
|
234
248
|
return False
|
|
235
249
|
toks = cmd.split()
|
|
@@ -247,6 +261,54 @@ def _log_path() -> str:
|
|
|
247
261
|
return str(state_path(LOG_NAME + "-" + _tree_tag()))
|
|
248
262
|
|
|
249
263
|
|
|
264
|
+
# 日志轮转:daemon 生命周期短(空闲自杀),增长慢,启动时检查一次足够。
|
|
265
|
+
# 曾完全无轮转(只靠空闲自杀间接限速),18 天积 405 行属侥幸而非机制。
|
|
266
|
+
_LOG_MAX_BYTES = 1 * 1024 * 1024
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def _rotate_log_if_needed() -> None:
|
|
270
|
+
"""日志超 1MB 时轮转为 .1(旧的 .1 直接淘汰,不保多代)。
|
|
271
|
+
|
|
272
|
+
轮转失败不拦启动:日志是观测件,写不进去也比起不来强。
|
|
273
|
+
"""
|
|
274
|
+
p = _log_path()
|
|
275
|
+
try:
|
|
276
|
+
if os.path.exists(p) and os.path.getsize(p) > _LOG_MAX_BYTES:
|
|
277
|
+
old = p + ".1"
|
|
278
|
+
if os.path.exists(old):
|
|
279
|
+
os.unlink(old)
|
|
280
|
+
os.replace(p, old)
|
|
281
|
+
except OSError:
|
|
282
|
+
pass
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
class _TimestampedStdout:
|
|
286
|
+
"""行级时间戳包装:daemon.log 曾零时间戳,重启频率与崩溃间隔无法回答
|
|
287
|
+
(2026-11-14 运行时审计 C 类实锤)。服务输出统一加 [ISO-8601] 前缀。
|
|
288
|
+
|
|
289
|
+
只包装文本流;fd 重定向(dup2)不走这里,外部轮转不受影响。
|
|
290
|
+
"""
|
|
291
|
+
|
|
292
|
+
def __init__(self, raw):
|
|
293
|
+
self._raw = raw
|
|
294
|
+
self._at_line_start = True
|
|
295
|
+
|
|
296
|
+
def write(self, s):
|
|
297
|
+
if not s:
|
|
298
|
+
return 0
|
|
299
|
+
now = time.strftime("%Y-%m-%dT%H:%M:%S")
|
|
300
|
+
out = []
|
|
301
|
+
for chunk in s.splitlines(keepends=True):
|
|
302
|
+
if self._at_line_start and chunk.strip():
|
|
303
|
+
out.append(f"[{now}] ")
|
|
304
|
+
out.append(chunk)
|
|
305
|
+
self._at_line_start = chunk.endswith("\n")
|
|
306
|
+
return self._raw.write("".join(out))
|
|
307
|
+
|
|
308
|
+
def flush(self):
|
|
309
|
+
self._raw.flush()
|
|
310
|
+
|
|
311
|
+
|
|
250
312
|
def _atomic_write(path: str, text: str) -> None:
|
|
251
313
|
d = os.path.dirname(path)
|
|
252
314
|
if d:
|
|
@@ -640,6 +702,56 @@ def _quiet_stop(sp: str) -> bool:
|
|
|
640
702
|
return False
|
|
641
703
|
|
|
642
704
|
|
|
705
|
+
def _terminate_pid(pid: int) -> None:
|
|
706
|
+
if os.name == "nt":
|
|
707
|
+
import subprocess
|
|
708
|
+
subprocess.run(["taskkill", "/PID", str(pid), "/F"],
|
|
709
|
+
capture_output=True, timeout=5)
|
|
710
|
+
return
|
|
711
|
+
os.kill(pid, signal.SIGTERM)
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
def _redirect_stdio_to_log() -> None:
|
|
715
|
+
log_dir = os.path.dirname(_log_path())
|
|
716
|
+
if log_dir:
|
|
717
|
+
os.makedirs(log_dir, exist_ok=True)
|
|
718
|
+
_rotate_log_if_needed()
|
|
719
|
+
log = open(_log_path(), "ab", buffering=0)
|
|
720
|
+
os.dup2(log.fileno(), 0)
|
|
721
|
+
os.dup2(log.fileno(), 1)
|
|
722
|
+
os.dup2(log.fileno(), 2)
|
|
723
|
+
with contextlib.suppress(OSError):
|
|
724
|
+
log.close()
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
def _wait_ready_and_report(args: argparse.Namespace) -> int:
|
|
728
|
+
deadline = time.time() + 10
|
|
729
|
+
while time.time() < deadline:
|
|
730
|
+
try:
|
|
731
|
+
info = ping(_sock_path(), 0.5)
|
|
732
|
+
msg = {"ok": True, "pid": info.get("pid")}
|
|
733
|
+
print(json.dumps(msg, ensure_ascii=False) if args.json
|
|
734
|
+
else f"argo daemon 已启动 pid={info.get('pid')} socket={_sock_path()}")
|
|
735
|
+
return 0
|
|
736
|
+
except Exception:
|
|
737
|
+
time.sleep(0.05)
|
|
738
|
+
print(json.dumps({"ok": False, "error": "启动超时", "log": _log_path()},
|
|
739
|
+
ensure_ascii=False) if args.json
|
|
740
|
+
else f"argo daemon 启动超时,看日志:{_log_path()}", file=sys.stderr)
|
|
741
|
+
return 1
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
def _start_detached_windows(args: argparse.Namespace) -> int:
|
|
745
|
+
import subprocess
|
|
746
|
+
flags = getattr(subprocess, "DETACHED_PROCESS", 0x00000008) | getattr(
|
|
747
|
+
subprocess, "CREATE_NEW_PROCESS_GROUP", 0x00000200)
|
|
748
|
+
cmd = [sys.executable, os.path.abspath(__file__), "start",
|
|
749
|
+
"--foreground", "--detached-log", "--idle-exit", str(args.idle_exit)]
|
|
750
|
+
subprocess.Popen(cmd, creationflags=flags, close_fds=True,
|
|
751
|
+
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
752
|
+
return _wait_ready_and_report(args)
|
|
753
|
+
|
|
754
|
+
|
|
643
755
|
def _start(args: argparse.Namespace) -> int:
|
|
644
756
|
alive = _alive()
|
|
645
757
|
if alive:
|
|
@@ -728,38 +840,18 @@ def _start(args: argparse.Namespace) -> int:
|
|
|
728
840
|
except Exception:
|
|
729
841
|
pass
|
|
730
842
|
|
|
731
|
-
if args.foreground
|
|
843
|
+
if args.foreground:
|
|
844
|
+
if getattr(args, "detached_log", False):
|
|
845
|
+
_redirect_stdio_to_log()
|
|
732
846
|
_serve_child(args)
|
|
733
847
|
return 0
|
|
734
|
-
|
|
848
|
+
if os.name == "nt":
|
|
849
|
+
return _start_detached_windows(args)
|
|
735
850
|
pid = os.fork()
|
|
736
851
|
if pid > 0:
|
|
737
|
-
|
|
738
|
-
deadline = time.time() + 10
|
|
739
|
-
while time.time() < deadline:
|
|
740
|
-
try:
|
|
741
|
-
info = ping(_sock_path(), 0.5)
|
|
742
|
-
msg = {"ok": True, "pid": info.get("pid")}
|
|
743
|
-
print(json.dumps(msg, ensure_ascii=False) if args.json
|
|
744
|
-
else f"argo daemon 已启动 pid={info.get('pid')} socket={_sock_path()}")
|
|
745
|
-
return 0
|
|
746
|
-
except Exception:
|
|
747
|
-
time.sleep(0.05)
|
|
748
|
-
print(json.dumps({"ok": False, "error": "启动超时", "log": _log_path()},
|
|
749
|
-
ensure_ascii=False) if args.json
|
|
750
|
-
else f"argo daemon 启动超时,看日志:{_log_path()}", file=sys.stderr)
|
|
751
|
-
return 1
|
|
852
|
+
return _wait_ready_and_report(args)
|
|
752
853
|
os.setsid()
|
|
753
|
-
|
|
754
|
-
log_dir = os.path.dirname(_log_path())
|
|
755
|
-
if log_dir:
|
|
756
|
-
os.makedirs(log_dir, exist_ok=True)
|
|
757
|
-
log = open(_log_path(), "ab", buffering=0)
|
|
758
|
-
os.dup2(log.fileno(), 0)
|
|
759
|
-
os.dup2(log.fileno(), 1)
|
|
760
|
-
os.dup2(log.fileno(), 2)
|
|
761
|
-
with contextlib.suppress(OSError):
|
|
762
|
-
log.close()
|
|
854
|
+
_redirect_stdio_to_log()
|
|
763
855
|
_serve_child(args)
|
|
764
856
|
return 0
|
|
765
857
|
finally:
|
|
@@ -768,6 +860,10 @@ def _start(args: argparse.Namespace) -> int:
|
|
|
768
860
|
|
|
769
861
|
|
|
770
862
|
def _serve_child(args: argparse.Namespace) -> None:
|
|
863
|
+
# stdio 已 dup2 到日志文件;文本流再包一层时间戳,所有 print 落日志带
|
|
864
|
+
# [ISO-8601] 前缀(观测缺失收口:无时间戳的日志无法回答重启频率)。
|
|
865
|
+
sys.stdout = _TimestampedStdout(sys.stdout)
|
|
866
|
+
sys.stderr = _TimestampedStdout(sys.stderr)
|
|
771
867
|
try:
|
|
772
868
|
from engine_env import sync_envfile_to_environ
|
|
773
869
|
sync_envfile_to_environ()
|
|
@@ -807,9 +903,7 @@ def _stop(args: argparse.Namespace) -> int:
|
|
|
807
903
|
if pid:
|
|
808
904
|
grace = time.time() + _STOP_GRACE_S
|
|
809
905
|
while time.time() < grace:
|
|
810
|
-
|
|
811
|
-
os.kill(pid, 0)
|
|
812
|
-
except OSError:
|
|
906
|
+
if not _pid_alive(pid):
|
|
813
907
|
break # 进程已退出:真停
|
|
814
908
|
time.sleep(0.1)
|
|
815
909
|
with contextlib.suppress(OSError):
|
|
@@ -826,7 +920,7 @@ def _stop(args: argparse.Namespace) -> int:
|
|
|
826
920
|
with open(_pid_path(), encoding="utf-8") as f:
|
|
827
921
|
pid = int(f.read().strip())
|
|
828
922
|
if _pid_is_daemon(pid):
|
|
829
|
-
|
|
923
|
+
_terminate_pid(pid)
|
|
830
924
|
killed = pid
|
|
831
925
|
except (OSError, ValueError):
|
|
832
926
|
pass
|
|
@@ -859,6 +953,7 @@ def _cli() -> int:
|
|
|
859
953
|
sub = ap.add_subparsers(dest="cmd", required=True)
|
|
860
954
|
p_start = sub.add_parser("start", help="启动 daemon(默认后台化)")
|
|
861
955
|
p_start.add_argument("--foreground", action="store_true", help="前台运行(调试用)")
|
|
956
|
+
p_start.add_argument("--detached-log", action="store_true", help=argparse.SUPPRESS)
|
|
862
957
|
p_start.add_argument("--idle-exit", type=float, default=1800.0,
|
|
863
958
|
help="空闲 N 秒后自杀退出;0=常驻不退(默认 1800)")
|
|
864
959
|
for p in (p_start, sub.add_parser("status"), sub.add_parser("stop")):
|
|
@@ -71,10 +71,14 @@ DORMANT_ALLOWLIST: dict[str, str] = {
|
|
|
71
71
|
# 2026-10-14(7ca2f22):osv/cisa_kev 从 security_search combo 移出并改为
|
|
72
72
|
# explicit_only(本地插件按需提供),crt_sh 回到位次 3(进 auto/balanced 预算窗),
|
|
73
73
|
# 故 cisa_kev 与 crt_sh 均从休眠台账撤账。
|
|
74
|
+
# 2026-11-11 接入 cisa_alerts:声明在 crt_sh 之后(位次 4)并由
|
|
75
|
+
# _VERTICAL_NEW_SOURCE 加槽扩容,crt_sh(位次 3)与 cisa_alerts(位次 4)
|
|
76
|
+
# 均在 auto/balanced 预算窗内,crt_sh 维持活跃,无需登记本台账。
|
|
74
77
|
"dblp": "待接线:academic 位次 7",
|
|
75
78
|
"docker_hub": "待接线:package_search 位次 4",
|
|
76
79
|
"europepmc": "待接线:academic 位次 6;tech_deep 位次 5",
|
|
77
|
-
|
|
80
|
+
# 2026-11-11 撤账:macro_data 里摘掉已停用的 nbs_stats 后,eurostat
|
|
81
|
+
# 从位次 4 前移到位次 3,进入 auto/balanced 预算窗,不再是位置性休眠。
|
|
78
82
|
# 2026-09-20:weather_query 域快源前置——weather_cn(国内城市实况两步
|
|
79
83
|
# 直连 0.46s)提到位次 3,weather(CLI 子进程 wttr/open-meteo 双源
|
|
80
84
|
# 1.5-4.3s)顺延到 4。fast 档 budget=2 下 weather 不参与自动路由;
|
|
@@ -82,9 +86,10 @@ DORMANT_ALLOWLIST: dict[str, str] = {
|
|
|
82
86
|
# 城市 wttr 语义无替代源,保留在本域 + fallback 链/显式 --engine 触达。
|
|
83
87
|
"weather": "weather_query 位次 4(快源前置让位 weather_cn):海外城市仍主用,fast 档靠 fallback 链兜底",
|
|
84
88
|
"fxtwitter": "social 域位次 6:社交引擎另有专用通道,待核实是否真休眠",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
# 2026-11-12 撤账:english_tech 前置 keenable(位次 3),激活为免 key 补位源,不再休眠。
|
|
90
|
+
# 2026-11-11 撤账:jikan 已停用(上游 /anime?q= 持续 504),
|
|
91
|
+
# anime_encyclopedia 的 combo 引用本次摘除。恢复启用时按加槽表重新接线,
|
|
92
|
+
# 而不是把它放回「位置性休眠」台账。
|
|
88
93
|
# 2026-09-19:local_pubmed 从本台账**撤销**——它此前不只是「位置性休眠」,
|
|
89
94
|
# 而是根本不工作(请求被注入 format=json 而 NCBI 返回 400;output_map 又把
|
|
90
95
|
# title/url/summary 全指向 pmid,且 esearch 的 idlist 是字符串数组、解析器
|
|
@@ -120,6 +125,12 @@ DORMANT_ALLOWLIST: dict[str, str] = {
|
|
|
120
125
|
# local_pubmed 同属「开放获取全文」层,能力重叠,故让位给独特性更高的
|
|
121
126
|
# cnii(本域唯一亚洲学术源);deep/research 与恢复链仍可达。
|
|
122
127
|
"core": "academic 位次 8:让位 cnii(加槽 cap 取舍),与 local_pubmed 能力重叠,deep/research 可达",
|
|
128
|
+
# 2026-11-15:openaire 收编进 academic 尾部(位次 16,此前唯一入口是
|
|
129
|
+
# --engine)。加槽表已满(local_pubmed/cnii/hf_papers 共 3 槽,extra
|
|
130
|
+
# cap=4),排尾部不挤既有位次:auto/balanced 预算窗(base 3 + 4 = 7)
|
|
131
|
+
# 外,deep/research 与恢复链可达。与 openalex/hal/doaj 同属开放学术
|
|
132
|
+
# 聚合层,EU 开放科学口径(项目/数据集/软件产出)有差异化增量。
|
|
133
|
+
"openaire": "academic 位次 16:加槽 cap 已满排尾部,deep/research 可达",
|
|
123
134
|
# mojeek 原登记在此(semantic_discovery 位次 8),2026-11-10 前移到第 3 位
|
|
124
135
|
# 后落进基础预算,已撤账——保留注释记录这笔账的来龙去脉。
|
|
125
136
|
"so": "chinese_general 位次 8:新增观察期(9044621),待可用性数据",
|
|
@@ -146,22 +157,25 @@ DORMANT_ALLOWLIST: dict[str, str] = {
|
|
|
146
157
|
# 自动路由(评测 fe03 实测它作为 general_search 主源出结果),不再是位置性休眠
|
|
147
158
|
"tavily": "semantic_discovery 位次 11(budget=3+加槽4=7,位次 8+ 不参与自动路由)",
|
|
148
159
|
"firecrawl": "semantic_discovery 位次 12(budget=3+加槽4=7,位次 8+ 不参与自动路由)",
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
# 2026-11-11 撤账:brave / felo / searxng 是已停用源却仍挂在
|
|
161
|
+
# semantic_discovery 的 combo 尾部(位次 13/14/15),本次连同另外四处
|
|
162
|
+
# 悬空引用一起从 config.yaml 摘除。它们不再出现在任何域里,也就不再是
|
|
163
|
+
# 「位置性休眠」,而是「已停用」,由 --list-engines --detail 的 disabled
|
|
164
|
+
# 口径管理。tests/test_p0_dangling_combo.py 拦截这类引用复发。
|
|
152
165
|
# social 域(社交引擎另有专用通道)
|
|
153
166
|
"hatena_bookmark": "social 域位次 10:社交引擎另有专用通道,待核实是否真休眠",
|
|
154
167
|
"qiita": "social 域位次 11:社交引擎另有专用通道,待核实是否真休眠",
|
|
155
168
|
# 其它域(均为位次超预算窗口)
|
|
156
169
|
"devto": "cn_tech_community 位次 5(budget=2~3,位次 4+ 不参与自动路由)",
|
|
157
170
|
"dnb": "book_search 位次 7(budget=2~3,位次 4+ 不参与自动路由)",
|
|
158
|
-
|
|
171
|
+
# 2026-11-11 撤账:local_goodreads 已停用(enabled=false),book_search
|
|
172
|
+
# 的 combo 引用本次摘除,不再属于位置性休眠。
|
|
159
173
|
"ndl": "book_search 位次 8(budget=2~3,位次 4+ 不参与自动路由)",
|
|
160
174
|
"electricity_maps": "energy_grid 位次 4(budget=2~3,位次 4+ 不参与自动路由)",
|
|
161
175
|
"eu_opendata": "law_text 位次 5(budget=2~3,位次 4+ 不参与自动路由)",
|
|
162
176
|
"fr_opendata": "law_text 位次 6(budget=2~3,位次 4+ 不参与自动路由)",
|
|
163
177
|
"gov_policy": "law_text 位次 7(budget=2~3,位次 4+ 不参与自动路由)",
|
|
164
|
-
|
|
178
|
+
# 2026-11-11 撤账:europeana 已停用,cn_encyclopedia 的 combo 引用本次摘除。
|
|
165
179
|
"local_imdb": "film_search 位次 7(budget=2~3,位次 4+ 不参与自动路由)",
|
|
166
180
|
"metaso": "chinese_general 位次 10(budget=2~3,位次 4+ 不参与自动路由)",
|
|
167
181
|
"open_meteo": "weather_query 位次 5(budget=2~3,位次 4+ 不参与自动路由)",
|
|
@@ -394,9 +394,9 @@ def run_dispatch(*, query: str, retrieval_query: str, engines: list[str],
|
|
|
394
394
|
f"缺少环境变量:{' / '.join(missing_env)}(配置后重试)")
|
|
395
395
|
return eng, [], outcome, lat
|
|
396
396
|
|
|
397
|
-
# 时间窗只隔离带时间能力引擎的 per-engine 缓存(与 combo
|
|
398
|
-
eng_since = since_iso if is_time_capable(eng) else None
|
|
399
|
-
eng_until = until_iso if is_time_capable(eng) else None
|
|
397
|
+
# 时间窗只隔离带时间能力引擎的 per-engine 缓存(与 combo 键同语义);判空在前免白烧
|
|
398
|
+
eng_since = since_iso if (since_iso or until_iso) and is_time_capable(eng) else None
|
|
399
|
+
eng_until = until_iso if (since_iso or until_iso) and is_time_capable(eng) else None
|
|
400
400
|
|
|
401
401
|
# 远端配额耗尽:配额状态机已标记的引擎不参与调用。
|
|
402
402
|
# route_combo 的 F7 只覆盖 combo 路由;主路由(TF-IDF)/
|