This commit adds 6 new documentation files to fill critical gaps:
- CONTRIBUTING.md: Developer onboarding guide with setup, workflow,
code style, testing, and adding features
- TROUBLESHOOTING.md: Common issues and solutions for errors,
model issues, tool issues, channel issues, gateway issues,
configuration issues, and memory/database issues
- docs/api/PROTOCOL.md: Gateway JSON-RPC protocol documentation
with connection, authentication, message format, methods,
events, error codes, and example client implementation
- docs/api/TOOLS.md: Tools API documentation covering tool interface,
input schema format, result format, tool patterns,
tool registration, tool policy, execution flow, and
builtin tools reference
- docs/deployment/PRODUCTION.md: Production deployment guide
covering Docker deployment, systemd service, security,
configuration, monitoring, backup & recovery, and
performance tuning
- docs/performance/TUNING.md: Performance optimization guide
covering context management, model routing, tool execution,
memory & embeddings, session management, database
performance, gateway performance, and resource usage
These files complement the existing excellent documentation
(README.md, AGENTS.md, ARCHITECTURE.md, STRUCTURE.md,
CONVENTIONS.md) to provide complete coverage for users,
developers, and operators.
Store per-session config in SQLite and route /model and /reset through command fast-paths so channel sessions keep independent model selection across reconnects and restarts.
Add runtime truthfulness modes and autonomy-level tool gating with audit metadata for overrides/denials.
Wire policy through prompt assembly, tool execution context, and daemon/gateway agent paths; update tests and planning state for Phase 3 PR #2 completion.
- Add session_config SQLite table for per-session settings
- Update routing to support session override → agent config → global default resolution chain
- Upgrade WebChat SessionBridge from NativeAgent to AgentOrchestrator
- Add /model, /local, /cloud commands to Telegram adapter
- Add /model command to WebChat gateway handlers
- Clear session overrides on /reset command
- Pass memoryStore and config through to SessionBridge
- Add comprehensive tests for all new functionality
Fixes model persistence bug where TUI model changes didn't affect WebChat/Telegram sessions. Now:
- TUI /model sets global default (persists across restarts, affects all new sessions)
- WebChat/Telegram /model sets session override (only that conversation, cleared on /reset)
- WebChat sessions gain AgentOrchestrator features (delegation, compaction, memory)
- SOUL.md: list all available tools (web.search, memory.*, cron.*, etc.)
and add Tool Usage Rules section enforcing 'act, don't narrate'
- cron.ts: add getJob(), addJob(), removeJob() to CronScheduler for
runtime (ephemeral) cron job management
- cron tools: add cron.create and cron.delete tools, enhance cron.list
to show schedule/output/message details
- policy.ts: add cron tools to messaging and coding profiles, add
group:cron to tool groups
Fixes issue where models would narrate tool intent ('let me search...')
then stop without actually calling tools.
Copy button on all messages (clipboard API with checkmark feedback).
Edit button on user messages populates the input textarea.
Buttons appear on hover (desktop) or always visible (mobile).
Local LLMs often get stuck calling the same tool repeatedly because they
lack the sophistication to synthesize results. The agent loop had no
safeguard — it re-executed whatever the model requested up to 10 times.
Add fingerprint-based loop detection: if the same tool+args combination
repeats 3 consecutive times, break the loop and return the last results.
Also add agents.max_iterations to the config schema so the iteration
limit is user-configurable (default: 10).
Gmail API returns snippets with HTML entities (&, ', <br>, etc.)
that leaked into LLM responses as raw HTML. Added shared sanitizeHtml()
utility in src/utils/html.ts and applied it to gmail tool snippets,
HTML body fallback, and gmail watcher snippets.
Implements `flynn gmail-auth` to complete the OAuth2 flow that
GmailWatcher references but was never built. Supports local callback
server (default) and --manual paste mode. Adds Gmail health check
to `flynn doctor`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark onboard wizard as MATCH (100/128, 78%). Update test count to 1151.
Add setup-wizard plan entry to state.json.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>