Skip to content

fix(FrogBoss):修复对弈竞猜相关资源,激活oas策略客制化权重。 - #1850

Merged
runhey merged 2 commits into
runhey:devfrom
xylolit-mu:pr
Oct 1, 2026
Merged

runhey merged 2 commits into
runhey:devfrom
xylolit-mu:pr

Conversation

@xylolit-mu

@xylolit-mu xylolit-mu commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Sourcery 摘要

提升 FrogBoss 下注的可靠性,并启用由结果驱动的带符号 OAS 策略权重。

新功能:

  • 添加 FrogBoss 记录页面读取功能,用于获取上一轮的时间戳、所选方和结果,以结算 OAS 历史记录。

错误修复:

  • 改进 FrogBoss 下注确认:安全处理奖励弹窗,在提交前选择下注金额,限制重试次数,并识别休息或停滞状态。
  • 更新 FrogBoss 图像和 OCR 区域,以匹配当前的下注页面、结果页面和记录页面布局。
  • 当无法获取获胜方指示器时,使用已记录的下注结果,同时拒绝含糊、无效、冲突或不匹配的结果。

增强功能:

  • 启用带符号的 OAS 来源权重,以惩罚持续预测错误的来源,并使新来源保持中立。
  • 添加空闲状态回退流程和稳定的记录页面验证,使 FrogBoss 对局更加稳健。

测试:

  • 添加对下注确认行为、带符号 OAS 权重、下注结果结算、记录页面匹配、去重和冲突验证的测试覆盖。
Original summary in English

Summary by Sourcery

Improve FrogBoss betting reliability and activate outcome-driven, signed OAS strategy weighting.

New Features:

  • Add FrogBoss record-page reading to capture previous-round timestamps, selected sides, and outcomes for OAS history settlement.

Bug Fixes:

  • Improve FrogBoss betting confirmation by safely handling reward overlays, selecting the wager amount before submission, limiting retries, and recognizing rest or stalled states.
  • Update FrogBoss image and OCR regions to match the current betting, result, and record-page layouts.
  • Use recorded bet outcomes when winner indicators are unavailable, while rejecting ambiguous, invalid, conflicting, or mismatched results.

Enhancements:

  • Enable signed OAS source weights so consistently incorrect predictors are penalized and new sources remain neutral.
  • Add idle fallback progression and stable record-page verification to make FrogBoss rounds more resilient.

Tests:

  • Add coverage for betting confirmation behavior, signed OAS weighting, bet-outcome settlement, record-page matching, deduplication, and conflict validation.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我发现了 1 个问题

给 AI Agent 的提示
请处理此代码审查中的评论:

## 单独评论

### 评论 1
<location path="tasks/FrogBoss/script_task.py" line_range="98-103" />
<code_context>
+            if self._try_next_competition_fallback(idle_timer):
+                continue
+
+            if not history_checked and self.config.model.frog_boss.frog_boss_config.strategy_frog == Strategy.Oas:
+                if (self.appear(self.I_FROG_LOG_CHECK) or self.appear(self.I_BETTED)
+                        or self.appear(self.I_FROG_BOSS_REST)
+                        or (self.appear(self.I_BET_LEFT) and self.appear(self.I_BET_RIGHT))):
+                    self.record_oas_history_page()
+                    history_checked = True
+                    idle_timer.reset()
+                    continue
</code_context>
<issue_to_address>
**问题(更广泛的影响):** OAS 结算仅在初始记录页面检查期间执行一次,而成功和失败路径不再调用 `settle`,也不会以其他方式持久化当前回合的结果。第一回合之后,新完成的回合将永远不会添加到历史记录中,因此其来源权重会一直过时,直到任务重新启动。

**触发条件:** 任务在不重启的情况下持续运行并经历多个 FrogBoss 回合时。

**建议修复:** 根据检测到的获胜方或下注结果,立即结算每个已完成的回合;或者在每个回合完成后重新打开并处理记录页面,而不是通过 `history_checked` 永久限制该操作。
</issue_to_address>

Sourcery 评估

需要人工审查。 首先需要处理 1 个发现的问题;模板匹配错误或经过签名的 OAS 权重可能会选择错误的一方,或重复提交下注,从而消耗游戏货币并记录错误结果,进而影响后续下注。回滚可以阻止进一步的错误行为,但无法撤销已经下达的下注;持久化的历史记录可以修复或清除。

阻塞性发现:tasks/FrogBoss/script_task.py:103


Sourcery 对开源项目免费——如果您喜欢我们的审查结果,请考虑分享它们 ✨
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/FrogBoss/script_task.py" line_range="98-103" />
<code_context>
+            if self._try_next_competition_fallback(idle_timer):
+                continue
+
+            if not history_checked and self.config.model.frog_boss.frog_boss_config.strategy_frog == Strategy.Oas:
+                if (self.appear(self.I_FROG_LOG_CHECK) or self.appear(self.I_BETTED)
+                        or self.appear(self.I_FROG_BOSS_REST)
+                        or (self.appear(self.I_BET_LEFT) and self.appear(self.I_BET_RIGHT))):
+                    self.record_oas_history_page()
+                    history_checked = True
+                    idle_timer.reset()
+                    continue
</code_context>
<issue_to_address>
**issue (broader_impact):** OAS settlement is performed only once during the initial record-page check, while the success and failure paths no longer call `settle` or otherwise persist the current round's outcome. After the first round, newly completed rounds are never added to history, so their source weights remain stale until the task is restarted.

**Triggers:** When the task continues running through more than one FrogBoss round without restarting.

**Suggested fix:** Settle each completed round immediately from the detected winner or bet outcome, or reopen and process the record page after every completed round instead of permanently gating it with `history_checked`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and a bad template match or signed OAS weighting can select the wrong side or repeatedly submit a wager, spending the game's currency and recording incorrect outcomes that influence later bets. Reverting can stop further incorrect behavior, but it cannot undo wagers already placed; the persisted history can be repaired or cleared.

Blocking findings: tasks/FrogBoss/script_task.py:103


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +98 to +103
if not history_checked and self.config.model.frog_boss.frog_boss_config.strategy_frog == Strategy.Oas:
if (self.appear(self.I_FROG_LOG_CHECK) or self.appear(self.I_BETTED)
or self.appear(self.I_FROG_BOSS_REST)
or (self.appear(self.I_BET_LEFT) and self.appear(self.I_BET_RIGHT))):
self.record_oas_history_page()
history_checked = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (broader_impact): OAS 结算仅在初始记录页面检查期间执行一次,而成功和失败路径不再调用 settle,也不会以其他方式持久化当前回合的结果。第一回合之后,新完成的回合将永远不会添加到历史记录中,因此其来源权重会一直过时,直到任务重新启动。

Triggers: 任务在不重启的情况下持续运行并经历多个 FrogBoss 回合时。

Suggested fix: 根据检测到的获胜方或下注结果,立即结算每个已完成的回合;或者在每个回合完成后重新打开并处理记录页面,而不是通过 history_checked 永久限制该操作。

Original comment in English

issue (broader_impact): OAS settlement is performed only once during the initial record-page check, while the success and failure paths no longer call settle or otherwise persist the current round's outcome. After the first round, newly completed rounds are never added to history, so their source weights remain stale until the task is restarted.

Triggers: When the task continues running through more than one FrogBoss round without restarting.

Suggested fix: Settle each completed round immediately from the detected winner or bet outcome, or reopen and process the record page after every completed round instead of permanently gating it with history_checked.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Change Summary

  • 新增 FrogBoss 记录页读取、按日期/场次关联结果,以及 OAS 历史事件持久化。
  • 将 OAS 来源权重改为带符号的胜率权重,并增加下注结果/记录页结果的校验与去重。
  • 重做下注确认流程:先选金额、处理奖励弹窗、限制提交重试,并加入休息/停滞回退。
  • 同步更新模板图、ROI/OCR 区域和记录页资源。

Reconstructed Intent

点击此处展开
  • 这次改动最可能是为了让 FrogBoss 在页面布局变化和奖励弹窗存在时仍能可靠完成下注,并让 OAS 根据已结算的历史结果持续调整来源权重。
  • 关键行为前提是:每个已完成回合都必须能通过胜负图标或记录页/下注结果可靠结算,且结算结果要在后续回合下注前进入持久化历史。

Observed Constraints

点击此处展开
  • 当前运行链路只在 run() 初始阶段、history_checked == False 时调用一次 record_oas_history_page();成功/失败分支已移除原有的 record_oas_result() 调用,detect() 的返回值也没有用于 settle()。
  • 因此新增的 settle() / settle_record() 虽然覆盖了多种校验和去重边界,但后续回合的结果不会自动写入 OAS 历史,权重会在任务持续运行多个回合时保持陈旧。
  • confirm_bet() 最多提交 3 次、总等待 20 秒;识别不到金额或提交结果会抛出 GameStuckError。这依赖 ROI/模板在实际分辨率和弹窗状态下稳定命中。
  • 记录页读取依赖选边图标、胜负图标和 OCR 时间均稳定,且两次截图结果完全一致;任一条件不满足都会放弃该次结算。

Intent Alignment

  • 只部分覆盖,并引入关键额外行为变化。 资源和 OAS 数据模型基本匹配目标,新增单测也覆盖了纯数据层的签名权重、记录关联和下注确认;但实际任务流程没有把每个完成回合接入结算,因而“持续用结果驱动权重”在长时间运行场景下未实现。
  • 另外,下注确认从原先无界等待改为 20 秒/3 次提交的硬边界,属于需要真实页面验证的额外流程变化。

Release Risk

  • 风险等级:高
  • OAS 任务连续经历多个 FrogBoss 回合时,后续结果不会进入历史,策略不会按新结果更新;这直接削弱本 PR 的核心功能。
  • 若模板/ROI 在奖励弹窗、确认弹窗或新分辨率下误判,最多三次提交和超时可能导致任务中止;反复点击仍可能造成重复下注风险。
  • 记录页 OCR 或图像匹配出现瞬态差异时会整页放弃结算,且当前没有后续回合级补偿路径。

Validation Gaps

点击此处展开
  • 需要补充端到端流程验证:同一任务连续完成至少两个回合,确认每回合各产生一个 result 事件,并确认第三回合使用更新后的来源权重。
  • 需要验证胜负图标路径和下注结果回退路径确实调用结算,而不是只验证 OasHistory 方法本身。
  • 需要在真实或录制页面帧上验证奖励弹窗、金额选择、确认按钮、休息态、下一局按钮及记录页 OCR/模板 ROI;目前看到的测试主要是模拟可见标记和纯数据层。
  • 当前 head 的检查中仍有一个 Run 检查失败,且没有可见的集成运行证据;合并前应确认失败原因与上述流程无关或修复之。

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by PR Review Intent for #1850 · codex · gpt56 · 12.5 AIC · ⌖ 2.67 AIC · ⊞ 12.2K · ◷

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Findings

  • C2 [风险]
    位置:tasks/FrogBoss/script_task.py,主循环中的 history_checked 分支及回合结束处理
    原因:OAS 记录页只在首次检查时处理,后续回合的成功/失败路径已移除结算调用,持续运行多个回合时不会再写入新结果,策略权重会长期过期。
    修改:每个回合结束后立即依据获胜方或下注结果结算,或在每回合完成后重新打开并处理记录页,避免用一次性标志永久跳过。

  • C6 [风险]
    位置:PR head 670f194a075951f648d0622489685242d5114fdb 的 CI check,Run
    原因:GitHub check 状态为 completed/failure,当前变更尚未通过项目运行验证。
    修改:先定位并修复该失败检查,再重新运行完整测试与相关 FrogBoss 测试,确认结果结算和下注流程均通过。

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by PR Review Checklist for #1850 · codex · gpt56 · 9.79 AIC · ⌖ 2.64 AIC · ⊞ 13.4K · ◷

@runhey
runhey merged commit f870b43 into runhey:dev Oct 1, 2026
11 of 12 checks passed
This was referenced Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants