Commit Graph

398 Commits

Author SHA1 Message Date
William Valentin 4bb8c88fbe feat(auth): add anthropic api key storage and cli auth 2026-02-14 00:43:12 -08:00
William Valentin 0493660e7d feat(gateway): add system.services and dashboard services grid 2026-02-14 00:42:41 -08:00
William Valentin 151b48310e orchestrator: recover from context overflow on fallback 2026-02-13 21:19:02 -08:00
William Valentin 944b2c916a routing: fast-path voice when transcription not configured 2026-02-13 18:35:04 -08:00
William Valentin 7df0569a39 feat(models): add Z.AI (GLM) credential integration and setup flow
Implement first-class Z.AI credential storage and authentication:

- New auth provider: src/auth/zai.ts for Z.AI API key management
- New CLI command: flynn zai-auth to store Z.AI API keys
- New TUI command: /login zai for interactive credential entry
- Modified src/auth/index.ts to register zai provider
- Modified src/cli/index.ts to register zai-auth command
- Modified src/cli/setup/providers.ts to include Z.AI in setup wizard
- Modified src/daemon/models.ts to support zhipuai use_oauth flag
- Modified src/daemon/clientFactory.test.ts to add Z.AI tests
- Modified src/frontends/tui/commands.ts to add login command
- Modified src/frontends/tui/minimal.ts to support credential prompts

This allows users to authenticate with Z.AI (GLM models) without
embedding secrets in config files. Credentials are stored securely in
~/.config/flynn/auth.json and resolved at runtime.

Updated state.json with new feature entry documenting the integration.
2026-02-13 16:23:49 -08:00
William Valentin cc54b3a10c feat(webchat): support image attachments 2026-02-13 15:03:48 -08:00
William Valentin 955b9e28e0 feat: add OpenAI OAuth, strict model overrides, and Gmail pull mode 2026-02-13 14:55:40 -08:00
William Valentin 8f644d5e25 feat(skills): add rollout promotion contract and sync planning state 2026-02-13 08:51:19 -08:00
William Valentin 9f81c01603 feat(session): persist model tier overrides per session
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.
2026-02-13 01:04:26 -08:00
William Valentin 3472a0b926 docs(plans): add openclaw analysis and rollout checklists 2026-02-12 22:47:28 -08:00
William Valentin 7ae0fb51c2 feat(skills): add rollout status governance and promotion policy checks 2026-02-12 22:43:46 -08:00
William Valentin 43b584257f feat(skills): hash installer audit commands for shell runner telemetry 2026-02-12 22:20:14 -08:00
William Valentin d3647567ee test(skills): add edge-case receipt tests for partial/missing runner results 2026-02-12 21:12:15 -08:00
William Valentin 8c4ac2cb00 fix(skills): reject execute without explicit confirm 2026-02-12 20:59:11 -08:00
William Valentin 81d5c4d730 test(skills): cover install and execute option parsing 2026-02-12 19:38:16 -08:00
William Valentin 8affe8bea9 feat(skills): add execute command opt-in runner flow 2026-02-12 19:28:44 -08:00
William Valentin 3272387eaa feat(skills): wire opt-in execution runner selection 2026-02-12 19:23:30 -08:00
William Valentin 30fcccd05a feat(skills): add optional shell command runner 2026-02-12 19:18:20 -08:00
William Valentin 3a1bac0891 feat(skills): map runner outcomes into step receipts 2026-02-12 19:07:13 -08:00
William Valentin 5e5d96523e feat(skills): add per-step no-op execution envelopes 2026-02-12 19:03:27 -08:00
William Valentin 0d324886eb feat(skills): add pluggable no-op runner interface 2026-02-12 18:50:28 -08:00
William Valentin a983e01db7 feat(skills): gate execution receipts with policy checks 2026-02-12 18:48:08 -08:00
William Valentin 1159fac640 feat(skills): add confirmed no-op execution receipts 2026-02-12 18:44:13 -08:00
William Valentin f0fc806f95 refactor(skills): centralize install action modes 2026-02-12 18:36:09 -08:00
William Valentin e8d5d01d4d feat(skills): add installer execution stub command 2026-02-12 18:26:09 -08:00
William Valentin 1bb791c7dd feat(skills): support install preflight-only mode 2026-02-12 18:17:46 -08:00
William Valentin 601844c50e feat(skills): preview installer plan during install 2026-02-12 18:15:42 -08:00
William Valentin d3ba1328f2 feat(skills): add installer plan command output 2026-02-12 18:11:38 -08:00
William Valentin bd754d520e feat(skills): add dry-run installer planning surface 2026-02-12 17:56:51 -08:00
William Valentin 81d04357a1 feat(skills): validate manifest installer specs 2026-02-12 17:52:53 -08:00
William Valentin bd29afeaff chore(skills): improve watcher event observability 2026-02-12 17:40:41 -08:00
William Valentin 333e33f30f feat(skills): target watcher updates with safe fallback 2026-02-12 17:36:32 -08:00
William Valentin 2fb5c9adab feat(skills): reload registry on watcher change events 2026-02-12 17:30:23 -08:00
William Valentin b773e2bbf3 feat(skills): enable watcher wiring through daemon lifecycle 2026-02-12 17:18:22 -08:00
William Valentin 95091cc198 feat(skills): add debounced watcher foundation for phase 2 2026-02-12 17:15:46 -08:00
William Valentin 0a19f01639 feat(doctor): surface skill directory health in diagnostics 2026-02-12 17:05:04 -08:00
William Valentin fc3d2ab4d8 feat(skills): add refresh summary for discovery health 2026-02-12 17:02:23 -08:00
William Valentin 2d753321b3 feat(skills): guard uninstall with explicit confirmation 2026-02-12 16:59:50 -08:00
William Valentin d5b7d72e5d feat(skills): add install dispatch for local skill setup 2026-02-12 16:50:25 -08:00
William Valentin 0d84a6bccc feat(skills): add info command for skill inspection 2026-02-12 16:44:46 -08:00
William Valentin b3e5aee333 feat(skills): expose list command for skill visibility 2026-02-12 16:42:00 -08:00
William Valentin 90ce622080 feat(policy): enforce truthfulness and autonomy guardrails
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.
2026-02-12 16:06:45 -08:00
William Valentin a8a2c59313 feat: implement model persistence with per-session overrides
- 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)
2026-02-11 21:51:38 -08:00
William Valentin c62dad2e2e docs: update state.json with native audio support feature and test count (1369) 2026-02-11 18:27:50 -08:00
William Valentin fae3565480 docs(skills): add skills infrastructure plan
- Three-phase plan for skills system improvements
- Phase 1: Command Dispatch (flynn skills CLI commands)
- Phase 2: Skills Watcher (auto-reload with chokidar)
- Phase 3: Installer Specs (auto-install brew/node/go/download)
- Model strategy: glm-4.7-flash for mechanical, glm-4.7 for complex
- Estimated 8-11 hours total
2026-02-11 14:48:21 -08:00
William Valentin 85d7a6bfec test: add stopReason edge case tests; update state.json with recent fixes
- Added tests for finish_reason 'tool_calls' with empty array → 'end_turn'
- Added test for finish_reason 'length' → 'max_tokens'
- Updated state.json with 4 new entries for today's fixes (SOUL.md, message
  normalization, agent loop resilience, stopReason normalization)
- Test count: 1329 → 1331
2026-02-11 09:51:19 -08:00
William Valentin 5270234bbb feat: improve tool usage guidance in SOUL.md and add cron.create/cron.delete tools
- 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.
2026-02-11 09:32:36 -08:00
William Valentin 27ee3b2c10 feat(webchat): add copy and edit buttons on chat messages
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).
2026-02-10 20:53:49 -08:00
William Valentin 4c8ba3f20c feat(webchat): add slash commands, autocomplete popup, and web search button
Add 6 slash commands (/help, /reset, /compact, /usage, /status, /model)
with autocomplete popup (arrow keys, Enter/Tab/Escape navigation).
Search button toggles web search mode by prepending instruction to message.
Backend agent.send extended with metadata for server-side command routing.
2026-02-10 20:45:14 -08:00
William Valentin bf9ca690f3 fix(agent): detect repeated tool call loops and make max_iterations configurable
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).
2026-02-10 19:35:09 -08:00