- Create initAgents() function encapsulating AgentConfigRegistry, AgentRouter, SandboxManager init
- Replace ~26 lines in startDaemon() with single initAgents() call
- Lifecycle shutdown handler for sandbox cleanup included in agents.ts
- Zero type errors, routing tests pass
- Move createMessageRouter function (~220 lines) to dedicated routing module
- Add import from ./routing.js in daemon/index.ts
- routing.test.ts passes without modification
- Zero type errors
Adds zhipuai as a new provider using the OpenAI-compatible API at
api.z.ai. Supports api_key config or ZHIPUAI_API_KEY env var, with
optional endpoint override.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check model capabilities via /api/show before sending tools.
Models without 'tools' capability get requests without tools
(they can still answer, just without tool use). Result is cached
per client instance. Defense-in-depth: 'does not support' added
to retry nonRetryablePatterns to avoid wasting retries on
permanent errors.
- Ollama: pass tools to API, parse tool_calls responses, handle thinking field from reasoning models (deepseek-r1, glm-4.7-flash)
- llama.cpp: pass tools via OpenAI-compatible endpoint, parse tool_calls, accumulate streaming tool call deltas
- Both clients now set stopReason to 'tool_use' when tool calls are present
- Tests: 12 new tests (8 Ollama + 5 llama.cpp, total 983→995)
- assembleSystemPrompt() now injects '# Runtime Context' with current date/time
- New system.info tool: date, time, hostname, platform, arch, uptime, memory, Node.js version
- Tool available in all profiles (minimal/messaging/coding/full)
- 983 tests passing (+7 new)
- README: features list, Gmail config section with field reference and
template variables, hook examples, architecture tree, CLI description
- CHANGELOG: new Added entries for both features
- SOUL.md: file.patch in capabilities list
- config/default.yaml: file.patch in confirm hooks, commented-out
automation section with cron, webhooks, gmail, heartbeat examples
New ChannelAdapter that monitors Gmail via Google Cloud Pub/Sub push
notifications with polling fallback. Supports OAuth2 auth, configurable
watch labels, template rendering with email metadata placeholders
(from, to, subject, snippet, date, id, labels).
Wired into daemon lifecycle and gateway (POST /gmail/push endpoint).
Includes 16 tests covering auth, templates, push notifications, and
channel routing.
Implements apply_patch equivalent: a single tool call can make multiple
line-based edits (replacements, insertions, deletions) across one or more
files. Hunks are applied bottom-up to preserve line numbers.
Includes 10 tests covering replacement, multi-hunk, insertion, deletion,
multi-file, overlapping hunks error, OOB error, and edge cases.
Two issues prevented the GitHub Models fallback from working:
1. The X-GitHub-Api-Version: 2022-11-28 header caused '400 invalid
apiVersion' errors. The Copilot chat completions endpoint does not
use this header — removed from both constructor and rebuildClient.
2. The anthropicToGitHubModel mapping was incomplete: it only knew
three models and the generic date-stripping fallback produced wrong
names (e.g. 'claude-sonnet-4-5' instead of 'claude-sonnet-4.5').
GitHub Copilot uses dots for sub-versions, not hyphens.
Updated with explicit mappings for all current models (sonnet 4,
4.5; opus 4, 4.5, 4.6; haiku 4.5) and a smarter generic fallback
that converts digit-hyphen-digit to digit.digit at the end.
3. createClientFromConfig now auto-maps Anthropic-style model names
when the provider is 'github', so users can copy model names from
their Anthropic config into fallback blocks without manual renaming.
The TUI was building its own ModelRouter with a duplicated client factory
that lacked auto same-model fallback, local_providers resolution, retry
config, and per-tier fallback logic. When Anthropic failed, it skipped
GitHub Models and fell straight to the local Ollama model.
Replace the duplicated ~50-line createClient + router setup in tui.ts
with a single call to the daemon's createModelRouter(), which already
handles all of these correctly. This removes ~50 lines of duplicated
code and ensures TUI and daemon have identical fallback behavior.
Add comments explaining:
- Auto same-model fallback via GitHub Models for Anthropic tiers
- Inline per-tier fallback blocks
- The full fallback order (primary → auto → inline → global chain)
- local_providers map for named providers in fallback_chain
- Usage examples for both patterns
Previously these tools were only available in daemon mode. Now TUI mode
also registers web search tools (when credentials are configured) and
process management tools with proper cleanup on exit.
When a tier uses the Anthropic provider and has no user-configured inline
fallback, automatically insert a GitHub Models client for the equivalent
model as a tier fallback. This ensures the same model is tried via an
alternative provider before degrading to the global fallback chain (which
may be a much weaker local model).
Mapping: claude-sonnet-4-20250514 → claude-sonnet-4, etc.
Mark 5 features as MATCH: tool groups, session pruning, /think,
/verbose, typing indicators. Update scorecard (80/116 features),
remove completed Tier 1 section from remaining gaps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Five additive features with no breaking changes:
- Tool groups: group:fs, group:runtime, group:web, group:memory syntactic
sugar for allow/deny lists in tool policy config
- Typing indicators: Discord sendTyping() and WhatsApp sendStateTyping()
on message receipt for better UX feedback
- Session pruning: TTL-based auto-cleanup via sessions.ttl config with
hourly daemon timer and SQLite GROUP BY pruning
- /verbose command: TUI command parser toggle for raw streaming display
- !!think prefix: per-message extended thinking mode wired through
Anthropic (budget_tokens), OpenAI/GitHub (reasoning_effort), and
Gemini (thinkingConfig) providers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 8 new agent-callable tools (sessions.list/history/create/delete,
agents.list, message.send, cron.list/trigger) and sanitize tool names
at the API boundary (dots → underscores) to comply with Anthropic's
`^[a-zA-Z0-9_-]{1,128}` requirement. Reverse-maps sanitized names
back to internal names for hook callbacks and tool execution.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads the optional fallback field from each tier's config and builds
a tierFallbacks map passed to ModelRouter at startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The router now accepts a tierFallbacks map so each model tier can have
its own fallback providers. Tier fallbacks are tried before the global
fallback chain in both chat() and chatStream().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each model tier (fast, default, complex, local) can now specify an
optional fallback provider config that the router will try before
falling through to the global fallback chain.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
whatsapp-web.js lacks proper ESM named exports, causing SyntaxError on
import. Switch to default import with destructuring, use InstanceType
for the Client type annotation, and update test mock to provide both
default and named exports.
- README: add Web UI Dashboard section, update features list with all
current capabilities (multi-channel, media pipeline, sandboxing, etc.),
expand model providers table, update architecture diagram
- CHANGELOG: add P7 entries (dashboard SPA, 4 new gateway handlers)
- state.json: add P7 entry with all 6 phases and file lists, update
overall_progress to reflect P0-P7 completion
- web-ui-dashboard.md: mark as completed with detailed phase outcomes
- Add SPA shell with hash-based router, sidebar navigation, and WebSocket RPC client
- Add dashboard page with system health cards, channel status, and auto-refresh
- Add chat page with session selector, streaming tool events, and markdown rendering
- Add sessions page with list, history viewer, and delete functionality
- Add settings page with hook pattern editor, tool list, and config viewer
- Add backend handlers: sessions.delete, sessions.switch, system.channels, system.usage
- Wire channelRegistry into gateway server for channel status reporting
- Extend static file server with .mjs, .png, .ico, .woff2 content types