Repository navigation
fix: reasoning style - #7843
fix: reasoning style#7843
Conversation
| 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) |
There was a problem hiding this comment.
Irregularities / Issues
-
Potential bug — inconsistent
event.typecasing. The field is written asevent.type === 'reasoning'(lowercase) here, but in the surrounding code the emit usestype === 'REASONING'(uppercase). Ifevent.typeis actually the uppercase'REASONING', this condition will never match, solastActivity.valuewill always be''. Verify the canonical values and make casing consistent. -
Reasoning output suppressed for non-reasoning events. Clearing
lastActivity.valueto''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''. -
Behavioral regression risk. Previously
lastActivity.value = tail(last.text)tracked all text; now it only tracks reasoning. Any consumer relying onlastActivityfor assistant message streaming will break. -
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
-
Ternary duplication.
event.type === 'reasoning' ? tail(last.text) : ''— if the guard above is alreadyif (/* reasoning */), this is redundant. Prefer restructuring:lastActivity.value = type === 'REASONING' ? tail(last.text) : ''
using the already-computed
type. -
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. -
Parameter name shadowing. In the
emitobject,arguments: event.delta—argumentsis 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
isReasoningfrom the normalizedtypevariable (already available) to prevent divergence betweentypeandevent.typechecks. - Drop the stale commented line and rely on version control history.
Action items
- Confirm whether
event.typeis'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> | ||
|
|
There was a problem hiding this comment.
Observations & Suggestions:
-
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. -
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
currentActivitycomputed property to avoid dead code and unnecessary re-computation. - Also check whether imports/helpers feeding
currentActivityare now unused (linters like ESLintno-unused-varsshould flag these).
- Remove the
-
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. -
Duplicate
:titleconcern (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. -
Accessibility: The loading indicator
<span class="mk-conversation-loading" />is decorative; consideraria-hidden="true"plus anaria-labelor visually-hidden text ("Running") for screen readers. -
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.
fix: reasoning style