fix: keep dave chat responsive on llm failures
Some checks failed
Codex Template Compliance / template-compliance (pull_request) Successful in 52s
Build / test-and-image (pull_request) Failing after 1m31s

This commit is contained in:
2026-07-11 18:27:12 +02:00
parent 74579375b3
commit 429114f272
7 changed files with 194 additions and 20 deletions

View File

@@ -5,7 +5,8 @@ Last updated: 2026-07-11
## Current DAVE Telegram Style Fix
- Operator feedback from 2026-07-11 screenshots: DAVE still sent large Telegram report blocks, legacy `CRUCIX ROUTINE` fallback alerts, visible report labels such as `Confidence`, and tool/audit traces such as `Werkzeuge: get_security_profile`.
- Active branch: `codex/fix-dave-telegram-human-style`.
- Follow-up feedback from 2026-07-11 18:18: DAVE sometimes stopped answering with `The agent returned no usable response` / `AI chat failed`, and visible labels like `[DAVE // HINWEIS]` still felt like system blocks.
- Current follow-up branch: `codex/fix-dave-agent-timeout-fallback`.
- Intent: DAVE should write like a human Telegram contact: short messages, one thought per message, no visible Markdown/report sections, and no automatic tool traces in normal chat.
- Code changes in progress:
- `TelegramAlerter.sendConversation(...)` now defaults to 420-character chat chunks and can split long paragraphs by sentence.
@@ -13,7 +14,10 @@ Last updated: 2026-07-11
- Normal Telegram AI answers no longer append tool trace suffixes; `/trace` remains the explicit audit command.
- Proactive DAVE and dynamic presence prompts request short human-style Telegram messages; evidence is capped and tool names are hidden from visible chat.
- DAVE persona and terminal-agent protocol now require short natural chat answers for proactive/presence responses.
- Tests added in `test/telegram-chat.test.mjs` to verify short default chunks and conversational fallback alerts without `CRUCIX ROUTINE`, `Confidence:`, `Direction:`, or visible tool traces.
- Follow-up removes visible `[DAVE // ...]` headers from proactive/presence/fallback Telegram messages.
- Follow-up catches empty model responses and LLM timeout/fetch failures inside the terminal agent, returning a short local-sweep fallback instead of `no usable response` or `AI chat failed`.
- The fallback tells the operator which terminal surfaces DAVE can control from chat: status, sources, briefings, markets, evidence/web search, memory, scenarios, and confirmed sweeps/alerts.
- Tests added in `test/telegram-chat.test.mjs` and `test/terminal-agent.test.mjs` to verify short default chunks, conversational fallback alerts without `CRUCIX ROUTINE`, no visible DAVE system labels, no tool traces, empty-response repair, and timeout fallback to the local sweep.
## Source Degradation Handling