Skip to content

Commit b2539b5

Browse files
committed
Raise daily recommendation limit cap
1 parent 0e771a5 commit b2539b5

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

deployments/desktop/static/desktop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@
21412141
function configuredDailyLimit() {
21422142
const value = Number($("dailyLimitInput")?.value || state.settings?.advanced?.daily_limit || 30);
21432143
if (!Number.isFinite(value)) return 30;
2144-
return Math.max(1, Math.min(500, Math.round(value)));
2144+
return Math.max(1, Math.min(1000, Math.round(value)));
21452145
}
21462146

21472147
function collectDailyOptions() {

deployments/desktop/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ <h2>存储与导出</h2>
436436
<span>5</span>
437437
<h2>高级参数</h2>
438438
</div>
439-
<label class="advanced-row">每日推荐上限 <input id="dailyLimitInput" type="number" min="1" max="500" value="30"></label>
439+
<label class="advanced-row">每日推荐上限 <input id="dailyLimitInput" type="number" min="1" max="1000" value="30"></label>
440440
<label class="advanced-row">相关性阈值 <input id="relevanceThreshold" type="range" min="0" max="100" value="60"><span id="relevanceValue">60</span></label>
441441
<label class="advanced-row">HTTP Proxy <input id="proxyInput" placeholder="http://127.0.0.1:7890"></label>
442442
<div class="button-row">

deployments/feishu/daily-push-agent/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def apply_relevance_threshold_override(weights: Dict) -> Dict:
454454
raw_daily_limit = str(os.environ.get("PAPERFLOW_DAILY_LIMIT", "") or "").strip()
455455
if raw_daily_limit:
456456
try:
457-
daily_limit = max(1, min(500, int(float(raw_daily_limit))))
457+
daily_limit = max(1, min(1000, int(float(raw_daily_limit))))
458458
except ValueError:
459459
daily_limit = None
460460
if daily_limit is not None:
@@ -1667,7 +1667,7 @@ def daily_push(
16671667
# 2. 加载权重配置
16681668
weights = load_scoring_weights()
16691669
if push_limit is not None:
1670-
resolved_push_limit = max(1, min(500, int(push_limit)))
1670+
resolved_push_limit = max(1, min(1000, int(push_limit)))
16711671
weights["push_target_count"] = resolved_push_limit
16721672
weights["push_max_count"] = resolved_push_limit
16731673
weights["paperflow_daily_limit"] = resolved_push_limit

tests/test_desktop_gui.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ def test_desktop_relevance_threshold_changes_daily_push_weights(monkeypatch: pyt
15061506
monkeypatch.setenv("PAPERFLOW_RELEVANCE_THRESHOLD", "30")
15071507
monkeypatch.setenv("PAPERFLOW_DAILY_LIMIT", "8")
15081508
relaxed = agents.daily_agent.apply_relevance_threshold_override(base)
1509-
monkeypatch.setenv("PAPERFLOW_DAILY_LIMIT", "600")
1509+
monkeypatch.setenv("PAPERFLOW_DAILY_LIMIT", "1200")
15101510
capped = agents.daily_agent.apply_relevance_threshold_override(base)
15111511

15121512
assert strict["threshold_edge_relevant"] > base["threshold_edge_relevant"]
@@ -1515,8 +1515,8 @@ def test_desktop_relevance_threshold_changes_daily_push_weights(monkeypatch: pyt
15151515
assert strict["push_target_count"] == 12
15161516
assert strict["push_max_count"] == 12
15171517
assert relaxed["push_target_count"] == 8
1518-
assert capped["push_target_count"] == 500
1519-
assert capped["push_max_count"] == 500
1518+
assert capped["push_target_count"] == 1000
1519+
assert capped["push_max_count"] == 1000
15201520

15211521

15221522
def test_daily_push_custom_rss_fetcher_builds_paper_cards(monkeypatch: pytest.MonkeyPatch) -> None:
@@ -1651,8 +1651,8 @@ def test_desktop_source_settings_explain_conference_auth() -> None:
16511651
assert "state.settings = data || {}" in script
16521652
assert "syncDailySourceControls(sourcePrefs)" in script
16531653
assert "limit_per_source: configuredDailyLimit()" in script
1654-
assert 'id="dailyLimitInput" type="number" min="1" max="500" value="30"' in html
1655-
assert "Math.min(500, Math.round(value))" in script
1654+
assert 'id="dailyLimitInput" type="number" min="1" max="1000" value="30"' in html
1655+
assert "Math.min(1000, Math.round(value))" in script
16561656
assert "PAPERFLOW_LLM_MODEL" in script
16571657
assert "PAPERFLOW_FALLBACK_LLM_MODEL" in script
16581658
assert 'input?.dataset.envKey === "PAPERFLOW_LLM_MODEL"' not in script

0 commit comments

Comments
 (0)