Skip to content

fix: 工程审计修复 + 桌宠引擎(pet)集成 - #198

Open
guyu233 wants to merge 1 commit into
leookun:mainfrom
guyu233:fix/eng-audit-and-pet-engine
Open

fix: 工程审计修复 + 桌宠引擎(pet)集成#198
guyu233 wants to merge 1 commit into
leookun:mainfrom
guyu233:fix/eng-audit-and-pet-engine

Conversation

@guyu233

@guyu233 guyu233 commented Jul 12, 2026

Copy link
Copy Markdown

变更说明

本次提交包含以下修复和改进:

严重 Bug 修复

  • bridge/pet.go: 修复 RWMutex 双重释放导致运行时 panic
  • app/runner.go: 注册缺失的 pet:state-changed 事件类型

中等风险修复

  • pet/manifest.go: 修复 os.Open 后无 defer Close 导致文件句柄泄漏
  • runtime/local_runtime.go: 修复 context.Background() 丢弃调用方 ctx
  • client/observer.go: 修复 context.Background() 丢弃调用方 ctx
  • app/runner.go: refreshAdAsync goroutine 添加 10s 超时保护
  • pet/engine.go: Stop() 中 goroutine 超时后仍阻塞,改用 context.WithTimeout
  • backend/forwarder/actor.go: scheduleStreamTimer goroutine 发送消息无超时保护,新增 postStreamCommandAsyncCtx

轻微修复

  • frontend/ModelConfig.vue: AbortController signal 参与 while 循环终止判断

新增

  • internal/pet/: 桌宠引擎(动画调度、行为系统、状态机、Manifest、窗口管理)

编译验证

  • go build ./... 通过,0 错误
  • 启动测试:进程正常运行,无崩溃/退出

工程审计修复 8 项问题:
- bridge/pet.go: 修复 RWMutex 双重释放导致运行时 panic
- app/runner.go: 注册缺失的 pet:state-changed 事件类型
- pet/manifest.go: 修复 os.Open 后无 defer Close 导致文件句柄泄漏
- runtime/local_runtime.go: 修复 context.Background() 丢弃调用方 ctx
- client/observer.go: 修复 context.Background() 丢弃调用方 ctx
- app/runner.go: refreshAdAsync goroutine 添加 10s 超时保护
- pet/engine.go: Stop() 中 goroutine 超时后仍阻塞,改用 context.WithTimeout
- backend/forwarder/actor.go: scheduleStreamTimer goroutine 发送消息无超时保护

新增 internal/pet/ 桌宠引擎(动画调度、行为系统、状态机、Manifest、窗口管理)

编译验证: go build ./... 通过
@guyu233
guyu233 force-pushed the fix/eng-audit-and-pet-engine branch from 36c261d to 6b1bca7 Compare July 12, 2026 15:52
@leookun

leookun commented Aug 2, 2026

Copy link
Copy Markdown
Owner

非常感谢您的贡献,但此变更较大(154 file),并包含多个功能
由于实在难以评估副作用... 所以暂时没有办法合并

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