Add Phase 7: polish and hardening — retry, truncation, sessions, shutdown

- Config extensions: retry backoff, truncation threshold, session persistence
- LLM retry with exponential backoff + jitter on transient errors (5xx, connection)
- Conversation truncation: drops oldest messages preserving first user + recent N
- Session persistence: auto-save/restore with atomic writes, cleanup of old files
- Graceful shutdown: SIGTERM handler, cancel() on AgentLoop, save-on-exit
- Partial message recovery on mid-stream interruption
- New slash commands: /save, /session
- 18 new tests (5 retry, 5 truncation, 4 session, 4 integration workflows)
- README.md and docs/tools.md documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 10:20:16 -05:00
parent 82846d6236
commit 76ba490aa2
16 changed files with 1550 additions and 12 deletions

View File

@@ -7,11 +7,16 @@ llm:
temperature: 0.1
max_tokens: 4096
timeout: 120
max_retries: 3
retry_backoff_base: 1.0
retry_backoff_max: 30.0
agent:
max_iterations: 25
max_conversation_tokens: 32000
workspace_root: "."
truncation_keep_recent: 10
truncation_threshold: 0.85
permissions:
auto_approve:
@@ -56,6 +61,12 @@ tools:
max_file_size_bytes: 1048576 # 1 MB
binary_detection: true
session:
session_dir: ".sneakycode/sessions"
auto_save: true
max_session_age_hours: 72
offer_resume: true
display:
show_tool_calls: true
show_token_usage: true