Repository navigation
fix: [Agent] Missing execution details for LLM node #7771
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,20 @@ function formatJson(value: unknown) { | |
| <template #header> | ||
| <BaseHeader :data="data" show-tokens /> | ||
| </template> | ||
| <!-- 系统提示词 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">系统提示词</h6> | ||
| <div>{{ data.system || '-' }}</div> | ||
| </div> | ||
| <!-- 系统提示词 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">用户提示词</h6> | ||
| <div>{{ data.prompt || '-' }}</div> | ||
| </div> | ||
|
|
||
| <!-- 消息列表 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">消息列表</h6> | ||
| <h6 class="mb-2">上下文</h6> | ||
| <div class="space-y-2"> | ||
| <template v-if="data.message_list?.length > 0"> | ||
| <p v-for="(message, messageIndex) in data.message_list" :key="messageIndex" class="whitespace-pre-wrap"> | ||
|
|
@@ -33,13 +43,11 @@ function formatJson(value: unknown) { | |
| <template v-else>-</template> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- 思考过程 --> | ||
| <!-- 结束原因 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">思考过程</h6> | ||
| <div class="whitespace-pre-wrap">{{ data.reasoning_content || '-' }}</div> | ||
| <h6 class="mb-2">结束原因</h6> | ||
| <div>{{ data.finish_reason || '-' }}</div> | ||
| </div> | ||
|
|
||
| <!-- 回答内容 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">回答内容</h6> | ||
|
|
@@ -63,10 +71,6 @@ function formatJson(value: unknown) { | |
| </div> | ||
| </div> | ||
|
|
||
| <!-- 结束原因 --> | ||
| <div class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">结束原因</h6> | ||
| <div>{{ data.finish_reason || '-' }}</div> | ||
| </div> | ||
|
|
||
| </DetailContainer> | ||
| </template> | ||
|
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 your code diff (Vue template and minor JS context): Potential Issues & Irregularities
Optimization Suggestions
Updated Code Snippet (Cleaned & Structured)@@ -19,10 +19,20 @@
+ <!-- System Prompt -->
+ <div class="mk-gray-card-sm">
+ <h6 class="mb-2">{{ t('label.system_prompt') }}</h6>
+ <div>{{ data.system || '-' }}</div>
+ </div>
+ <!-- User Prompt -->
+ <div class="mk-gray-card-sm">
+ <h6 class="mb-2">{{ t('label.user_prompt') }}</h6>
+ <div>{{ data.prompt || '-' }}</div>
+ </div>
<!-- Messages / Context -->
<div class="mk-gray-card-sm">
- <h6 class="mb-2">消息列表</h6>
+ <h6 class="mb-2">{{ t('label.context') }}</h6>
<div class="space-y-2">
<template v-if="data.message_list?.length > 0">
<p v-for="(message, messageIndex) in data.message_list" :key="messageIndex" class="whitespace-pre-wrap">
@@ -33,13 +43,11 @@
<template v-else>-</template>
</div>
</div>
+ <!-- Finish Reason -->
+ <div class="mk-gray-card-sm">
+ <h6 class="mb-2">{{ t('label.finish_reason') }}</h6>
+ <div>{{ data.finish_reason || '-' }}</div>
+ </div>
<!-- Response Content -->
<div class="mk-gray-card-sm">
<h6 class="mb-2">{{ t('label.response') }}</h6>
@@ -63,10 +71,6 @@
- </div>
- </div>
-
- <!-- 结束原因 -->
- <div class="mk-gray-card-sm">
- <h6 class="mb-2">结束原因</h6>
- <div>{{ data.finish_reason || '-' }}</div>
- </div>
</DetailContainer>
</template>Note: Replace |
||
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.
Looking at this diff, here are my observations:
Issues & Suggestions
1. Unnecessary repeated
get_parameters()callsget_parameters()is called twice. If it's non-trivial (parsing, copying, DB lookup), this is wasteful. Cache it:2. Potential inconsistency / staleness
The rest of
detailsusesself.data.get(...)— i.e., the stored/persisted data. Mixing in fresh values fromget_parameters()can produce an inconsistent snapshot (e.g.,systemreflects current parameters whilemessage_tokensreflectsself.data). Confirm whethersystem/promptshould come fromself.datafor consistency with the existing pattern.3. Redundancy between
systemandpromptIf
promptalready embeds or derives fromsystem, including both may duplicate data and inflate the serialized output (especially if returned to clients or logged).4. Missing schema / key contract
No context is shown about downstream consumers of
details. Adding new keys to a return dict is usually safe, but:details.detailsis a public API payload.5. Nullability handling
If
get_parameters()can returnNone,.get(...)will raiseAttributeError. The existingself.data.get(...)assumes non-None; ensure the same invariant holds here, or use(self.get_parameters() or {}).get("system").6. No test coverage visible
Suggest adding/extending a test that asserts
details["system"]anddetails["prompt"]are populated as expected, and that missing parameters yieldNonerather than raising.7. Minor: naming clarity
Confirm
"system"and"prompt"are the most descriptive key names for the details payload (vs. e.g."system_prompt"), to avoid ambiguity with other "prompt" concepts.