Skip to content

Conversation

SAKURA-CAT
Copy link
Member

@SAKURA-CAT SAKURA-CAT commented Jun 10, 2025

Description

修复两样东西:

  1. run.public.run_id不应该携带run-yyyymmdd-前缀,此参数应该在后续完全与前端实验id一致,从而实现 [REQUEST] resume 功能 #1054
  2. 优化了上传部分的报错提示,现在在上传时的未知报错也携带traceId,方便定位错误:
image

图中马赛克部分为用户上传的 URL

⚠️ run.public.run_id 的变化可能涉及单元测试的改动

@SAKURA-CAT SAKURA-CAT marked this pull request as ready for review June 10, 2025 11:15
@SAKURA-CAT SAKURA-CAT self-assigned this Jun 10, 2025
@SAKURA-CAT SAKURA-CAT added 🐛 bug Something isn't working 💪 enhancement New feature or request labels Jun 10, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aligns the backend run.public.run_id with the frontend experiment ID format and standardizes error messages to include unknown errors.

  • Removed the run-YYYYMMDD- prefix so run_id is now an 8-character lowercase hex string.
  • Refactored the SyncError message to always emit a unified prefix and fall back to “unknown error” when no response is present.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
swanlab/error.py Simplified SyncError’s message assignment to a single expression
swanlab/data/run/main.py Dropped timestamp prefix from __run_id generation
Comments suppressed due to low confidence (1)

swanlab/data/run/main.py:82

  • The new run_id format (8-digit hex without prefix) should have accompanying unit tests, e.g. assert it matches /^[0-9a-f]{8}$/.
self.__run_id = hex(random.randint(0, 2**32 - 1))[2:].zfill(8)

@SAKURA-CAT SAKURA-CAT force-pushed the chore/opt-some-misc branch from 2f84f5d to 294545f Compare June 10, 2025 11:17
@SAKURA-CAT SAKURA-CAT force-pushed the chore/opt-some-misc branch from 294545f to 0f3a020 Compare June 10, 2025 11:18
@SAKURA-CAT SAKURA-CAT merged commit c6ebb6d into main Jun 10, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the chore/opt-some-misc branch June 10, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants