fix: stabilize tray quit/restart and automate version sync#21
Merged
Conversation
There was a problem hiding this comment.
Hey - 我发现了两个问题,并给出了一些高层面的反馈:
- 请考虑对新的
exit_cleanup_started/exit_allowed标志使用Ordering::Relaxed是否足够,或者使用更明确的内存序(例如Acquire/Release)是否能让并发退出协议更易于推理,并减少跨线程的微妙竞争条件风险。 - 在
RunEvent::ExitRequested中新的异步退出流程先启动一个异步任务,然后在其中嵌套spawn_blocking;你可以通过只使用spawn_blocking(或只保留一个异步任务)来简化结构,减少分层,让关闭路径更容易追踪。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider whether `Ordering::Relaxed` is sufficient for the new `exit_cleanup_started` / `exit_allowed` flags, or if clearer memory ordering (e.g. `Acquire/Release`) would make the concurrent exit protocol easier to reason about and less prone to subtle races across threads.
- The new async exit flow in `RunEvent::ExitRequested` spawns an async task and then a nested `spawn_blocking`; you could simplify this by only using `spawn_blocking` (or a single async task) to reduce layering and make the shutdown path easier to trace.
## Individual Comments
### Comment 1
<location> `.github/workflows/build-desktop-tauri.yml:130-139` </location>
<code_context>
+ sync_repo_version:
</code_context>
<issue_to_address>
**suggestion (performance):** The `sync_repo_version` job currently does relatively heavy work on all events, not just scheduled ones.
Because `sync_repo_version` is in `needs` for all build jobs, its initial steps (`checkout`, `setup-toolchains`, `pnpm/action-setup`) run on every event type, even though only the later version-sync/commit steps are gated on `github.event_name == 'schedule'`.
To avoid unnecessary CI work on push/PR/manual runs while keeping scheduled auto-sync, consider either:
- applying the same `if: github.event_name == 'schedule'` condition to the earlier, expensive steps, or
- splitting the job so only the version-sync part (with write permissions and toolchain setup) runs on schedule, and build jobs don’t depend on it for other events.
Suggested implementation:
```
sync_repo_version:
name: Sync Repository Version
needs: resolve_build_context
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout branch
if: github.event_name == 'schedule'
uses: actions/checkout@v6.0.2
with:
ref: ${{ github.ref_name }}
```
Within the same `sync_repo_version` job, apply the identical condition:
```yaml
if: github.event_name == 'schedule'
```
to any other heavy setup steps such as `setup-toolchains`, `pnpm/action-setup`, or similar toolchain/package manager initialization steps. This ensures that on push/PR/manual events, those steps are skipped while the job structure and scheduled auto-sync behavior remain unchanged. No changes are needed for the later version-sync/commit steps if they are already gated on `github.event_name == 'schedule'`.
</issue_to_address>
### Comment 2
<location> `src-tauri/src/main.rs:1259` </location>
<code_context>
.expect("error while building tauri application")
.run(|app_handle, event| match event {
- RunEvent::ExitRequested { .. } => {
+ RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
- state.mark_quitting();
</code_context>
<issue_to_address>
**issue (complexity):** Consider simplifying the exit shutdown logic by using a single atomic flag and a single blocking task instead of multiple flags and nested async spawns.
You can simplify the exit flow by removing one atomic flag and the nested async/blocking spawn without changing the essential behaviour (non‑blocking graceful shutdown).
### 1. Drop `exit_allowed` and its methods
`exit_allowed` is only used to short‑circuit `ExitRequested` after cleanup finished; the process will exit immediately anyway after `exit(0)`. You already guard re‑entrancy with `exit_cleanup_started`, so you can keep the semantics with a single flag.
**Before:**
```rust
struct BackendState {
// ...
exit_cleanup_started: AtomicBool,
exit_allowed: AtomicBool,
}
impl BackendState {
fn is_exit_allowed(&self) -> bool {
self.exit_allowed.load(Ordering::Relaxed)
}
fn try_begin_exit_cleanup(&self) -> bool {
self.exit_cleanup_started
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
}
fn allow_exit(&self) {
self.exit_allowed.store(true, Ordering::Relaxed);
}
}
```
**After (single flag):**
```rust
struct BackendState {
// ...
exit_cleanup_started: AtomicBool,
// exit_allowed removed
}
impl BackendState {
fn try_begin_exit_cleanup(&self) -> bool {
self.exit_cleanup_started
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
}
// is_exit_allowed / allow_exit removed
}
```
### 2. Linearise `ExitRequested` and remove nested spawn
You can handle graceful shutdown with a single `spawn_blocking` call that runs `stop_backend()` and then exits, and use `exit_cleanup_started` to avoid re‑entrancy. No extra async layer or `exit_allowed` check is needed.
**Before:**
```rust
RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
if state.is_exit_allowed() {
return;
}
api.prevent_exit();
state.mark_quitting();
if !state.try_begin_exit_cleanup() {
append_desktop_log("exit requested while backend cleanup is already running");
return;
}
append_desktop_log("exit requested, stopping backend asynchronously");
let app_handle_cloned = app_handle.clone();
tauri::async_runtime::spawn(async move {
let worker_handle = app_handle_cloned.clone();
let stop_result = tauri::async_runtime::spawn_blocking(move || {
let state = worker_handle.state::<BackendState>();
state.stop_backend()
})
.await;
match stop_result {
Ok(Ok(())) => {}
Ok(Err(error)) => append_desktop_log(&format!(
"backend graceful stop on ExitRequested failed: {error}"
)),
Err(error) => append_desktop_log(&format!(
"backend graceful stop task failed on ExitRequested: {error}"
)),
}
let state = app_handle_cloned.state::<BackendState>();
state.allow_exit();
append_desktop_log("backend stop finished, exiting desktop process");
app_handle_cloned.exit(0);
});
}
```
**After (simpler control flow):**
```rust
RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
api.prevent_exit();
state.mark_quitting();
if !state.try_begin_exit_cleanup() {
append_desktop_log("exit requested while backend cleanup is already running");
return;
}
append_desktop_log("exit requested, stopping backend asynchronously");
let app_handle_cloned = app_handle.clone();
tauri::async_runtime::spawn_blocking(move || {
let state = app_handle_cloned.state::<BackendState>();
if let Err(error) = state.stop_backend() {
append_desktop_log(&format!(
"backend graceful stop on ExitRequested failed: {error}"
));
}
append_desktop_log("backend stop finished, exiting desktop process");
app_handle_cloned.exit(0);
});
}
```
`RunEvent::Exit` can remain a no‑op, since all exits go through this cleanup + `exit(0)` path.
This keeps the async, non‑blocking shutdown behaviour, still prevents multiple concurrent cleanups, but reduces the number of atomics and makes the control flow much easier to follow.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据反馈改进 Review 质量。
Original comment in English
Hey - I've found 2 issues, and left some high level feedback:
- Consider whether
Ordering::Relaxedis sufficient for the newexit_cleanup_started/exit_allowedflags, or if clearer memory ordering (e.g.Acquire/Release) would make the concurrent exit protocol easier to reason about and less prone to subtle races across threads. - The new async exit flow in
RunEvent::ExitRequestedspawns an async task and then a nestedspawn_blocking; you could simplify this by only usingspawn_blocking(or a single async task) to reduce layering and make the shutdown path easier to trace.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider whether `Ordering::Relaxed` is sufficient for the new `exit_cleanup_started` / `exit_allowed` flags, or if clearer memory ordering (e.g. `Acquire/Release`) would make the concurrent exit protocol easier to reason about and less prone to subtle races across threads.
- The new async exit flow in `RunEvent::ExitRequested` spawns an async task and then a nested `spawn_blocking`; you could simplify this by only using `spawn_blocking` (or a single async task) to reduce layering and make the shutdown path easier to trace.
## Individual Comments
### Comment 1
<location> `.github/workflows/build-desktop-tauri.yml:130-139` </location>
<code_context>
+ sync_repo_version:
</code_context>
<issue_to_address>
**suggestion (performance):** The `sync_repo_version` job currently does relatively heavy work on all events, not just scheduled ones.
Because `sync_repo_version` is in `needs` for all build jobs, its initial steps (`checkout`, `setup-toolchains`, `pnpm/action-setup`) run on every event type, even though only the later version-sync/commit steps are gated on `github.event_name == 'schedule'`.
To avoid unnecessary CI work on push/PR/manual runs while keeping scheduled auto-sync, consider either:
- applying the same `if: github.event_name == 'schedule'` condition to the earlier, expensive steps, or
- splitting the job so only the version-sync part (with write permissions and toolchain setup) runs on schedule, and build jobs don’t depend on it for other events.
Suggested implementation:
```
sync_repo_version:
name: Sync Repository Version
needs: resolve_build_context
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout branch
if: github.event_name == 'schedule'
uses: actions/checkout@v6.0.2
with:
ref: ${{ github.ref_name }}
```
Within the same `sync_repo_version` job, apply the identical condition:
```yaml
if: github.event_name == 'schedule'
```
to any other heavy setup steps such as `setup-toolchains`, `pnpm/action-setup`, or similar toolchain/package manager initialization steps. This ensures that on push/PR/manual events, those steps are skipped while the job structure and scheduled auto-sync behavior remain unchanged. No changes are needed for the later version-sync/commit steps if they are already gated on `github.event_name == 'schedule'`.
</issue_to_address>
### Comment 2
<location> `src-tauri/src/main.rs:1259` </location>
<code_context>
.expect("error while building tauri application")
.run(|app_handle, event| match event {
- RunEvent::ExitRequested { .. } => {
+ RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
- state.mark_quitting();
</code_context>
<issue_to_address>
**issue (complexity):** Consider simplifying the exit shutdown logic by using a single atomic flag and a single blocking task instead of multiple flags and nested async spawns.
You can simplify the exit flow by removing one atomic flag and the nested async/blocking spawn without changing the essential behaviour (non‑blocking graceful shutdown).
### 1. Drop `exit_allowed` and its methods
`exit_allowed` is only used to short‑circuit `ExitRequested` after cleanup finished; the process will exit immediately anyway after `exit(0)`. You already guard re‑entrancy with `exit_cleanup_started`, so you can keep the semantics with a single flag.
**Before:**
```rust
struct BackendState {
// ...
exit_cleanup_started: AtomicBool,
exit_allowed: AtomicBool,
}
impl BackendState {
fn is_exit_allowed(&self) -> bool {
self.exit_allowed.load(Ordering::Relaxed)
}
fn try_begin_exit_cleanup(&self) -> bool {
self.exit_cleanup_started
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
}
fn allow_exit(&self) {
self.exit_allowed.store(true, Ordering::Relaxed);
}
}
```
**After (single flag):**
```rust
struct BackendState {
// ...
exit_cleanup_started: AtomicBool,
// exit_allowed removed
}
impl BackendState {
fn try_begin_exit_cleanup(&self) -> bool {
self.exit_cleanup_started
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
}
// is_exit_allowed / allow_exit removed
}
```
### 2. Linearise `ExitRequested` and remove nested spawn
You can handle graceful shutdown with a single `spawn_blocking` call that runs `stop_backend()` and then exits, and use `exit_cleanup_started` to avoid re‑entrancy. No extra async layer or `exit_allowed` check is needed.
**Before:**
```rust
RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
if state.is_exit_allowed() {
return;
}
api.prevent_exit();
state.mark_quitting();
if !state.try_begin_exit_cleanup() {
append_desktop_log("exit requested while backend cleanup is already running");
return;
}
append_desktop_log("exit requested, stopping backend asynchronously");
let app_handle_cloned = app_handle.clone();
tauri::async_runtime::spawn(async move {
let worker_handle = app_handle_cloned.clone();
let stop_result = tauri::async_runtime::spawn_blocking(move || {
let state = worker_handle.state::<BackendState>();
state.stop_backend()
})
.await;
match stop_result {
Ok(Ok(())) => {}
Ok(Err(error)) => append_desktop_log(&format!(
"backend graceful stop on ExitRequested failed: {error}"
)),
Err(error) => append_desktop_log(&format!(
"backend graceful stop task failed on ExitRequested: {error}"
)),
}
let state = app_handle_cloned.state::<BackendState>();
state.allow_exit();
append_desktop_log("backend stop finished, exiting desktop process");
app_handle_cloned.exit(0);
});
}
```
**After (simpler control flow):**
```rust
RunEvent::ExitRequested { api, .. } => {
let state = app_handle.state::<BackendState>();
api.prevent_exit();
state.mark_quitting();
if !state.try_begin_exit_cleanup() {
append_desktop_log("exit requested while backend cleanup is already running");
return;
}
append_desktop_log("exit requested, stopping backend asynchronously");
let app_handle_cloned = app_handle.clone();
tauri::async_runtime::spawn_blocking(move || {
let state = app_handle_cloned.state::<BackendState>();
if let Err(error) = state.stop_backend() {
append_desktop_log(&format!(
"backend graceful stop on ExitRequested failed: {error}"
));
}
append_desktop_log("backend stop finished, exiting desktop process");
app_handle_cloned.exit(0);
});
}
```
`RunEvent::Exit` can remain a no‑op, since all exits go through this cleanup + `exit(0)` path.
This keeps the async, non‑blocking shutdown behaviour, still prevents multiple concurrent cleanups, but reduces the number of atomics and makes the control flow much easier to follow.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给了一些总体反馈:
- 在
sync_repo_version这个 job 里,push 命令使用的是HEAD:${GITHUB_REF_NAME},但在 Actions 中只提供了github.ref_name;建议改成HEAD:${{ github.ref_name }},或者显式导出这个变量,以避免 push 到一个为空或命名错误的 ref。 - 新增的
exit_cleanup_started标志和try_begin_exit_cleanup对防止重复关闭很有帮助,不过你可能需要在RunEvent::ExitRequested附近加一个简短的注释,说明在这里将prevent_exit()和spawn_blocking一起使用是安全的原因,因为对于后续维护者来说,异步运行时关闭与进程退出的交互可能比较微妙。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- In the `sync_repo_version` job, the push command uses `HEAD:${GITHUB_REF_NAME}`, but only `github.ref_name` is provided by Actions; consider switching this to `HEAD:${{ github.ref_name }}` or exporting it explicitly to avoid pushing to an empty/misnamed ref.
- The new `exit_cleanup_started` flag and `try_begin_exit_cleanup` are a good guard against duplicate shutdown, but you might want to add a brief comment near `RunEvent::ExitRequested` explaining why `prevent_exit()` + `spawn_blocking` is safe here, since mixing async runtime shutdown and process exit can be subtle for future maintainers.帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- In the
sync_repo_versionjob, the push command usesHEAD:${GITHUB_REF_NAME}, but onlygithub.ref_nameis provided by Actions; consider switching this toHEAD:${{ github.ref_name }}or exporting it explicitly to avoid pushing to an empty/misnamed ref. - The new
exit_cleanup_startedflag andtry_begin_exit_cleanupare a good guard against duplicate shutdown, but you might want to add a brief comment nearRunEvent::ExitRequestedexplaining whyprevent_exit()+spawn_blockingis safe here, since mixing async runtime shutdown and process exit can be subtle for future maintainers.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `sync_repo_version` job, the push command uses `HEAD:${GITHUB_REF_NAME}`, but only `github.ref_name` is provided by Actions; consider switching this to `HEAD:${{ github.ref_name }}` or exporting it explicitly to avoid pushing to an empty/misnamed ref.
- The new `exit_cleanup_started` flag and `try_begin_exit_cleanup` are a good guard against duplicate shutdown, but you might want to add a brief comment near `RunEvent::ExitRequested` explaining why `prevent_exit()` + `spawn_blocking` is safe here, since mixing async runtime shutdown and process exit can be subtle for future maintainers.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我发现了 1 个问题
给 AI Agent 的提示
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src-tauri/src/main.rs:1274` </location>
<code_context>
+ app_handle_cloned.exit(0);
+ });
}
+ RunEvent::Exit => {}
_ => {}
});
</code_context>
<issue_to_address>
**question:** 移除 `RunEvent::Exit` 中关闭后端的路径会改变现有行为;请确认对所有退出来源来说,这都是有意而为。
此更改让 `RunEvent::Exit` 从之前调用 `state.stop_backend()`,变成现在什么都不做。尽管 `ExitRequested` + `prevent_exit()` 可能已经覆盖了正常的用户退出场景,但 `Exit` 仍然可能由其他来源触发(例如 `app_handle.exit` 或平台事件)。如果有调用方在未经过 `ExitRequested` 的情况下直接调用 `app_handle.exit`,后端清理就会被跳过。建议要么在 `Exit` 分支中保留一次 `stop_backend()` 调用作为安全兜底,要么明确保证/文档化所有相关退出在调用 `exit` 前都会先经过 `ExitRequested`。
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src-tauri/src/main.rs:1274` </location>
<code_context>
+ app_handle_cloned.exit(0);
+ });
}
+ RunEvent::Exit => {}
_ => {}
});
</code_context>
<issue_to_address>
**question:** Dropping the `RunEvent::Exit` backend shutdown path changes existing behavior; ensure this is intentional for all exit sources.
This change makes `RunEvent::Exit` do nothing where it previously called `state.stop_backend()`. While `ExitRequested` + `prevent_exit()` may cover normal user exits, `Exit` can still occur from other sources (e.g., `app_handle.exit` or platform events). If any callers invoke `app_handle.exit` without going through `ExitRequested`, backend cleanup will be skipped. Consider either keeping a `stop_backend()` call in the `Exit` arm as a safety net, or explicitly guaranteeing/documenting that all relevant exits flow through `ExitRequested` before `exit` is called.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我发现了 3 个问题,并给出了一些整体性的反馈:
- 在
scripts/prepare-resources.mjs中,即使提供了ASTRBOT_DESKTOP_VERSION且版本可以在不克隆仓库的情况下解析成功,ensureSourceRepo(sourceDir)仍然会被调用;如果你的意图是在 CI 等场景下避免访问上游仓库,可以考虑在存在桌面版本覆盖且mode === 'version'时(或者更一般地,在不需要上游仓库时)跳过调用ensureSourceRepo。 build-desktop-tauri.yml里的sync_repo_version任务在每个步骤上都重复了条件if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }};你可以把这个条件挪到 job 级别(并继续把它作为一个独立 job 仅用于依赖顺序),以减少重复、让控制流更易于理解。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `scripts/prepare-resources.mjs`, `ensureSourceRepo(sourceDir)` is still called even when `ASTRBOT_DESKTOP_VERSION` is provided and the version can be resolved without cloning; if the intent is to avoid touching the upstream repo (e.g., in CI), consider skipping `ensureSourceRepo` when a desktop version override is present and `mode === 'version'` or in general when the source repo is not needed.
- The `sync_repo_version` job in `build-desktop-tauri.yml` repeats the `if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}` condition on every step; you could move this condition to the job level (and keep it as a separate job purely for dependency ordering) to reduce duplication and make the control flow easier to follow.
## Individual Comments
### Comment 1
<location> `.github/workflows/build-desktop-tauri.yml:130-139` </location>
<code_context>
+ sync_repo_version:
</code_context>
<issue_to_address>
**suggestion:** `sync_repo_version` pushes directly to the current branch; consider handling push races or protected-branch failures more defensively.
Because this job commits and pushes directly to `HEAD:${TARGET_REF_NAME}`, scheduled runs can fail if a new commit lands between checkout and push or if branch protections/status checks block the push. Consider rebasing before push (e.g., `git pull --rebase origin "${TARGET_REF_NAME}"` and handling failures gracefully) and/or constraining when this job runs so that branch protections don’t cause noisy, non-code-related failures.
Suggested implementation:
```
sync_repo_version:
name: Sync Repository Version
needs: resolve_build_context
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout branch
if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
uses: actions/checkout@v6.0.2
with:
# Fetch full history so we can rebase safely before pushing
fetch-depth: 0
- name: Rebase onto latest branch tip
if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
env:
TARGET_REF_NAME: ${{ needs.resolve_build_context.outputs.target_ref_name || github.ref_name }}
run: |
set -euo pipefail
echo "Rebasing local changes onto origin/${TARGET_REF_NAME}"
# Ensure we have the latest remote ref
git fetch origin "${TARGET_REF_NAME}"
# Attempt a rebase; if this fails, we exit cleanly so the job
# reports a real conflict/race instead of a noisy push failure.
if ! git pull --rebase origin "${TARGET_REF_NAME}"; then
echo "::warning::Failed to rebase onto origin/${TARGET_REF_NAME}. Another commit may have landed. Skipping push."
# Mark the step as failed so the schedule noise is visible, but
# leave the repo state untouched for debugging if needed.
exit 1
fi
```
To fully implement the defensive handling you described, the following additional changes are needed elsewhere in the `sync_repo_version` job (not visible in the snippet):
1. **Push step ordering and guard:**
- Ensure that any `git push` or `actions/github-script` step that pushes commits runs *after* the “Rebase onto latest branch tip” step.
- Gate the push on prior success, e.g.:
```yaml
- name: Push updated version
if: ${{ success() && needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
run: |
set -euo pipefail
git push origin "HEAD:${TARGET_REF_NAME}"
```
- Reuse the same `TARGET_REF_NAME` environment variable or define it at the job level to avoid duplication.
2. **TARGET_REF_NAME sourcing:**
- The example above assumes `resolve_build_context` exposes `target_ref_name`. If it does not, either:
- Add that output to `resolve_build_context`, or
- Replace `${{ needs.resolve_build_context.outputs.target_ref_name || github.ref_name }}` with `${{ github.ref_name }}` (or the appropriate ref for your workflow).
3. **Branch protection handling:**
- If branch protections or status checks can block this push, consider:
- Restricting this job to branches that are not protected, or
- Allowing the job to fail softly when `git push` is rejected:
```bash
if ! git push origin "HEAD:${TARGET_REF_NAME}"; then
echo "::warning::Push to ${TARGET_REF_NAME} was rejected (likely branch protection or status checks)."
exit 0
fi
```
- Choose `exit 0` vs `exit 1` depending on whether you want scheduled failures to be visible or silent.
These additional changes will ensure the job rebases before pushing, handles push races more gracefully, and reduces noise from protected-branch failures.
</issue_to_address>
### Comment 2
<location> `scripts/prepare-resources.mjs:11-14` </location>
<code_context>
const sourceRepoUrlRaw =
process.env.ASTRBOT_SOURCE_GIT_URL?.trim() || DEFAULT_ASTRBOT_SOURCE_GIT_URL;
const sourceRepoRefRaw = process.env.ASTRBOT_SOURCE_GIT_REF?.trim() || '';
+const desktopVersionOverride = process.env.ASTRBOT_DESKTOP_VERSION?.trim() || '';
const PYTHON_BUILD_STANDALONE_RELEASE =
process.env.ASTRBOT_PBS_RELEASE?.trim() || '20260211';
</code_context>
<issue_to_address>
**question (bug_risk):** `ASTRBOT_DESKTOP_VERSION` overrides only the synced version files but not necessarily the actual upstream source version; ensure this divergence is intentional.
Because `desktopVersionOverride` only affects the stamped desktop version, but `ensureSourceRepo(sourceDir)` may reuse an existing checkout, you can end up with version files set to `${ASTRBOT_DESKTOP_VERSION}` while the embedded AstrBot runtime still comes from an older `pyproject.toml` version.
If you need the runtime to strictly match the stamped desktop version, consider either:
- Binding `ASTRBOT_DESKTOP_VERSION` to a specific upstream ref and forcing a refresh of `sourceDir`, or
- Emitting a clear log when the override differs from the version resolved from `pyproject.toml`, so drift is visible in CI/logs.
</issue_to_address>
### Comment 3
<location> `README.md:141` </location>
<code_context>
+- `make sync-version`:从当前解析到的 AstrBot 源同步版本,受本地环境变量影响(例如 `ASTRBOT_SOURCE_DIR`)。
+- `make update`:用于“对齐上游”,会忽略 `ASTRBOT_SOURCE_DIR`,并使用 `ASTRBOT_SOURCE_GIT_URL` + `ASTRBOT_SOURCE_GIT_REF` 同步版本。
+
+推荐日常使用 `make update`,避免本地切分支导致版本漂移。
+
+示例:
</code_context>
<issue_to_address>
**nitpick (typo):** Consider using “切换分支” instead of “切分支” for clearer, more standard wording.
This is particularly helpful in written documentation, where more formal phrasing improves clarity and consistency.
```suggestion
推荐日常使用 `make update`,避免本地切换分支导致版本漂移。
```
</issue_to_address>Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Original comment in English
Hey - I've found 3 issues, and left some high level feedback:
- In
scripts/prepare-resources.mjs,ensureSourceRepo(sourceDir)is still called even whenASTRBOT_DESKTOP_VERSIONis provided and the version can be resolved without cloning; if the intent is to avoid touching the upstream repo (e.g., in CI), consider skippingensureSourceRepowhen a desktop version override is present andmode === 'version'or in general when the source repo is not needed. - The
sync_repo_versionjob inbuild-desktop-tauri.ymlrepeats theif: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}condition on every step; you could move this condition to the job level (and keep it as a separate job purely for dependency ordering) to reduce duplication and make the control flow easier to follow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `scripts/prepare-resources.mjs`, `ensureSourceRepo(sourceDir)` is still called even when `ASTRBOT_DESKTOP_VERSION` is provided and the version can be resolved without cloning; if the intent is to avoid touching the upstream repo (e.g., in CI), consider skipping `ensureSourceRepo` when a desktop version override is present and `mode === 'version'` or in general when the source repo is not needed.
- The `sync_repo_version` job in `build-desktop-tauri.yml` repeats the `if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}` condition on every step; you could move this condition to the job level (and keep it as a separate job purely for dependency ordering) to reduce duplication and make the control flow easier to follow.
## Individual Comments
### Comment 1
<location> `.github/workflows/build-desktop-tauri.yml:130-139` </location>
<code_context>
+ sync_repo_version:
</code_context>
<issue_to_address>
**suggestion:** `sync_repo_version` pushes directly to the current branch; consider handling push races or protected-branch failures more defensively.
Because this job commits and pushes directly to `HEAD:${TARGET_REF_NAME}`, scheduled runs can fail if a new commit lands between checkout and push or if branch protections/status checks block the push. Consider rebasing before push (e.g., `git pull --rebase origin "${TARGET_REF_NAME}"` and handling failures gracefully) and/or constraining when this job runs so that branch protections don’t cause noisy, non-code-related failures.
Suggested implementation:
```
sync_repo_version:
name: Sync Repository Version
needs: resolve_build_context
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout branch
if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
uses: actions/checkout@v6.0.2
with:
# Fetch full history so we can rebase safely before pushing
fetch-depth: 0
- name: Rebase onto latest branch tip
if: ${{ needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
env:
TARGET_REF_NAME: ${{ needs.resolve_build_context.outputs.target_ref_name || github.ref_name }}
run: |
set -euo pipefail
echo "Rebasing local changes onto origin/${TARGET_REF_NAME}"
# Ensure we have the latest remote ref
git fetch origin "${TARGET_REF_NAME}"
# Attempt a rebase; if this fails, we exit cleanly so the job
# reports a real conflict/race instead of a noisy push failure.
if ! git pull --rebase origin "${TARGET_REF_NAME}"; then
echo "::warning::Failed to rebase onto origin/${TARGET_REF_NAME}. Another commit may have landed. Skipping push."
# Mark the step as failed so the schedule noise is visible, but
# leave the repo state untouched for debugging if needed.
exit 1
fi
```
To fully implement the defensive handling you described, the following additional changes are needed elsewhere in the `sync_repo_version` job (not visible in the snippet):
1. **Push step ordering and guard:**
- Ensure that any `git push` or `actions/github-script` step that pushes commits runs *after* the “Rebase onto latest branch tip” step.
- Gate the push on prior success, e.g.:
```yaml
- name: Push updated version
if: ${{ success() && needs.resolve_build_context.outputs.should_build == 'true' && github.event_name == 'schedule' }}
run: |
set -euo pipefail
git push origin "HEAD:${TARGET_REF_NAME}"
```
- Reuse the same `TARGET_REF_NAME` environment variable or define it at the job level to avoid duplication.
2. **TARGET_REF_NAME sourcing:**
- The example above assumes `resolve_build_context` exposes `target_ref_name`. If it does not, either:
- Add that output to `resolve_build_context`, or
- Replace `${{ needs.resolve_build_context.outputs.target_ref_name || github.ref_name }}` with `${{ github.ref_name }}` (or the appropriate ref for your workflow).
3. **Branch protection handling:**
- If branch protections or status checks can block this push, consider:
- Restricting this job to branches that are not protected, or
- Allowing the job to fail softly when `git push` is rejected:
```bash
if ! git push origin "HEAD:${TARGET_REF_NAME}"; then
echo "::warning::Push to ${TARGET_REF_NAME} was rejected (likely branch protection or status checks)."
exit 0
fi
```
- Choose `exit 0` vs `exit 1` depending on whether you want scheduled failures to be visible or silent.
These additional changes will ensure the job rebases before pushing, handles push races more gracefully, and reduces noise from protected-branch failures.
</issue_to_address>
### Comment 2
<location> `scripts/prepare-resources.mjs:11-14` </location>
<code_context>
const sourceRepoUrlRaw =
process.env.ASTRBOT_SOURCE_GIT_URL?.trim() || DEFAULT_ASTRBOT_SOURCE_GIT_URL;
const sourceRepoRefRaw = process.env.ASTRBOT_SOURCE_GIT_REF?.trim() || '';
+const desktopVersionOverride = process.env.ASTRBOT_DESKTOP_VERSION?.trim() || '';
const PYTHON_BUILD_STANDALONE_RELEASE =
process.env.ASTRBOT_PBS_RELEASE?.trim() || '20260211';
</code_context>
<issue_to_address>
**question (bug_risk):** `ASTRBOT_DESKTOP_VERSION` overrides only the synced version files but not necessarily the actual upstream source version; ensure this divergence is intentional.
Because `desktopVersionOverride` only affects the stamped desktop version, but `ensureSourceRepo(sourceDir)` may reuse an existing checkout, you can end up with version files set to `${ASTRBOT_DESKTOP_VERSION}` while the embedded AstrBot runtime still comes from an older `pyproject.toml` version.
If you need the runtime to strictly match the stamped desktop version, consider either:
- Binding `ASTRBOT_DESKTOP_VERSION` to a specific upstream ref and forcing a refresh of `sourceDir`, or
- Emitting a clear log when the override differs from the version resolved from `pyproject.toml`, so drift is visible in CI/logs.
</issue_to_address>
### Comment 3
<location> `README.md:141` </location>
<code_context>
+- `make sync-version`:从当前解析到的 AstrBot 源同步版本,受本地环境变量影响(例如 `ASTRBOT_SOURCE_DIR`)。
+- `make update`:用于“对齐上游”,会忽略 `ASTRBOT_SOURCE_DIR`,并使用 `ASTRBOT_SOURCE_GIT_URL` + `ASTRBOT_SOURCE_GIT_REF` 同步版本。
+
+推荐日常使用 `make update`,避免本地切分支导致版本漂移。
+
+示例:
</code_context>
<issue_to_address>
**nitpick (typo):** Consider using “切换分支” instead of “切分支” for clearer, more standard wording.
This is particularly helpful in written documentation, where more formal phrasing improves clarity and consistency.
```suggestion
推荐日常使用 `make update`,避免本地切换分支导致版本漂移。
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
@sourcery-ai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make updateto sync desktop version from upstream AstrBotValidation
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并将版本解析逻辑集中化。make update目标,通过远程 git 引用而不是本地检出,从上游 AstrBot 仓库同步桌面版本相关文件。构建:
build-desktop-tauri工作流,增加sync_repo_version任务,在按计划构建上游 tag 时,先同步并提交版本文件,再进行各平台构建。文档:
make sync-version、make update和由 CI 驱动的版本同步之间的交互方式,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5升级到4.17.6,以与更新后的上游版本对齐。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式执行后端关停逻辑,并仅在清理完成后才终止桌面进程,以避免过早退出。功能增强:
ASTRBOT_DESKTOP_VERSION环境变量覆盖桌面版本,并集中管理版本解析逻辑。make update目标,通过远程 git 引用从上游 AstrBot 仓库同步桌面版本文件,而无需本地检出。构建:
sync_repo_versionCI 任务,在定时的上游标签构建中,先同步并提交版本文件,再执行各平台构建。文档:
make sync-version、make update与 CI 驱动的版本同步之间的关系,以及使用示例。杂项:
4.17.5升级到4.17.6,以反映与上游对齐后的新版本。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并将版本解析逻辑集中化。make update目标,通过远程 git 引用而不是本地检出,从上游 AstrBot 仓库同步桌面版本相关文件。构建:
build-desktop-tauri工作流,增加sync_repo_version任务,在按计划构建上游 tag 时,先同步并提交版本文件,再进行各平台构建。文档:
make sync-version、make update和由 CI 驱动的版本同步之间的交互方式,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5升级到4.17.6,以与更新后的上游版本对齐。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并仅在清理完成后才允许应用终止,防止进程过早退出。增强:
ASTRBOT_DESKTOP_VERSION进行显式覆盖。update目标,通过远程 git refs 而不是本地检出,从上游 AstrBot 同步桌面版本。make update用法以及 CI 版本同步行为的相关说明。构建:
sync_repo_versionCI 任务,在计划的上游 tag 构建中,在执行各平台构建之前同步并提交版本文件。文档:
make sync-version、make update与 CI 驱动的版本同步之间的关系。杂项:
Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并将版本解析逻辑集中化。make update目标,通过远程 git 引用而不是本地检出,从上游 AstrBot 仓库同步桌面版本相关文件。构建:
build-desktop-tauri工作流,增加sync_repo_version任务,在按计划构建上游 tag 时,先同步并提交版本文件,再进行各平台构建。文档:
make sync-version、make update和由 CI 驱动的版本同步之间的交互方式,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5升级到4.17.6,以与更新后的上游版本对齐。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式执行后端关停逻辑,并仅在清理完成后才终止桌面进程,以避免过早退出。功能增强:
ASTRBOT_DESKTOP_VERSION环境变量覆盖桌面版本,并集中管理版本解析逻辑。make update目标,通过远程 git 引用从上游 AstrBot 仓库同步桌面版本文件,而无需本地检出。构建:
sync_repo_versionCI 任务,在定时的上游标签构建中,先同步并提交版本文件,再执行各平台构建。文档:
make sync-version、make update与 CI 驱动的版本同步之间的关系,以及使用示例。杂项:
4.17.5升级到4.17.6,以反映与上游对齐后的新版本。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并将版本解析逻辑集中化。make update目标,通过远程 git 引用而不是本地检出,从上游 AstrBot 仓库同步桌面版本相关文件。构建:
build-desktop-tauri工作流,增加sync_repo_version任务,在按计划构建上游 tag 时,先同步并提交版本文件,再进行各平台构建。文档:
make sync-version、make update和由 CI 驱动的版本同步之间的交互方式,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5升级到4.17.6,以与更新后的上游版本对齐。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores:
Bug 修复:
ExitRequested时以异步方式运行,并且只在清理完成后才退出桌面进程。功能增强:
ASTRBOT_DESKTOP_VERSION覆盖桌面版本,并引入集中化的版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流,新增sync_repo_version任务,在上游打 tag 的定时构建中先同步并提交版本文件,然后再运行各平台构建。文档:
make sync-version、make update以及由 CI 驱动的版本同步机制,并说明 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
稳定桌面托盘的退出/重启流程,并引入一条自动化流水线,用于将桌面版本与上游 AstrBot 同步,包括本地工具、CI 以及文档更新。
Bug 修复:
ExitRequested时异步运行后端关闭逻辑,并确保桌面进程只在清理完成后才退出,同时在Exit时进行兜底清理。增强功能:
ASTRBOT_DESKTOP_VERSION环境变量支持覆盖桌面版本,并集中化版本解析逻辑。make update目标,通过远程 git 引用而非本地检出,从上游 AstrBot 仓库同步桌面版本文件。构建:
build-desktop-tauri工作流中添加sync_repo_version任务,在计划的上游标签构建之前更新并提交桌面版本文件,并使所有平台构建都通过ASTRBOT_DESKTOP_VERSION使用解析后的 AstrBot 版本。文档:
make sync-version、make update和由 CI 驱动的版本同步的作用,以及 CI 何时会将版本变更提交回仓库。杂项:
4.17.5提升到4.17.6,以与更新后的上游版本保持一致。Original summary in English
Summary by Sourcery
Stabilize the desktop tray quit/restart flow and introduce an automated pipeline for syncing the desktop version with upstream AstrBot, including local tooling, CI, and documentation updates.
Bug Fixes:
Enhancements:
Build:
Documentation:
Chores: