Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并且给出了一些整体反馈:
- 各种状态消息(例如找到目标好友以及条件不满足时的消息)的构造方式非常类似,而且都是基于字符串拼接;建议将这些逻辑提取到一些小的辅助函数中,以避免重复,并让这些消息更易于维护或本地化。
- 在
VisitFriendsMenuScanTargetFriendOpenRecognition.Run中新增的miss*标志目前只用于拼装日志信息;你可以在条件失败时直接向消息中追加文本,而不是用多个布尔值来跟踪,从而简化逻辑。 - 随着你在每个不匹配好友和部分滚动状态上增加了
maafocus.NodeActionStarting调用,请确认这样的日志频率是否可以接受;如果在正常运行中变得过于嘈杂,可能值得对这些信息日志做节流或降低日志级别。
供 AI Agent 使用的提示词
Please address the comments from this code review:
## Overall Comments
- The construction of the various status messages (e.g., for found target friend and for missing conditions) is very similar and string-concatenation based; consider extracting these into small helper functions to avoid duplication and make the messages easier to maintain or localize.
- The new `miss*` flags in `VisitFriendsMenuScanTargetFriendOpenRecognition.Run` are only used to assemble the log message; you could simplify by directly appending to the message when a condition fails instead of tracking multiple booleans.
- With the added `maafocus.NodeActionStarting` calls on each non-matching friend and on partial scroll states, please confirm this log frequency is acceptable; if it becomes noisy in normal runs, it might be worth throttling or lowering the log level for these informational updates.
## Individual Comments
### Comment 1
<location path="agent/go-service/visitfriends/visitfriends.go" line_range="323-337" />
<code_context>
break
}
+
+ message := "该好友不满足条件,缺少"
+ if missClueExchange {
+ message += "线索交换 "
+ }
+ if missControlNexusAssist {
+ message += "助力总控中枢 "
+ }
+ if missMFGCabinAssist {
+ message += "助力制造舱 "
+ }
+ if missGrowthChamberAssist {
+ message += "助力生长舱 "
+ }
+
+ maafocus.NodeActionStarting(ctx, message)
}
</code_context>
<issue_to_address>
**suggestion:** Clarify or enrich the failure message when no specific missing condition is detected.
Because the `miss*` flags are only set when the corresponding count is below its max, the case where both `currentAssistCount` and `currentClueExchangeCount` are at their limits leaves all `miss*` flags false but still emits `"该好友不满足条件,缺少"` with no detail. This can imply a missing capability when the real issue is exhausted quota. Please either avoid calling `NodeActionStarting` when no `miss*` flag is set, or adjust the message to clearly differentiate "missing capability" from "quota already full."
```suggestion
message := ""
if missClueExchange || missControlNexusAssist || missMFGCabinAssist || missGrowthChamberAssist {
message = "该好友不满足条件,缺少"
if missClueExchange {
message += "线索交换 "
}
if missControlNexusAssist {
message += "助力总控中枢 "
}
if missMFGCabinAssist {
message += "助力制造舱 "
}
if missGrowthChamberAssist {
message += "助力生长舱 "
}
} else {
// 所有 miss* 标志均为 false,此时并非缺少能力,而是次数/配额已满
message = "该好友不满足条件,当前助力与线索交换次数已达今日上限"
}
maafocus.NodeActionStarting(ctx, message)
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The construction of the various status messages (e.g., for found target friend and for missing conditions) is very similar and string-concatenation based; consider extracting these into small helper functions to avoid duplication and make the messages easier to maintain or localize.
- The new
miss*flags inVisitFriendsMenuScanTargetFriendOpenRecognition.Runare only used to assemble the log message; you could simplify by directly appending to the message when a condition fails instead of tracking multiple booleans. - With the added
maafocus.NodeActionStartingcalls on each non-matching friend and on partial scroll states, please confirm this log frequency is acceptable; if it becomes noisy in normal runs, it might be worth throttling or lowering the log level for these informational updates.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The construction of the various status messages (e.g., for found target friend and for missing conditions) is very similar and string-concatenation based; consider extracting these into small helper functions to avoid duplication and make the messages easier to maintain or localize.
- The new `miss*` flags in `VisitFriendsMenuScanTargetFriendOpenRecognition.Run` are only used to assemble the log message; you could simplify by directly appending to the message when a condition fails instead of tracking multiple booleans.
- With the added `maafocus.NodeActionStarting` calls on each non-matching friend and on partial scroll states, please confirm this log frequency is acceptable; if it becomes noisy in normal runs, it might be worth throttling or lowering the log level for these informational updates.
## Individual Comments
### Comment 1
<location path="agent/go-service/visitfriends/visitfriends.go" line_range="323-337" />
<code_context>
break
}
+
+ message := "该好友不满足条件,缺少"
+ if missClueExchange {
+ message += "线索交换 "
+ }
+ if missControlNexusAssist {
+ message += "助力总控中枢 "
+ }
+ if missMFGCabinAssist {
+ message += "助力制造舱 "
+ }
+ if missGrowthChamberAssist {
+ message += "助力生长舱 "
+ }
+
+ maafocus.NodeActionStarting(ctx, message)
}
</code_context>
<issue_to_address>
**suggestion:** Clarify or enrich the failure message when no specific missing condition is detected.
Because the `miss*` flags are only set when the corresponding count is below its max, the case where both `currentAssistCount` and `currentClueExchangeCount` are at their limits leaves all `miss*` flags false but still emits `"该好友不满足条件,缺少"` with no detail. This can imply a missing capability when the real issue is exhausted quota. Please either avoid calling `NodeActionStarting` when no `miss*` flag is set, or adjust the message to clearly differentiate "missing capability" from "quota already full."
```suggestion
message := ""
if missClueExchange || missControlNexusAssist || missMFGCabinAssist || missGrowthChamberAssist {
message = "该好友不满足条件,缺少"
if missClueExchange {
message += "线索交换 "
}
if missControlNexusAssist {
message += "助力总控中枢 "
}
if missMFGCabinAssist {
message += "助力制造舱 "
}
if missGrowthChamberAssist {
message += "助力生长舱 "
}
} else {
// 所有 miss* 标志均为 false,此时并非缺少能力,而是次数/配额已满
message = "该好友不满足条件,当前助力与线索交换次数已达今日上限"
}
maafocus.NodeActionStarting(ctx, message)
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 旨在优化“拜访好友(VisitFriends)”流程的日志/Focus 提示输出:减少 pipeline 节点的 focus 回调,并在 go-service 侧补充更贴近业务语义的提示信息。
Changes:
- 移除 VisitFriends 相关 pipeline 节点中的多处
focus配置,减少回调/日志噪声。 - 在 go-service 的 VisitFriends 扫描与选择逻辑中新增 focus 提示(例如目标好友能力、当前次数统计)。
- 调整“好友已满/未满”判断的输出逻辑,使日志与 focus 提示更集中。
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| assets/resource/pipeline/VisitFriends/MenuScan.json | 移除部分详情打开/保存/关闭节点的 focus 回调配置 |
| assets/resource/pipeline/VisitFriends/Exectue.json | 移除多个执行节点的 focus 回调配置,降低流程提示噪声 |
| agent/go-service/visitfriends/visitfriends.go | 引入 maafocus 并新增/调整 focus 文案输出,增强扫描与次数状态提示 |
MistEO
reviewed
Mar 23, 2026
Comment on lines
+323
to
+334
| message := "该好友缺少" | ||
| if missClueExchange { | ||
| message += "线索交换 " | ||
| } | ||
| if missControlNexusAssist { | ||
| message += "助力总控中枢 " | ||
| } | ||
| if missMFGCabinAssist { | ||
| message += "助力制造舱 " | ||
| } | ||
| if missGrowthChamberAssist { | ||
| message += "助力生长舱 " |
Contributor
There was a problem hiding this comment.
感觉 go 这边需要一个统一的 i18n bank,现在全是硬编码有点太乱了
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
改进 visit-friends 助战扫描反馈以及滚动完成状态的处理。
增强点:
Original summary in English
Summary by Sourcery
Improve visit-friends assist scanning feedback and scroll completion handling.
Enhancements: