Skip to content

fix: reasoning style - #7843

Merged
wangdan-fit2cloud merged 1 commit into
v3from
pr@v3@feat_reasoning
Nov 11, 2026
Merged

wangdan-fit2cloud merged 1 commit into
v3from
pr@v3@feat_reasoning

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: reasoning style

toolCall.delegate ? { type: 'GROUP', id: toolCall.contentId, name } : { type: 'TOOL', id: toolCall.contentId, name, arguments: event.delta },
)
} else if (event.type === 'tool_end') {
const toolCall = toolCallById.get(event.id)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Irregularities / Issues

  1. Potential bug — inconsistent event.type casing. The field is written as event.type === 'reasoning' (lowercase) here, but in the surrounding code the emit uses type === 'REASONING' (uppercase). If event.type is actually the uppercase 'REASONING', this condition will never match, so lastActivity.value will always be ''. Verify the canonical values and make casing consistent.

  2. Reasoning output suppressed for non-reasoning events. Clearing lastActivity.value to '' on any non-reasoning delta discards prior tail state. Confirm this is intentional (e.g., resetting the "current activity" preview). If you only want to skip updating for non-reasoning events, use an early return instead of assigning ''.

  3. Behavioral regression risk. Previously lastActivity.value = tail(last.text) tracked all text; now it only tracks reasoning. Any consumer relying on lastActivity for assistant message streaming will break.

  4. Commented-out code left in place. The // lastActivity.value = tail(last.text) line should be removed rather than commented, to avoid dead-code confusion.

Minor / Style

  1. Ternary duplication. event.type === 'reasoning' ? tail(last.text) : '' — if the guard above is already if (/* reasoning */), this is redundant. Prefer restructuring:

    lastActivity.value = type === 'REASONING' ? tail(last.text) : ''

    using the already-computed type.

  2. Formatting change in the emit(...) call is purely cosmetic (collapsed ternary onto one line). No functional issue, but very long lines may violate lint/prettier config — run the formatter.

  3. Parameter name shadowing. In the emit object, arguments: event.delta — arguments is a reserved-ish identifier in classic functions; fine as an object key, but worth confirming the downstream schema expects that exact name.

Optimization suggestions

  • Avoid recomputing tail(last.text) multiple times; compute once if reused.
  • Consider deriving isReasoning from the normalized type variable (already available) to prevent divergence between type and event.type checks.
  • Drop the stale commented line and rely on version control history.

Action items

  • Confirm whether event.type is 'reasoning' or 'REASONING'.
  • Decide intended semantics of clearing vs. skipping update.
  • Remove commented code; re-run formatter/linter.

<!-- <span v-if="!isExpanded && currentActivity" class="min-w-0 truncate" :title="currentActivity">{{ currentActivity }}</span> -->
<el-tag v-if="isFailed" size="small" :type="statusType">{{ statusText }}</el-tag>
</template>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Observations & Suggestions:

  1. Commented-out code should be removed, not left in. Dead code (the commented <span>) clutters the file and will drift out of sync. If it's needed later, rely on Git history. Delete it.

  2. Potential unused variable/refs after removal. With that <span> gone, currentActivity (computed at line ~78) may no longer be referenced anywhere. If so:

    • Remove the currentActivity computed property to avoid dead code and unnecessary re-computation.
    • Also check whether imports/helpers feeding currentActivity are now unused (linters like ESLint no-unused-vars should flag these).
  3. Behavioral change — intentional? This removes the inline "current activity" text from collapsed tabs. If this is a temporary debug toggle, use a feature flag / v-if="false" with a TODO comment rather than raw HTML comments, or better, gate via a config constant.

  4. Duplicate :title concern (if restored). Both the name span and activity span set :title. When overlayed/clipped they can conflict for tooltip UX — fine as-is but worth noting.

  5. Accessibility: The loading indicator <span class="mk-conversation-loading" /> is decorative; consider aria-hidden="true" plus an aria-label or visually-hidden text ("Running") for screen readers.

  6. Whitespace/formatting: No other irregularities in the diff itself; indentation matches surrounding code.

Recommended action: Delete the commented span entirely; if currentActivity becomes orphaned, remove it and its dependencies; confirm the activity-text removal is intended product behavior.

@wangdan-fit2cloud
wangdan-fit2cloud merged commit 6af6add into v3 Nov 11, 2026
3 of 4 checks passed
@wangdan-fit2cloud
wangdan-fit2cloud deleted the pr@v3@feat_reasoning branch November 11, 2026 13:51
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