4.5 KiB
4.5 KiB
Task: Optimize Robot configuration editor controls
Identity
- Task ID: 20260816-robot-config-selects-5a7c
- Mode: Feature
- Branch: codex/20260816-robot-config-selects-5a7c-robot-config-selects
- Worktree: D:\Datas\OthersProjects\makelore-robot-config-selects-5a7c
- Base commit:
7bef261fb8 - Owner: codex
- Status: Ready for Integration
Scope
- Use the signed-in Xiaozhi role-configuration page as a read-only interaction reference for the Makelore Robot configuration editor.
- Replace avoidable free-text and numeric entry with selection-oriented controls while preserving every supported public configuration field and
clear_fieldsbehavior. - Add the smallest safe option-catalog seam required for dynamic model, language, and voice choices; do not expose Xiaozhi credentials or arbitrary upstream paths to Renderer.
- Add focused Renderer/API/route tests and preserve the existing revision-conflict, idempotency, error-redaction, and credential boundaries.
Intent And Constraints
- Nickname and system prompt remain free-form; VAD/ASR/LLM/SLM/VLLM/Intent/Mem/TTS/language/voice should follow Xiaozhi's selection pattern when an authoritative option source exists.
- TTS volume, rate, and pitch must be adjustable without keyboard entry and must retain the full supported integer range, including existing non-preset values.
- Dynamic choices must use stable machine values with human-readable labels, preserve the currently configured value, and fail safely when catalogs are unavailable.
- The page must remain usable at the existing desktop viewport, with accessible labels, keyboard interaction, busy/error states, and at least 40px interactive targets.
- This feature task owns only its isolated worktree and task-scoped record; canonical project memory remains integration-owned.
Plan
- Verify the Xiaozhi UI and option sources, then define the minimal safe catalog contract.
- Implement selection controls and dependent option behavior without weakening update validation.
- Add TDD coverage for catalogs, selected values, clearing, numeric controls, and unchanged conflict recovery.
- Run focused/full checks, obtain independent review, then integrate through the existing serialized main task.
Outcome
- Added a strict Renderer catalog API and fixed Electron Main proxy route for Xiaozhi model/voice choices without exposing provider credentials or arbitrary upstream paths.
- Reworked the Robot configuration dialog into grouped Basic, Model, and Language/Voice sections. Model IDs, language values, voices, and chat-history modes now use selects; SLM reuses the LLM directory.
- Replaced numeric TTS inputs with bounded
-100..100sliders and explicit provider-default controls while preserving nullableclear_fieldssemantics. - Preserved unavailable current values, added safe catalog retry/error states, refreshed dependent voices when TTS changes, and retained existing revision rebase and operation-identity behavior.
- Applied
private, no-storeandno-cacheto every local catalog success/failure response, and kept all new retry/default controls at a minimum 40px interaction height.
Verification
corepack pnpm exec vitest run tests/unit/ai-hardware-api.test.ts tests/unit/ai-hardware-routes.test.ts tests/unit/ai-hardware-page.test.tsx tests/unit/module-navigation.test.tsx tests/unit/main-layout-module-gate.test.tsx-> 5 files, 84 tests passed.corepack pnpm run typecheck-> passed.- Focused ESLint on the six changed TypeScript/TSX files -> passed.
corepack pnpm run build:vite-> passed; only the existing chunk-size/dynamic-import warnings remained.git diff --check-> passed with Git line-ending warnings only.- Independent Sol review -> PASS after cache-boundary and 40px target fixes; no P0-P3 findings remain.
Follow-ups
- Deploy the matching Xiaozhi and Works Square catalog endpoints before releasing this client; catalog failure is safe and preserves the current configuration, but choices cannot populate until both services are updated.
Promotion Candidates
- Target:
.project-docs/20-architecture/system-overview.mdand Robot integration contract. Proposal: record the USER-scoped safe configuration-catalog flow from Xiaozhi through Works Square Main-owned credentials to Makelore. Evidence: the three task records and focused cross-layer tests. Future impact: model/voice selections remain dynamic without exposing provider configuration. No semantic conflict identified; integration owner decides promotion.