PainAggregator and SolutionGenerator were in-memory only, losing all
data on restart. Add PainStorage module with SQLite backend (4 tables),
dual-write strategy (hot cache + durable), and startup cache warming.
- New: pain_storage.rs — SQLite CRUD for pain_points, pain_evidence,
proposals, proposal_steps with schema initialization
- Modified: pain_aggregator.rs — global PAIN_STORAGE singleton,
init_pain_storage() for startup, dual-write in merge_or_create/update
- Modified: solution_generator.rs — same dual-write pattern via
global PAIN_STORAGE
- 20 tests passing (10 storage + 10 aggregator)
The TopBar had a gradient badge with 'Z' letter followed by the title
'ZCLAW', creating visual 'ZZCLAW'. Replaced badge with a solid gradient
square as a brand indicator without the duplicate letter.
The framer-motion AnimatePresence with mode="wait" caused the sidebar
content to get stuck on the conversations list when switching to the
agents tab. The React state updated correctly but the DOM did not
re-render. Replaced with simple conditional rendering which is more
reliable and removes the framer-motion dependency from this component.
All core and extended test scenarios passed for the high school math
teacher persona using DeepSeek-V3 and Kimi models. Key findings:
- Math problem solving, quiz generation, memory flywheel all working
- Model switching (deepseek→kimi) verified mid-conversation
- Safety boundary correctly rejects sensitive requests
- 1 P2 bug: sidebar AnimatePresence tab switching fails
P1: identity.rs get_identity() returns empty soul/instructions for agents
without explicit identity files. This prevents the default ZCLAW personality
from overriding agent_config.system_prompt. New get_identity_or_default()
method added for the DEFAULT agent.
P2: messaging.rs now uses agent_config.model.model when available, falling
back to global Kernel config. This allows per-agent model selection.
P2: agentStore.ts loadClones retries up to 3 times (300ms interval) when
getClient() returns null, handling the coordinator initialization race.
P2: agent_create Tauri command auto-populates identity files (soul +
instructions) from creation parameters, ensuring build_system_prompt()
has content for new agents.
Also fixes conversationStore upsertActiveConversation to persist generated
conversation IDs, preventing duplicate entries on new conversations.
Tool execution (ShellExec, WebFetch, etc.) had no timeout, causing the
entire streaming response to hang indefinitely when a tool fails or stalls.
Now wraps execute_tool calls in tokio::time::timeout(30s) with a graceful
error message on timeout.
- nextStep() was allowing currentStep to reach steps.length (6), past
the last step index (5), showing "步骤 7/6:" with empty content area
- On the last step, nextStep now triggers handleSubmit() directly
instead of navigating to a phantom step 6
- Footer button condition changed: "完成" shows on last step instead
of after it, keeping error/success messages visible
- Added error logging in catch block (was silently swallowing errors)
Root cause: Each LLM delta (text/thinking) triggered a synchronous
setState via updateMessages → chatStore.setState. With Kimi thinking
model emitting many deltas per frame, this caused a React render storm
that hit the maximum update depth limit.
Fix (two-layer approach):
1. streamStore: Buffer text/thinking deltas locally and flush to store
via setTimeout(0), batching multiple deltas per frame
2. chatStore: Microtask batching in injectChatStore.updateMessages to
coalesce rapid successive updates
Verified: 2-round conversation (4 messages) with Kimi thinking model
completes without crash. Previously crashed 100% on 2nd message.
h-full = 100% of parent height, but TopBar already occupies 56px above.
This caused ChatArea to overflow by 56px, pushing the input box below
the visible viewport. flex-1 + min-h-0 correctly fills remaining space
in the flex column layout.
The input area at the bottom of the chat panel lacked flex-shrink-0,
causing the flex column layout to compress it when message content filled
the Conversation area. This made the textarea only partially visible and
the scrollbar unable to reach the bottom of the input area.
Root cause: start_consumer() was called in new() before any register() calls,
so the consumer's cloned HashMap was always empty. Workers like log_operation
and record_usage were never found, causing "Unknown worker" errors.
- Add WorkerDispatcher::start() method to be called after all register()s
- Update main.rs to call dispatcher.start() after 7 workers registered
- key_pool.rs: cast cooldown_until to timestamptz for comparison with NOW()
- key_pool.rs: cast request_count to bigint (INT4→INT8) for sqlx decoding
- service.rs: cast cooldown_until to timestamptz in quota sort query
- scheduler.rs: cast last_seen_at to timestamptz in device cleanup
- totp.rs: use DateTime<Utc> instead of rfc3339 string for updated_at
- Add TODO to PainAggregator documenting in-memory-only data limitation
- Remove unused `use serde::Serialize` import from a2a.rs (already clean)
- ProposalsSection: trigger refresh on error instead of silent catch
- useButlerInsights: collect all errors instead of overwriting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PersonalityConfig with 4 dimensions: tone, proactiveness, formality, humor
- Signal detection from Chinese user messages (e.g. "说简单点" → Simple tone)
- apply_personality_adjustments() returns new immutable config
- build_personality_prompt() injects personality into system prompts
- Integrated into post_conversation_hook for automatic detection
- In-memory persistence via OnceLock (VikingStorage integration TODO)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Enable multi-agent feature by default in desktop build
- Add butler delegation logic: task decomposition, expert assignment
- Add ExpertTask, DelegationResult, butler_delegate() to Director
- Add butler_delegate_task Tauri command bridging Director to frontend
- 13 Director tests passing (6 original + 7 new butler tests)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Priority 90 — runs before Compaction@100 and Memory@150.
Detects and replaces company names, money amounts, phone numbers,
emails, and ID card numbers with deterministic tokens (__ENTITY_N__).
External callers can restore originals via DataMasker::unmask().
Task 1.1 verification: OpenViking Extractor chain is confirmed working.
- Tauri commands registered ✅
- Frontend triggers after each conversation ✅
- Rust extractor with LLM + rule-based fallback ✅
- SqliteStorage persistence verified via 3 new e2e tests
All 78 tests in zclaw-growth pass with no regressions.
HIGH fixes:
- H-NS-1: Non-streaming agent_chat now builds ChatModeConfig and calls
send_message_with_chat_mode(), matching the streaming path
- H-FE-1: ClarificationCard component renders structured clarification
questions with type badge, question text, and numbered options
- H-SEM-1: SemanticSkillRouter annotated as @reserved (Phase 3 wiring)
MEDIUM fixes:
- M-SETTINGS-1: Settings menu restructured with "高级" section separator;
skills/audit/tasks/heartbeat/semantic-memory grouped under advanced
- M-MAN-1: LoopEvent→StreamChatEvent mapping completeness checklist
added as documentation comment in agent_chat_stream loop
- M-ORPH-1: Deleted orphaned Automation/ and SkillMarket/ files,
plus transitively orphaned types, hooks, and adapters
CRITICAL:
- ask_clarification now terminates Agent Loop in both run() and run_streaming()
paths, preventing the LLM from continuing after requesting user clarification
HIGH:
- SaaS relay now forwards plan_mode and subagent_enabled to backend
- GatewayClient.chatStream now supports onThinkingDelta, onSubtaskStatus,
and token-bearing onComplete — aligned with kernel-types StreamCallbacks
- ZclawStreamEvent type extended with thinking_delta, subtask_status variants
and input_tokens/output_tokens fields for token tracking via Gateway path
- C-1: Add event_sender: None to ToolContext in file_write.rs and
file_read.rs test helper functions (compilation fix)
- I-1: file_write tool now echoes content preview in output JSON,
enabling streamStore.ts artifact auto-creation pipeline to work
- S-2: Fix typo "LLM 锥应错误" → "LLM 响应错误" in loop_runner.rs
The connectZclawStream call in the synchronous code path (common case
when agentId is already known) was missing the subagent_enabled field,
causing Gateway-connected clients to never send the flag to the server.
- New ask_clarification tool (crates/zclaw-runtime/src/tool/builtin/ask_clarification.rs)
with 5 clarification types: missing_info, ambiguous_requirement, approach_choice, risk_confirmation, suggestion
- Registered as built-in tool in builtin.rs
- Added clarification system prompt instructions to messaging.rs system prompt
- Fixed messaging.rs skill injection: when SkillIndexMiddleware is active,
only inject usage instructions (not full skill list), avoiding duplicate injection
- Fixed pre-existing unicode arrow character causing string literal parse error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When SkillIndexMiddleware is active, build_system_prompt_with_skills no
longer injects the full categorized skill list. Instead it only adds
usage instructions, while the middleware handles the lightweight index.
This reduces ~2000 tokens per request for the 75-skill system.
When the agent writes files via the file_write tool, artifacts are now
automatically created in the artifact panel. The file extension determines
the artifact type (code/markdown/text) and syntax highlighting language.
This connects the existing ArtifactPanel UI to actual tool output data.
Phase 1.0 — Butler Mode UI:
- Hide "自动化" and "技能市场" entries from sidebar navigation
- Remove AutomationPanel and SkillMarket view rendering from App.tsx
- Simplify MainViewType to only 'chat'
- Main interface is now: chat + conversation list + detail panel only
Phase 1.1 — Mode Differentiation:
- Add subagent_enabled field to ChatModeConfig (Rust), StreamChatRequest (Tauri),
gateway-client, kernel-client, saas-relay-client, and streamStore
- TaskTool is now only registered when subagent_enabled=true (Ultra mode)
- System prompt includes sub-agent delegation instructions only in Ultra mode
- Frontend transmits subagent_enabled from ChatMode config through the full stack
This connects the 4-tier mode selector (Flash/Thinking/Pro/Ultra) to actual
backend behavioral differences — Ultra mode now truly enables sub-agent delegation.
Previously hardcoded to false in Tauri bridge. Now checks whether
kernel provided a driver before building classroom, correctly flagging
placeholder content when LLM is unavailable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>