Skip to content

feat: enhance conversation event logs and update related data structures#475

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

feat: enhance conversation event logs and update related data structures#475
chenyme merged 1 commit into
devfrom
logs

Conversation

@chenyme

@chenyme chenyme commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

异常对话仅出现在“对话事件”日志中,但此前缺少上游路由信息,管理员无法定位产生异常的上游渠道。

本次通过事件的 runID 批量关联运行快照,为对话事件补充上游名称、平台模型、真实模型、绑定编码和协议,并在管理后台列表及详情中展示。路由前发生的异常保持为空,不推测上游来源。

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 backend && go test ./...
  • cd frontend && pnpm lint
  • cd frontend && pnpm exec tsc --noEmit
  • git diff --check
  • Frontend build not run; static checks and type checking were used for this change.

Screenshots, API examples, or logs

The admin conversation event response now additionally includes:

{
  "providerProtocol": "openai_responses",
  "upstreamName": "OpenAI Official",
  "platformModelName": "gpt-5.5",
  "routedBindingCode": "binding_openai",
  "upstreamModelName": "gpt-5.5-pro"
}

Configuration, migration, and compatibility notes

  • No database migration or configuration change is required.
  • The admin conversation events API only adds response fields and remains backward compatible.
  • Route snapshots are loaded in one batch per event page to avoid N+1 queries.
  • Events produced before route resolution return empty route fields.
  • Generated Swagger definitions were updated.

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.
  • Security-sensitive behavior was reviewed, including authentication, authorization, provider routing, file processing, billing, and admin APIs where relevant.

Upstream route details are exposed only through the existing administrator-only logs API.

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, deployment steps, API contracts, or configuration changes 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 f776b35 into dev Jul 14, 2026
10 checks passed
@chenyme
chenyme deleted the logs branch July 14, 2026 02:58
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