Skip to content

refactor: update conversation handling and improve message state management#474

Merged
chenyme merged 1 commit into
devfrom
conversation
Jul 14, 2026
Merged

refactor: update conversation handling and improve message state management#474
chenyme merged 1 commit into
devfrom
conversation

Conversation

@chenyme

@chenyme chenyme commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

支持模型生成期间的分支切换、历史消息重试和用户消息编辑。

本次将聊天运行时从单一 pending exchange 重构为按 runID 隔离的并发状态,确保每个生成任务拥有独立的流缓冲、推理内容、定时器和取消控制器。同时修复并发完成顺序、队列父节点、历史分页、服务端 pending 状态和 OpenAI Responses 会话状态覆盖问题。

Change type

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Configuration / deployment
  • Security hardening
  • Other

Affected areas

  • Frontend / UI
  • Backend / API
  • Authentication / authorization
  • Conversations / streaming
  • Files / RAG / extraction
  • Model routing / providers
  • MCP / tools
  • Billing / payments
  • Admin console
  • Deployment / Docker / configuration
  • Documentation

Verification

  • cd frontend && pnpm exec tsc --noEmit
  • cd frontend && pnpm lint
  • cd backend && go test ./...
  • git diff --check
  • Frontend build not run by design.

Screenshots, API examples, or logs

Not applicable. This change does not introduce a new standalone UI surface.

Configuration, migration, and compatibility notes

  • No API contract, database schema, configuration, or migration changes.
  • Normal composer submissions continue to queue while generation is active.
  • Historical retry/edit branches may run concurrently with active generation.
  • Concurrent generation is limited to three unique active runs on the current page.
  • Non-default branches do not overwrite the conversation’s main OpenAI Responses state.
  • After page reload, multiple pending runs are recovered sequentially.

Documentation

  • Documentation is not needed for this change.
  • Documentation was updated.
  • Documentation still needs to be updated.

Security and privacy

  • No secrets, tokens, credentials, local config, or personal data are included.
  • User data access remains scoped by authenticated user context unless an admin-only path explicitly requires broader access.
  • No authentication, authorization, billing, or permission behavior was changed.

Checklist

  • I searched existing issues and pull requests.
  • Changes are focused and do not include unrelated refactors.
  • Tests or static verification were run where practical.
  • User-facing behavior and compatibility impact are documented.
  • Generated artifacts are included only when this project explicitly requires them.
  • Caches, build output, .pyc files, .env files, and local storage data are not committed.

@chenyme chenyme self-assigned this Jul 14, 2026
@chenyme chenyme linked an issue Jul 14, 2026 that may be closed by this pull request
3 tasks
@chenyme
chenyme merged commit 54f14ae into dev Jul 14, 2026
10 checks passed
@chenyme
chenyme deleted the conversation branch July 14, 2026 02:42
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.

[Feature]: 允许在模型输出时切换分支和重试/编辑用户消息

1 participant