Daily Log: /btw Overhaul, /insights, /refresh all
/refresh all
Added /refresh all command — hard-restarts all non-human agents. Follows the same pattern as /sleep all and /suspend all. Extracted hardRefreshDir() from the existing hardRefresh() method.
Doctor hints updated to prefer /refresh over /cpr. Updated greetings (en/zh/wen), tutorial, and all i18n files.
/btw Inquiry Overhaul
The old /btw was fragile: wrote a .inquiry signal file, hoped the agent heartbeat picked it up, no feedback, no result display. Fixed with:
- IsAlive guard — refuses if agent is dead, shows “try /refresh”
.inquiry→.inquiry.takenhandshake — kernel renames on pickup, deletes after LLM call completes. TUI shows “thinking…” in status bar while.inquiry.takenexists.- Result display — TUI tails
soul_inquiry.jsonl, filters forsource: "human", renders with markdown in a unified box (subtle bars, gold label, esc to dismiss). - Source field —
soul_inquiry.jsonlentries now taggedhuman/insight/agent. Migration m004 backfillssource: "agent"on old entries. - WriteInquiry guard — refuses to write if
.inquiryor.inquiry.takenalready exists. Prevents duplicate inquiries. - Kernel threading —
_run_inquiry()now runs in a daemon thread so the heartbeat loop isn’t blocked during LLM calls (was causing agent to appear “suspended” during inquiry). - No-tools prompt —
soul_inquiry()system prompt explicitly says “no tools, plain text only” to prevent MiniMax from hallucinating tool call XML.
.inquiry file format
First line is source, rest is question:
human
你还能干啥?
/insights Command
/insights— manual one-shot trigger. Writes.inquirywithsource: "insight"and the canned insight question.- Auto-insights — toggle in
/settings(off by default). Fires once per idle cycle (5s delay after active→idle transition)..insight.donesentinel prevents re-firing until human sends a new message. - Rendering — same box style as
/btwbut with★ insightlabel instead of/btw ›. - Dismiss — press Esc to hide insights from default view. They reappear in ctrl+o verbose mode.
Settings Descriptions
Each settings field now shows a description line below when selected (en/zh/wen). “Insights” renamed to “Auto Insights”.
Kernel (lingtai-kernel)
- Thread-safe inquiry processing
_persist_soul_entryacceptssourceparameter.inquiryfile format with source line- No-tools system prompt for soul_inquiry
- Bumped to 0.5.12, published to PyPI
Releases
- TUI: v0.4.32
- Kernel: 0.5.12 (PyPI)
Key Design Decisions
-
Inquiry stays inside agent process — considered
lingtai inquiryas standalone CLI subprocess, but soul_inquiry needs the live agent’s conversation clone. Can’t construct a second agent instance (lock prevents it). Keeping it in the heartbeat was the right call, just needed threading to not block heartbeat writes. -
.inquiry.takenhandshake — provides three-state feedback (sent → taken → done) and crash safety. Kernel renames atomically, processes in thread, deletes when done. No retry logic — if crash happens, human re-triggers. -
File-based guards over in-memory flags —
WriteInquirychecks file existence,.insight.donesentinel on disk. Survives TUI restarts and avoids the cascading-insight bug that plagued in-memory state tracking.