feat: OmniVoice TTS từ xa + tạo/xoá Flow project trên batchexecute - #43
Open
hieuh0 wants to merge 6 commits into
Open
feat: OmniVoice TTS từ xa + tạo/xoá Flow project trên batchexecute#43hieuh0 wants to merge 6 commits into
hieuh0 wants to merge 6 commits into
Conversation
Port the jHPbke (create) and QI2zvc (delete) RPCs captured off the Flow UI: - flow_batch: RPC_CREATE_PROJECT/RPC_DELETE_PROJECT, request builders, and read_created_project_id (slot 0, uuid fullmatch, raises otherwise). - flow_client.create_project mints a project via jHPbke when unpinned (pin still reused first); rejects non-default tool_name on batch; delete_project via QI2zvc. - projects DELETE route: preflight get_project (404 before any RPC), remote-first delete of every project except the pinned/shared one, local row kept on failure. Verified: 100 unit tests + a live create/delete round trip on Flow.
A pinned or request-supplied Flow project id may already have a local row; the bare INSERT then raised UNIQUE constraint failed and surfaced as a 500. Return the existing row when the id is already tracked.
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.
Tóm tắt
PR này bổ sung backend OmniVoice TTS từ xa và hoàn thiện luồng tạo/xoá Flow project trên đường batchexecute, kèm một bản vá idempotent cho route tạo project. Tổng cộng 18 file, +1051/-75.
Vì sao cần thay đổi
batchexecutecủa Flow chưa tự tạo/xoá project, nên phải thao tác tay trên UI. PR đưa 2 RPC bắt được từ Flow UI (jHPbketạo,QI2zvcxoá) vào client.UNIQUE constraint failed: project.id) khi id đã tồn tại cục bộ (project được pin hoặc client gửi lên) — cần trả về row sẵn có thay vì INSERT lại.Nội dung thay đổi
1. Backend OmniVoice TTS từ xa (
feat(tts))agent/omnivoice_api.py(mới, 224 dòng): client gọi OmniVoice từ xa.agent/services/tts.py,agent/api/tts.py,agent/config.py: nối backend từ xa vào pipeline TTS, thêm cấu hình.run-omnivoice-api.sh,requirements.txt: script chạy và dependency.skills/fk-gen-narrator.md,skills/fk-gen-tts-template.md,skills/fk-import-voice.md: ghi chú dùng backend OmniVoice từ xa.2. Tạo/xoá Flow project trên batchexecute (
feat(flow))agent/services/flow_batch.py: builder request choRPC_CREATE_PROJECT/RPC_DELETE_PROJECTvàread_created_project_id(đọc slot 0, khớp UUID đầy đủ, ném lỗi nếu không hợp lệ).agent/services/flow_client.py:create_projectmint project quajHPbkekhi chưa pin (vẫn ưu tiên tái dùng project đã pin);delete_projectquaQI2zvc.agent/api/projects.py(route DELETE): preflightget_project(trả 404 trước khi gọi RPC), xoá remote-first mọi project trừ project pinned/shared, giữ lại row cục bộ khi xoá remote thất bại.3. Vá idempotent route tạo project (
fix(api))agent/api/projects.py: khi id đã được theo dõi cục bộ, trả về row hiện có thay vì INSERT lại (tránh 500 do vi phạm primary key). Id mới sinh không bao giờ trùng nên không ảnh hưởng đường tạo mới.Kiểm thử
tests/unit/test_flow_batch.py,test_flow_client_batch.py,test_projects_route.py,test_tts.py.