Skip to content

Bug: 模型上下文窗口、输出自定义设置时输入即崩溃 #185

Description

@MelucaNUAA

Bug 描述

在模型设置中,当自定义设置上下文窗口输出参数时,输入即会导致应用崩溃。

复现步骤

  1. 打开 LiveAgent 设置
  2. 进入模型配置页面
  3. 尝试自定义设置上下文窗口或输出参数
  4. 输入时立即崩溃

错误日志

TypeError: Cannot read properties of null (reading 'value')
    at http://tauri.localhost/assets/index-D7NMzIeN.js:916:82766
    at jo (http://tauri.localhost/assets/index-D7NMzIeN.js:9:49866)
    at No (http://tauri.localhost/assets/index-D7NMzIeN.js:9:50740)
    at Mo (http://tauri.localhost/assets/index-D7NMzIeN.js:9:49895)
    at Object.useState (http://tauri.localhost/assets/index-D7NMzIeN.js:9:61980)
    at e.useState (http://tauri.localhost/assets/jsx-runtime-yoL8lNFY.js:1:7310)
    at j$t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:69110)
    at vo (http://tauri.localhost/assets/index-D7NMzIeN.js:9:47566)
    at sc (http://tauri.localhost/assets/index-D7NMzIeN.js:9:70172)
    at Cc (http://tauri.localhost/assets/index-D7NMzIeN.js:9:80460)

    at j$t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:68343)
    at U$t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:111134)
    at div (<anonymous>)
    at div (<anonymous>)
    at main (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at H1t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:193768)
    at Kr (http://tauri.localhost/assets/index-D7NMzIeN.js:10:37897)
    at qr (http://tauri.localhost/assets/index-D7NMzIeN.js:10:39093)
    at div (<anonymous>)
    at div (<anonymous>)
    at div (<anonymous>)
    at G1t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:197944)
    at Y1t (http://tauri.localhost/assets/index-D7NMzIeN.js:916:199121)

预期行为

应该能够正常输入自定义数值而不崩溃。

环境信息

  • 操作系统: Windows
  • 应用版本: [请补充]

可能的原因

从堆栈跟踪来看,错误发生在 useState 相关的 React 组件中(j$t 函数),尝试读取一个 null 对象的 value 属性。这可能是由于:

  1. 组件初始化时状态未正确设置
  2. 输入事件处理中引用了未初始化的 ref 或 state
  3. 受控/非受控输入组件混用导致的问题

此 Bug 由用户报告

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions