Repository navigation
fix: [AI-Generated Earnings] The AI-generated earnings feature modifies earnings directly, without first presenting the proposed adjustments to the user for their review and confirmation. #7744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ const TOOL_LABELS: Record<string, string> = { | |
| configure_node: '配置节点', | ||
| validate: '校验工作流', | ||
| layout: '整理布局', | ||
| submit_plan: '提交规划', | ||
| get_field_options: '查看可引用变量', | ||
| get_models: '查询模型', | ||
| get_knowledge_list: '查询知识库', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the analysis of the provided code diff: 1. Irregularities & Potential Issues
2. Optimization Suggestions
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Correctness / potential bugs
Early
returnmay skip cleanup code inrun()Anything that follows in
run()(agent disposal,clearDebugLog, status reset, counters,finally-less cleanup, logging) will now be skipped on the "planning only" path. Prefer disabling only the block instead of returning:If you keep the
return, make surerun()has no post-processing and ideally wrap the body intry/finally.event.position.lengthcan throw ifpositionis optional!event.position.lengthblows up onundefined. Use!(event.position?.length)(or!event.position?.length) unless the type guarantees a non-nullable array. Also consider a small helper (isTopLevelEvent(event)) instead of the inline magic check, since the semantics ("depth 0 = top-level agent") is not obvious.Concurrency / re-entrancy of
canvasChangedIt is a single component-scoped flag mutated from
onEvent. Ifrun()can be triggered again while a previous run is still in flight (double click, retry button, queued prompts), the second run resets the flag and the first run's result will read stale state. Either guard with anisRunningcheck / abort previous run, or make it a local value returned by the run session (e.g. pass a small session object into the agent, or trackSet<toolName>in a per-run ref).Flag is set on
tool_start, not on successA failing
add_node/delete_edgeetc. still setscanvasChanged = true, so you calllayoutCanvas+fitViewand show "工作流已生成" even when nothing was actually mutated. Consider setting the flag on the corresponding successfultool_endevent instead (or clear it when the tool errors).Nested agents are ignored
Because of
!event.position.length, tool calls from sub-agents never set the flag. If a sub-agent can mutate the canvas, the success message/layout will be skipped incorrectly. Confirm this is intentional and document it.Silent path for the user
When
!canvasChangedyou return without any feedback. The comment explains why, but from the UI the run just "stops" withstatus = 'done'. Consider a neutralMsgInfo/inline hint (e.g. "方案已生成,等待确认") so the user knows the run finished.provideplacement and semanticsprovide(VIEW_KEY, VIEW_TYPE.DEBUG)at the top of<script setup>is technically valid (synchronous, before anyawait), but it sits between the imports anddefineOptions, which reads like a stray side effect. Move it next to the other setup logic (afterdefineOptions/useRoute/inject) or add a comment explaining the override.VIEW_KEYfor all descendants of this panel. If a child already provides/injects its own view type, this changes behavior implicitly. If it's only meant for a specific child, prefer a prop orprovideat a narrower wrapper.ref/computed.Possible circular import
@/conversation-panel/viewis imported into a workflow panel. If that module ever imports from the workflow panel tree, you get a cycle at module-evaluation time. If it only exports the key/enum, consider moving them to a leafconstants/keysmodule.Style / consistency
import { computed, inject, nextTick, onBeforeUnmount, ref, useTemplateRef ,provide } from 'vue'— extra space before the comma, andprovidebreaks alphabetical ordering used elsewhere. Should be:import { VIEW_KEY,VIEW_TYPE }— missing space after the comma (inconsistent with the rest of the file).CANVAS_MUTATING_TOOLSis defined inside<script setup>, so a newSetis allocated per component instance. Hoist it to a plain<script lang="ts">block or a shared constants module (that also makes it unit-testable):layoutbelongs in this list is worth double-checking — if thelayouttool already lays out the canvas, the subsequentlayoutCanvas(lf)is redundant.Optimization / maintainability
if (canvasChanged) { ... }form (point 1) — clearer intent than an early return and future-proof against added code.finallyofrun()so a rejectedagent.run()(which currently leavesstatus = 'running') doesn't leave stale state behind.type CanvasTool = 'add_node' | ...) so a typo in the string literal becomes a compile error rather than a silently missed flag.CANVAS_MUTATING_TOOLSis good; mirror it at theif (!canvasChanged)branch so future readers don't "fix" it into an unconditional layout.