Repository navigation
Conversation
A `#[tauri::command]` runs on the main thread. Thirty of them wait on a daemon round-trip, and twelve of those call `ensure_daemon`, which spawns a daemon and waits up to four seconds for it. Until the window opened without a daemon this was hard to reach; now clicking "New bot" against a daemon that will not start freezes everything — the banner explaining the failure included — for the whole deadline, once per click. They are `#[tauri::command(async)]` now, which hands them to a worker and leaves the signature alone, so the ones called directly as Rust functions still are. `list_models` and `open_path` wait on a child process and join them. The rule is one missing token away from being broken again, and a window that stops repainting while a daemon is slow does not read as a missing attribute. `no_command_waits_on_the_daemon_from_the_main_thread` reads this file and fails with the names.
im-ian
marked this pull request as draft
September 21, 2026 04:57
Owner
Author
|
리뷰 결과 머지 보류. async 전환이 메인 스레드 직렬화라는 암묵적 불변식을 제거하는데, 세 곳이 거기에 기대고 있었어요.
|
This was referenced Sep 21, 2026
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.
TL;DR
데몬을 기다리는 Tauri command 32개가 메인 스레드에서 돌고 있었어요.
#[tauri::command(async)]로 옮기고, 규칙이 다시 무너지지 않게 테스트로 고정했어요.원인
#[tauri::command]로 선언된 command 는 메인 스레드에서 실행돼요. 그중client::rpc로 데몬 왕복을 기다려요client::ensure_daemon()까지 불러요 — 데몬을 spawn 하고 최대 4초 기다려요#19 이전엔 데몬이 안 뜨면 앱이 아예 안 떠서 이 상태에 도달할 수 없었어요. 이제 창이 뜨니까, 데몬이 못 뜨는 상태에서 "새 봇" 을 누르면 클릭 한 번에 4초씩 창 전체가 멈춰요 — 그 이유를 설명하는 배너까지 같이 얼어요.
고친 것
list_models,open_path→#[tauri::command(async)].add_channel이list_channels()를 Rust 함수로 직접 부르는 기존 호출부도 그대로 동작해요.규칙을 테스트로 고정 — 토큰 하나 빠지면 다시 깨지는데, "데몬이 느릴 때 UI 가 멈춘다" 는 증상은 누락된 어트리뷰트처럼 안 보여요.
no_command_waits_on_the_daemon_from_the_main_thread가 이 파일을 직접 읽어서 위반한 command 이름을 뱉어요.검증
cargo test --locked -p crew— 212 passedlist_agents를 sync 로 되돌리면 →FAILED,these talk to the daemon on the main thread; declare them #[tauri::command(async)]: ["list_agents"]npm test— 130 passed /npm run build통과cargo fmt --check—desktop.rscleanapp=ALIVE ready=YES, stderr 없음 (async 배선이 깨졌으면 전부 실패했을 경로)참고
ensure_daemon의 4초 대기 자체는 안 건드렸어요 — 그건 #20 의 readiness 처리와Child회수(다음 PR) 쪽 얘기예요. 이 PR 은 "기다리더라도 창은 계속 그려진다" 까지만 해요.