Commit Graph
100 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Fable 5 f03d41c698 fix: use dedicated tool-phase prompt for gemma4 orchestration
With the butler persona prompt attached, gemma4 reasons about calling the
calculator and then answers from memory with a different wrong product every
run; tool_choice=required via extra_body is advisory at best on Ollama's
OpenAI-compat layer. orchestrate_tool_calls() now uses a terse
TATLOCK_ORCHESTRATION_PROMPT; synthesize_from_results() keeps the persona,
so the user-visible voice is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 18:35:53 +02:00
jpmschweitzerandClaude Fable 5 033a1c01e8 feat: make Ollama/gemma4 the primary backend with Claude as fallback
Rolls back the claudification backend preference: PREFER_CLOUD_BACKEND now
defaults to false, resolve_backend() picks Ollama first and uses Claude when
explicitly preferred or when the new Ollama startup health check fails. The
Steward retries mid-request failures on the other backend in both directions.

Also hardens the fallback itself: Anthropic SDK imports are lazy so a broken
anthropic package degrades to Ollama-only instead of crashing at import time
(root cause of the production outage since April), anthropic is pinned to a
pydantic-ai-1.27-compatible range, ANTHROPIC_MODEL defaults to claude-sonnet-5
(sonnet-4-20250514 retired 2026-06-15), sampling parameters are stripped from
Claude calls (Sonnet 5 rejects them), and the Steward timeout is configurable
(STEWARD_TIMEOUT, default 60s) since gemma4 needs ~35s warm for analysis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 18:35:53 +02:00
jpmschweitzerandClaude Opus 4.6 427ad311dc feat: switch default Ollama model to gemma4:e2b
Build and Push / release (push) Successful in 21s
Build and Push / build (push) Successful in 5m27s
gemma4:e2b has native function calling with dedicated tool tokens,
achieving 100% tool selection accuracy in benchmarks vs 67% for
mistral-nemo-large, with 5-8x faster response times (2-4s vs 15-20s)
and lower VRAM usage (8GB vs 9.2GB).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:44:27 +02:00
jpmschweitzerandClaude Opus 4.6 4f911929f4 ci: remove test gate from release pipeline
Build and Push / release (push) Successful in 2s
Build and Push / build (push) Successful in 1m23s
Tests are run locally before tagging. Removes the slow CI test job
and its dependency gates on release and build jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 21:22:51 +01:00
jpmschweitzerandClaude Opus 4.6 f49c5ac02c fix: use exclude_unset for SSE streaming chunk serialization
Build and Push / test (push) Failing after 1m46s
Build and Push / build (push) Has been skipped
Build and Push / release (push) Has been skipped
exclude_none was too aggressive — it stripped finish_reason: null from
intermediate chunks (which OpenAI includes). exclude_unset correctly
omits only fields never passed to the constructor (like reasoning_content
on content-only chunks) while preserving explicitly-set finish_reason: null.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 21:18:20 +01:00
jpmschweitzerandClaude Opus 4.6 a3c7fcf8c3 refactor: consolidate project structure and clean up documentation
- Move docs to docs/ (philosophy, roadmap, orchestration scenarios,
  claude integration, testing improvements)
- Strip completed phases from roadmap and claude integration docs
- Move dependencies from requirements*.txt into pyproject.toml
- Move pytest config from pytest.ini into pyproject.toml
- Add Makefile replacing wakeup.sh (setup, run, test, lint, etc.)
- Add CI test gate in Gitea Actions workflow
- Consolidate caches into .cache/ (pytest, mypy, ruff)
- Consolidate build output into build/ (coverage, logs)
- Update Dockerfile for pyproject.toml install
- Update cross-references in README, AGENTS.md, CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 20:44:25 +01:00
jpmschweitzerandClaude Opus 4.6 901a04825d docs: add CLAUDE.md with development guide and testing gotchas
Documents architecture, key file locations, test setup, and critical
gotchas discovered during development (ASGITransport lifespan, async
scope mismatch, Ollama fallback behavior, missing benchmark store).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 20:22:06 +01:00
jpmschweitzerandClaude Opus 4.6 334d313d17 fix: repair broken tests and ensure Claude backend is used in integration tests
- Remove references to unimplemented get_benchmark_store from steward and
  tool tracking tests
- Fix steward test fixture calling async initialize_application synchronously
  by using sync register_household_members instead
- Rewrite tool tracking tests to assert actual logging behavior
- Change unit test fixture model from Tatlock to lorem-tester so unit tests
  don't require external services
- Add session-scoped _initialize_app fixture to run Claude health check,
  ensuring integration tests use Claude instead of falling back to Ollama
- Increase integration test timeouts from 30s to 120s to match OLLAMA_TIMEOUT
- Add Steward reasoning as ReasoningOutputItem in create_response_with_steward
  so <think> tags appear in chat completion responses
- Add test_tatlock_ollama_fallback to verify Ollama fallback path works

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 20:15:59 +01:00
jpmschweitzerandClaude Opus 4.5 8092740fa4 fix: exclude null fields from streaming chunks for Open WebUI compatibility
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 1m24s
OpenAI's API omits null fields in streaming chunks, but Tatlock was
including them (content: null, reasoning_content: null). This caused
parsing issues in Open WebUI's streaming handler.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 15:36:37 +01:00
jpmschweitzerandClaude Opus 4.5 e469746f75 fix: use StreamingResponse for chat completions SSE
Build and Push / release (push) Successful in 2s
Build and Push / build (push) Successful in 1m22s
sse_starlette's EventSourceResponse added \r\n line endings that
Open WebUI couldn't parse. Switched to plain StreamingResponse with
manual SSE formatting matching OpenAI's exact format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:29:08 +01:00
jpmschweitzerandClaude Opus 4.5 31e7884d8f fix: remove Steward analysis from user-visible reasoning
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 1m21s
The Steward's internal routing analysis (DELEGATE, COMPLEXITY, etc.)
was being exposed in <think> blocks. This is implementation detail,
not useful reasoning for the user.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 12:19:05 +01:00
jpmschweitzerandClaude Opus 4.5 e15def607d fix: remove extra_body tool_choice hack for Claude backend
Build and Push / build (push) Successful in 1m57s
Build and Push / release (push) Successful in 3s
PydanticAI handles tool_choice natively for Anthropic. The extra_body
hack caused an infinite tool call loop where Claude kept calling the
same tool because tool_choice was forced to "any".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:51:42 +01:00
jpmschweitzerandClaude Opus 4.5 6dd1c2e2a9 fix: trigger CI on version tag push instead of release event
Changed workflow trigger from release:published to push:tags:v[0-9]*
so that pushing a version tag triggers the build pipeline.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:52:43 +01:00
jpmschweitzerandClaude Opus 4.5 3617218359 chore: release v2.0.1
Build and Push / release (release) Failing after 3s
Build and Push / build (release) Successful in 1m21s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:49:46 +01:00
jpmschweitzerandClaude Opus 4.5 c7a4012831 fix: use AnthropicProvider to pass api_key to PydanticAI model
AnthropicModel doesn't accept api_key directly; it must be passed
through an AnthropicProvider instance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:47:02 +01:00
jpmschweitzerandClaude Opus 4.5 496f37a538 feat: add Claude backend with automatic Ollama fallback (Claudification Phase 1)
Build and Push / release (release) Failing after 6s
Build and Push / build (release) Successful in 3m5s
All agents now prefer Claude API when ANTHROPIC_API_KEY is configured,
with automatic fallback to Ollama when offline or unconfigured. New
src/anthropic/ module provides model selection via get_model() factory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:19:29 +01:00
jpmschweitzer 5d23bcae79 auto release/build on version tag 2026-01-03 20:39:51 +01:00
jpmschweitzerandClaude Opus 4.5 62eac3eb61 feat: integrate Paperless documents and volatile cache into Librarian
Build and Push / build (release) Successful in 54s
- Add Paperless document search to HybridRAG pipeline
- Add volatile cache (weather, forecast, news, stocks) to HybridRAG
- Add include_documents and include_volatile params to hybrid_search
- Add 📑 and  icons for document/volatile sources
- Update Librarian prompt with new data source awareness
- Fix Biographer routing: personal memory queries now route correctly
- Add location keywords to Steward pre-fetch logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:31:23 +01:00
jpmschweitzerandClaude Opus 4.5 ba195e401a fix: reduce Tatlock's excessive apologizing
Build and Push / build (release) Successful in 53s
Strengthened personality prompt to prevent unnecessary apologies after
successful Librarian delegations. Added explicit "do NOT apologize"
instructions to both system prompt and synthesis prompt.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 17:52:19 +01:00
jpmschweitzerandClaude Opus 4.5 3ec4f402fa chore: release v1.10.0
Build and Push / build (release) Successful in 1m2s
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:34:12 +01:00
jpmschweitzerandClaude Opus 4.5 628f05532b chore: bind server to all network interfaces
Change uvicorn from localhost to 0.0.0.0 to allow connections
from other machines on the network.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:28:24 +01:00
jpmschweitzerandClaude Opus 4.5 51fd59ce92 fix: prevent Librarian from fabricating information
Add explicit instructions to the Librarian system prompt to never
invent data when tools fail or data sources are unavailable.

- Report what failed specifically
- Never provide placeholder or made-up data
- Better to return no information than fabricated information

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:28:13 +01:00
jpmschweitzerandClaude Opus 4.5 87f2926db2 feat: integrate tracing throughout request pipeline
Instrument the full request flow with trace spans for debugging:

- Wrap expert delegations (librarian/biographer/housekeeper) in spans
- Add orchestrate and synthesize spans to TatlockAgent
- Trace Steward analysis in preprocessing
- Start/end traces in response service with context management
- Simplify router by moving context handling to service layer
- Include tracing router in debug mode
- Remove benchmark recording from tool_tracking and steward service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:26:37 +01:00
jpmschweitzerandClaude Opus 4.5 2a9449bc81 refactor: remove Redis benchmark system
Remove the Redis-backed performance benchmarking in favor of the new
lightweight file-based tracing system which provides better debugging
capabilities for local development.

- Delete src/core/benchmarks.py
- Remove ENABLE_BENCHMARKS, REDIS_BENCHMARK_DB, redis_url from config
- Update memory_cache comment (now uses DB 1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:26:17 +01:00
jpmschweitzerandClaude Opus 4.5 60d84535c0 feat: add lightweight request tracing for debugging
Adds JSON-based tracing system for local development that captures
the full request flow through Tatlock's multi-agent architecture.

- Trace/Span dataclasses with automatic timing and nesting
- Context-var based propagation for async-safe tracing
- trace_span async context manager for clean instrumentation
- Traces written to logs/traces/{trace_id}.json
- REST API for listing and retrieving traces (/traces)
- Standalone HTML viewer with timeline visualization

Enabled via DEBUG=true environment variable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 10:25:56 +01:00
jpmschweitzerandClaude Opus 4.5 aa16fe4ffd chore: release v1.9.0
Build and Push / build (release) Successful in 1m37s
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:00:01 +01:00
jpmschweitzerandClaude Opus 4.5 363ab378af feat: optimize Housekeeper for Mistral-Nemo tool calling
- Rewrite system prompt with negative constraints and step-by-step process
- Set temperature to 0.1 for deterministic tool calling
- Sort room groups to top of device list (address positional bias)
- Add [ROOM GROUP] marker in list_devices output
- Update tool docstrings with explicit entity_id= parameter examples
- Add optimization findings doc (experiment log: 0% → 100% success)
- Add test script for room group detection regression testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 20:58:39 +01:00
jpmschweitzer 43c09f9922 localhost in wakeup script 2025-12-18 20:08:52 +01:00
jpmschweitzer 74cf27980a cleanup 2025-12-17 20:44:09 +01:00
jpmschweitzerandClaude Opus 4.5 e5d50dda77 fix: housekeeper API paths and entity hallucination prevention
Build and Push / build (release) Successful in 56s
- Update all client endpoints to use /housekeeping/ prefix
- Add critical rule requiring list_devices() before control actions
- Add housekeeping API spec documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 20:43:46 +01:00
jpmschweitzerandClaude Opus 4.5 583c407edd fix: Redis bool storage, tool tracking matching, e2e fixture scope
Build and Push / build (release) Successful in 53s
- Convert booleans to strings for Redis hset (Redis doesn't accept bool)
- Extract capability from delegate_to_X tool names for tracking
- Use loop_scope="module" for pytest-asyncio module-scoped fixtures
- Add note about using venv for tests in AGENTS.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 14:53:51 +01:00
jpmschweitzer 404e8fc106 add pre deploy check 2025-12-16 09:36:17 +01:00
jpmschweitzerandClaude Opus 4.5 54a27b481a docs: add release flow section to AGENTS.md
Documents the version bump, changelog update, tagging, and
deployment verification steps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 09:33:52 +01:00
jpmschweitzerandClaude Opus 4.5 9980e4764c fix: remove <think> wrappers from think messages
Build and Push / build (release) Successful in 1m49s
Messages in reasoning_content should be plain text, not wrapped
in <think> tags. Removed wrappers from:
- delegation.py household think messages
- orchestration.py status messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 09:12:17 +01:00
jpmschweitzerandClaude Opus 4.5 4907798e74 fix: use reasoning_content for Open WebUI streaming
Build and Push / build (release) Successful in 51s
Use DeepSeek R1 format (reasoning_content field) instead of <think>
tags in content. Open WebUI now renders thinking as proper
collapsible blocks instead of broken escaped HTML.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:56:45 +01:00
jpmschweitzerandClaude Opus 4.5 fb54887c03 fix: handle HybridRAG keywords schema change
Build and Push / build (release) Successful in 52s
library-desk now returns keywords as dict with core_keywords field.
Client now handles both list and dict formats for backwards compat.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:32:36 +01:00
jpmschweitzerandClaude Opus 4.5 d5e5fc1ad8 fix: Ollama message sanitization and streaming think slugs
Build and Push / build (release) Successful in 52s
- Fix `invalid message content type: <nil>` error from Ollama
- Create TatlockOllamaProvider that sanitizes messages (null → "")
- Update all agents to use sanitized provider
- Fix repeating think messages by adding ReasoningSummaryDone signal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:19:03 +01:00
jpmschweitzerandClaude Opus 4.5 74f47097c2 fix: complete web search integration with query enrichment
Build and Push / build (release) Successful in 52s
Fixes several issues with the web search migration to Librarian:

- Update Steward routing guidelines for web search/weather → Librarian
- Register search_web, read_url, read_urls_batch tools with Librarian agent
- Update Librarian system prompt with web search documentation
- Fix query enrichment not being passed to delegations (location context)
- Add URL reading keywords to RESEARCH action type detection

Weather queries now automatically include user's stored location from
the Biographer, enabling location-aware search results.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 22:51:18 +01:00
jpmschweitzerandClaude Opus 4.5 add9b74207 chore: bump version to 1.7.0
Build and Push / build (release) Successful in 53s
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 18:31:31 +01:00
jpmschweitzerandClaude Opus 4.5 100ebeae52 feat: migrate web search from tatlock_core to Librarian
Move web search functionality to The Librarian agent, integrating with
the library-desk /rag/search endpoint for enhanced search capabilities.

Changes:
- Add search_web, read_url, read_urls_batch tools to Librarian
- Add WebSearchResult, ContentExtractionResult models to client
- Add search_web, extract_content, extract_content_batch client methods
- Update Librarian capability with web/url/internet domains
- Remove search_web from tatlock_core tools and toolset
- Update Tatlock system prompt to delegate web search to Librarian
- Add comprehensive unit tests for new Librarian tools
- Clean up legacy src/agents/tools.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 18:30:16 +01:00
jpmschweitzerandClaude Opus 4.5 3e432d662e docs: add infrastructure access instructions to AGENTS.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 15:13:33 +01:00
jpmschweitzerandClaude Opus 4.5 49f0da8068 feat: two-phase execution, think slugs, query enrichment (v1.6.0)
Build and Push / build (release) Successful in 1m14s
Two-Phase Tatlock Execution:
- orchestrate_tool_calls() for Phase 1 coordination
- synthesize_from_results() for Phase 2 butler-toned synthesis
- Guarantees butler personality in all responses

Automatic Think Slugs:
- Deterministic butler-perspective messages during expert delegation
- ActionType enum: RETRIEVE, RESEARCH, CREATE, CONTROL, RECORD
- HOUSEHOLD_THINK_MESSAGES mapping for all experts
- Streaming delegation wrappers with automatic think messages

Steward Query Enrichment:
- Auto-fill user context (location, timezone) when not specified
- _build_enriched_query() with regex word boundary matching
- enriched_query field in StewardRecommendation schema

Documentation:
- ORCHESTRATION_SCENARIOS.md rewritten with Mermaid diagrams
- New Housekeeper and Biographer scenarios
- TESTING_IMPROVEMENTS.md for future LLM testing patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 14:00:32 +01:00
jpmschweitzerandClaude Opus 4.5 a1b8fe46e8 feat: add The Housekeeper agent for home automation
Implements The Housekeeper, a new expert agent for home automation
following the Librarian pattern. Communicates with core-api service
which wraps Home Assistant REST API.

New agent features:
- CoreAPIClient with 13 home automation methods
- 13 tools: list_areas, list_devices, get_device_state, turn_on,
  turn_off, toggle, list_scenes, activate_scene, list_scripts,
  run_script, list_automations, toggle_automation, get_history
- PydanticAI agent with butler-friendly system prompt
- HouseholdCapability registration for Steward coordination
- delegate_to_housekeeper() wrapper for orchestration

Also includes:
- Dev port changed from 8123 to 8777 (avoids Home Assistant conflict)
- Config: CORE_API_HOST, CORE_API_KEY, CORE_API_TIMEOUT
- 44 unit tests for client and capability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 10:24:35 +01:00
jpmschweitzerandClaude Opus 4.5 64cad4500a feat: environment-aware config, direct delegation, E2E test suite (v1.4.0)
Build and Push / build (release) Successful in 52s
### Added
- Environment-aware configuration:
  - Auto-selected logging (DEBUG for dev, WARNING for prod)
  - Auto-selected default user (llm_tester for dev isolation)
  - User context logging at request entry
- Direct delegation bypass:
  - Pure memory/librarian requests skip Tatlock LLM
  - Reduces latency for memory-only requests
- Text-based delegation fallback:
  - Parse [DELEGATE:agent] patterns from LLM output
  - Sequential and parallel execution support
- Comprehensive E2E test suite:
  - 22 orchestration tests with QdrantVerifier
  - assert_llm_behavior() for flexible pattern matching
  - Tests for memory, delegation, isolation, scenarios

### Fixed
- Unit test mocks for streaming (async generator)
- Temporal context handling in tests
- LLM non-determinism with pytest.xfail()
- Streaming test timeouts increased

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 21:19:47 +01:00
jpmschweitzerandClaude Opus 4.5 9d7ce399c8 fix(memory): biographer tool type hints for Ollama (v1.3.2)
Build and Push / build (release) Successful in 51s
- Change `str | None` to `str` with empty default for memory_type
- Remove `keywords` parameter from store_insight (auto-generated anyway)
- Ollama's OpenAI API doesn't handle union types with None properly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:04:10 +01:00
jpmschweitzerandClaude Opus 4.5 8e38a568ef fix(memory): add biographer to delegation wrappers (v1.3.1)
Build and Push / build (release) Successful in 50s
- Add delegate_to_biographer to household registry delegation map
- Was returning raw tools which caused Ollama "invalid message content type: nil"
- Add Qdrant host/port to .env.example

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 14:56:32 +01:00
jpmschweitzerandClaude Opus 4.5 40663511b4 feat: memory system fixes and Redis config cleanup (v1.3.0)
Build and Push / build (release) Successful in 26s
- Fix Qdrant client to use query_points API (qdrant-client >= 1.10)
- Rename REDIS_DB to REDIS_BENCHMARK_DB for clarity
- Update Redis defaults to match stack allocation (benchmark=6, memory=1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 14:36:56 +01:00
jpmschweitzer 8f008c7fd2 no longer needed 2025-12-14 14:05:07 +01:00
jpmschweitzerandClaude Opus 4.5 d207594e3c fix(deps): add missing pydantic-settings dependency
Build and Push / build (release) Successful in 50s
pydantic-ai-slim doesn't include pydantic-settings as a transitive
dependency like the full pydantic-ai package did.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 13:57:33 +01:00
jpmschweitzerandClaude Opus 4.5 523c5c43a0 feat(ci): trigger Watchtower update after image push
Build and Push / build (release) Successful in 1m56s
Automatically notify Watchtower to pull and deploy the new image
after a successful registry push.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 13:01:59 +01:00
jpmschweitzerandClaude Opus 4.5 822cdc9bf4 fix(ci): upgrade to build-push-action@v6, disable sbom
- Upgrade docker/build-push-action from v5 to v6
- Add sbom: false alongside provenance: false
- Update registry URL to internal domain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 11:42:37 +01:00
jpmschweitzer 214dc4e725 fixed ci/cd network issue
Build and Push / build (release) Failing after 11s
2025-12-14 10:49:29 +01:00
jpmschweitzerandClaude Opus 4.5 acdde99a5c fix(ci): disable provenance for Gitea registry compatibility
Build and Push / build (release) Failing after 1m1s
Add provenance: false to docker/build-push-action to fix
"received unexpected HTTP status: 200 OK" error when pushing
to Gitea container registry.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 21:13:16 +01:00
jpmschweitzerandClaude Opus 4.5 4e6f1da4f3 chore: slim dependencies with pydantic-ai-slim[openai]
Build and Push / build (release) Failing after 1m3s
- Switch from pydantic-ai to pydantic-ai-slim[openai]
- Removes unused provider SDKs (anthropic, boto3, cohere, google, groq, huggingface)
- Production packages: 53 (down from ~158)
- Production footprint: 178MB
- Add DEPENDENCY_SLIM.md with rollback instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 21:02:09 +01:00
jpmschweitzerandClaude Opus 4.5 7dd2c20e76 docs: update README and roadmap for v1.2.0
Build and Push / build (release) Failing after 1m47s
README.md:
- Add household staff table with current status
- Update requirements to list external services
- Add Redis, Qdrant to configuration section
- Update project structure with new modules
- Update version to 1.2.0

IMPLEMENTATION_ROADMAP.md:
- Update current state to v1.2.0
- Mark Phase 2 (Steward) as complete
- Mark Phase 3 (Butler coordination) as complete
- Update Phase 4 with Librarian and Biographer complete
- Mark Phase 6 (Services) as complete
- Update Phase 8 (Memory) with completed items
- Update next steps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 19:29:30 +01:00
jpmschweitzerandClaude Opus 4.5 7426dd1ac3 feat: add Phase F.2 - The Biographer (memory agent)
Add The Biographer household member for user memory management:

Memory Service (direct access layer):
- src/core/memory_service.py for fast, LLM-free lookups
- Profile, preference, and fact management
- Session context with Redis caching
- Steward integration via prefetch_context()

The Biographer Agent:
- src/agents/biographer/ package with PydanticAI agent
- Discreet chronicler personality for privacy
- Tools: recall_semantic, list_memories, store_insight,
  update_profile, update_preference, forget_memory
- Registered with Household Registry on startup

Steward Integration:
- Memory context pre-fetch during analysis
- Profile/preferences included in Butler note
- Keyword-based context determination

Also includes:
- delegate_to_biographer() wrapper
- 34 new tests (capability + memory service)
- Version bump to 1.2.0

Documentation cleanup:
- Removed obsolete PHASE2_COMPLETE.md, PHASE2_PLAN.md
- Removed docs/library-desk-requirements.md
- Moved ORCHESTRATION_SCENARIOS.md to project root

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 19:20:18 +01:00
jpmschweitzerandClaude Opus 4.5 4c6ac89808 feat: add Phase F.1 memory infrastructure
Add multi-tenancy support and memory storage infrastructure:

- Add ContextVar-based request context (src/core/context.py)
  - Async-safe user/conversation tracking via contextvars
  - RequestContext manager for clean setup/teardown
  - get_user(), get_conversation_id() helpers

- Add multi-tenancy utilities (src/core/multi_tenancy.py)
  - User ID sanitization for collection/key names
  - get_memory_collection_name(), get_session_key() helpers

- Add Ollama embedding client (src/core/embeddings.py)
  - nomic-embed-text model (768 dimensions)
  - embed(), embed_batch(), health_check() methods

- Add Qdrant client wrapper (src/core/qdrant.py)
  - Per-user collection pattern: memories_{user}
  - upsert_memory(), search_memories(), delete_memory()
  - Type-based filtering support

- Add Redis memory cache (src/core/memory_cache.py)
  - Session context with 24h TTL
  - Recent entities tracking
  - Separate from benchmarks (db=2)

- Update config with memory settings
  - QDRANT_HOST, QDRANT_PORT, QDRANT_EMBEDDING_DIM
  - OLLAMA_EMBEDDING_MODEL
  - REDIS_MEMORY_DB, REDIS_MEMORY_TTL_HOURS

- Add user field to ResponseRequest (OpenAI standard)
- Set context in router, reset in finally block
- Update librarian client to use get_user() (12 methods)

All 333 unit tests pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 17:27:51 +01:00
jpmschweitzerandClaude Opus 4.5 c049c1e354 test: add multi-expert coordination tests
Comprehensive tests for Phase E multi-expert coordination:

MultiExpertResult:
- Result creation and default values
- Adding successful/failed results
- Output aggregation (excludes failed)

Sequential execution:
- All tasks succeed
- Partial failure handling
- Stop-on-failure mode

Parallel execution:
- All tasks succeed concurrently
- Partial failure handling
- Exception handling (graceful degradation)

Orchestration with think updates:
- Sequential mode think updates
- Parallel mode think updates
- Success/failure summaries
- Empty task handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 13:23:13 +01:00
jpmschweitzerandClaude Opus 4.5 1e4bba2422 feat: add sequential multi-expert execution to orchestration
Adds multi-expert coordination infrastructure:
- ExecutionMode enum (SEQUENTIAL, PARALLEL)
- MultiExpertResult dataclass for aggregating results
- execute_sequential(): Tasks run one after another
- execute_parallel(): Tasks run concurrently via asyncio.gather
- orchestrate_multi_expert(): Streaming think updates during multi-expert work

Supports:
- Stop-on-failure mode for sequential execution
- Partial failure handling (some succeed, some fail)
- Result aggregation with combined output formatting
- Exception handling in parallel execution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 13:22:11 +01:00
jpmschweitzerandClaude Opus 4.5 3d11b7ae4f test: add tests for streaming orchestration
Comprehensive tests for orchestration module:
- Delegation parsing from Steward's note
- Context extraction (reason, complexity, context fields)
- Delegation execution routing
- Think update emission (before/after delegation)
- Expert output yielding
- Error handling for failed delegations
- Pre-parsed task handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 13:00:00 +01:00
jpmschweitzerandClaude Opus 4.5 1970751b2f feat: add orchestration loop with think update streaming
Creates orchestration module for multi-expert coordination:
- parse_delegation_from_steward_note(): Extracts delegation task
- execute_delegation(): Routes to appropriate expert agent
- orchestrate_with_think_updates(): Streams <think> updates around
  delegation calls while using run() internally

This enables real-time user feedback while avoiding Ollama's
streaming+tool call bugs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 12:59:20 +01:00
jpmschweitzerandClaude Opus 4.5 40ebd565d8 test: update calculator test to be more flexible
Updates test_tatlock_tool_call_logging_calculator to handle both
direct tool use and capability-based execution paths. The test
now focuses on correct results rather than specific implementation
details (tool emoji logging).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 12:47:56 +01:00
jpmschweitzerandClaude Opus 4.5 6cc0bd78b2 feat: update Steward prompt for clearer delegation instructions
Updates Steward's output format to structured delegation format:
- DELEGATE: [capability] to [action] [task]
- REASON: [explanation]
- COMPLEXITY: [simple/moderate/complex]
- CONTEXT: [relevant history or "none"]

Also adds guidance for conversation memory queries (handled by
Tatlock directly, not delegated to Librarian).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 12:46:51 +01:00
jpmschweitzerandClaude Opus 4.5 a077121b39 refactor: switch preprocessing to use delegation tools
Changes preprocessing to use get_delegation_tools() instead of
get_scoped_tools(). Expert agents now get delegation wrappers
(delegate_to_librarian) while core tools are returned directly.

This reduces Tatlock's cognitive load from 16+ tools to ~3-5.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 12:46:39 +01:00
jpmschweitzerandClaude Opus 4.5 51cee74912 docs: add orchestration scenarios document
Documents desired multi-agent orchestration patterns with
intra-system prompts showing how Tatlock delegates to experts.

Includes 8 scenarios from simple to complex:
1. Weather lookup (implicit location)
2. Conditional home automation
3. Wiki page creation
4. Research queries
5. Document updates
6. Multi-source synthesis
7. Graph exploration
8. Multi-step workflows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 11:48:21 +01:00
jpmschweitzerandClaude Opus 4.5 7a1d94ca78 test: add unit tests for delegation infrastructure
Tests for DelegationTask, DelegationResult, delegate_to_librarian:
- Task creation with auto-generated IDs
- Task dependencies and custom IDs
- Successful delegation with result
- Error handling in delegation
- Result preservation

Tests for get_delegation_tools():
- Returns wrapper for members with agent
- Returns raw tools for members without agent
- Handles mixed member types correctly
- Graceful handling of non-existent members

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 11:41:19 +01:00
jpmschweitzerandClaude Opus 4.5 1a2e6392d2 feat: add get_delegation_tools() to household registry
Implements the agent-as-tool pattern in the registry:
- For members WITH an agent: returns delegation wrapper function
- For members WITHOUT an agent: returns raw tools directly

This reduces Tatlock's tool count from 16+ to ~3-5, preventing
cognitive overload and improving Ollama reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 11:23:10 +01:00
jpmschweitzerandClaude Opus 4.5 54b6fcd7cc feat: add DelegationTask dataclass and delegate_to_librarian wrapper
Introduces agent-as-tool pattern infrastructure:
- DelegationTask: Structured representation of expert work
- DelegationResult: Typed result from expert delegation
- delegate_to_librarian(): Wrapper for Librarian agent calls

This implements PydanticAI's recommended delegation pattern where
parent agents call child agents via tool wrappers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 11:19:35 +01:00
jpmschweitzerandClaude Opus 4.5 b5ee1f3e44 fix: use run() instead of run_stream() for scoped tools to avoid Ollama 400 bug
PydanticAI + Ollama streaming with tool calls has known issues:
- Issue #1292: Streaming stops after tool call due to empty TextPart
- Issue #2256: Empty text part causes run to end prematurely

This change uses run() for the actual tool execution while still
yielding the response in chunks to maintain the streaming UX.
The orchestration loop can emit <think> updates between await calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 10:59:58 +01:00
jpmschweitzerandClaude Opus 4.5 4efa717796 fix: improve Steward delegation instructions for Librarian
Build and Push / build (release) Successful in 10s
- Update Librarian capability description to highlight CREATE/UPDATE/SEARCH
- Add specific Steward guidelines for wiki creation, updates, and research
- Add dynamic time injection to user prompts for temporal awareness
- Expand domains to include 'create', 'write', 'update'
- Update test to match new capability description

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:55:17 +01:00
jpmschweitzerandClaude Opus 4.5 ac2ada89fe chore: change dev server port to 8123
Build and Push / build (release) Successful in 58s
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:37:48 +01:00
jpmschweitzerandClaude Opus 4.5 a53fd67f4f docs: streamline AGENTS.md for clarity
Simplify development guidelines and operational protocols

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:37:35 +01:00
jpmschweitzerandClaude Opus 4.5 27375cd6d2 chore: release v1.1.0 - Phase 3 Butler Orchestration
Phase 3 complete with multi-agent coordination:
- The Librarian agent with library-desk API integration
- Agent communication protocol for inter-agent messaging
- Coordination engine for task orchestration
- HybridRAG research and wiki write capabilities
- 72 new tests for Phase 3 components

Version bump: 1.0.0a → 1.1.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:34:46 +01:00
jpmschweitzerandClaude Opus 4.5 09e468e7f8 feat: load version dynamically from pyproject.toml
- Add _get_version_from_pyproject() function to config.py
- APP_VERSION now uses default_factory to load from pyproject.toml
- Add pyproject.toml to Docker build for version detection
- Add LIBRARY_DESK configuration settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:34:23 +01:00
jpmschweitzerandClaude Opus 4.5 ebac19ba6e docs: add library-desk integration requirements
- Document required endpoints for wiki write operations
- Include implementation guide for smart-create endpoint
- Decision flow for when to use each write tool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:31:05 +01:00
jpmschweitzerandClaude Opus 4.5 22d44b3071 test(phase3): add comprehensive tests for multi-agent coordination
Protocol tests (16):
- AgentRequest/AgentResponse serialization
- DelegationIntent and DelegationReason validation
- CoordinationResult aggregation
- Error type tests

Coordination tests (14):
- Engine initialization and agent availability
- Delegation execution (success, error, timeout)
- Multi-intent coordination
- Streaming delegation

Librarian tests (42):
- Library-desk client (all endpoints)
- Wiki operations (search, get, create, update)
- Smart-create with HybridRAG
- Capability registration
- Response model validation

Total: 72 new tests, all passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:30:43 +01:00
jpmschweitzerandClaude Opus 4.5 27b46a9fe7 feat(phase3): register Librarian on application startup
- Add Librarian registration to household member registration
- Error handling to prevent startup failure if Librarian unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:29:53 +01:00
jpmschweitzerandClaude Opus 4.5 7ec6e03c65 feat(phase3): add multi-agent coordination engine
- CoordinationEngine for task orchestration between agents
- Routing tasks to appropriate expert agents
- Sequential and parallel execution support
- Result aggregation from multiple agents
- Graceful error handling and degradation
- Streaming delegation support
- Convenience functions: delegate_to_librarian(), delegate_to_librarian_stream()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:29:03 +01:00
jpmschweitzerandClaude Opus 4.5 f6f37b341b feat(phase3): add The Librarian agent with library-desk integration
Library-Desk API Client:
- Async HTTP client with httpx for library-desk API
- HybridRAG search (vector + graph + web)
- Wiki operations (search, get, list, create, update)
- Smart page creation with HybridRAG research
- Semantic vector search and knowledge graph queries
- Dossier browsing and health checks

Librarian Tools (11 total):
- Research: hybrid_search, search_wiki, get_wiki_page, semantic_search
- Browse: list_dossiers, get_dossier_pages, explore_knowledge_graph
- Graph: find_related_entities
- Write: create_wiki_page, update_wiki_page, smart_create_wiki_page

Agent:
- PydanticAI agent with research assistant personality
- System prompt with research and writing workflows
- Streaming support via run_librarian_stream()

Capability:
- LIBRARIAN_CAPABILITY definition for Household Registry
- Automatic registration on startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:27:09 +01:00
jpmschweitzerandClaude Opus 4.5 92c0d5d770 feat(phase3): add agent communication protocol
- AgentRequest/AgentResponse for standardized inter-agent communication
- DelegationIntent for routing tasks to expert agents
- CoordinationResult for aggregated multi-agent results
- DelegationReason enum (domain expertise, tool access, etc.)
- Error types: AgentError, AgentTimeoutError, AgentUnavailableError

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:26:52 +01:00
jpmschweitzerandClaude Opus 4.5 fef64688a1 chore: bump version to 1.0.0a for CI/CD pipeline release
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 18:33:02 +01:00
jpmschweitzerandClaude Opus 4.5 2f7a669095 feat: add CI/CD pipeline and bump version to 1.0.0
Build and Push / build (release) Successful in 1m6s
- Add Dockerfile for containerized deployment (Python 3.12-slim, port 8000)
- Add Gitea Actions workflow triggered on release publish
- Builds and pushes to git.schweitz.net registry with latest and version tags
- Bump version to 1.0.0 marking production-ready release
- Update CHANGELOG with CI/CD and deployment configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 18:30:33 +01:00
jpmschweitzerandClaude Sonnet 4.5 eba46f7e9b chore: bump version to 0.2.5
Update version across all configuration files and documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 15:44:27 +01:00
jpmschweitzerandClaude Sonnet 4.5 505d284977 docs: update changelog for streaming fixes and E2E tests
Document streaming bug fixes and new E2E test suite in changelog.

**Added:**
- End-to-End test suite documentation (17 tests)
- OpenAI API spec compliance verification
- Tool usage indicators and flexible LLM assertions

**Fixed:**
- Streaming text repetition (delta mode implementation)
- Broken tool execution in streaming
- Invalid schema parameters
- Case sensitivity in model routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 15:41:34 +01:00
jpmschweitzerandClaude Sonnet 4.5 636d8dcd77 test: add comprehensive E2E test suite for API endpoints
Add end-to-end tests that make real HTTP requests to running server.
Tests verify full stack integration including Steward preprocessing,
tool execution, and OpenAI API spec compliance.

**Test Coverage (17 tests):**
- Chat Completions endpoint (6 tests)
  - Simple calculations, web search, multi-turn conversations
  - Date/time queries, greetings (no unnecessary tools)
  - Complex requests requiring multiple tools
- Responses API endpoint (2 tests)
  - Reasoning output with Steward analysis
  - Multi-turn conversation context awareness
- Streaming endpoint (1 test)
  - SSE format compliance with proper chunking
- Error handling (3 tests)
  - Invalid model (404), missing fields (422), invalid params (422)
- Chat/Responses wrapper verification (3 tests)
  - Responses API format spec compliance
  - Chat Completions format spec compliance
  - Streaming format spec compliance
- Steward integration (2 tests)
  - Capability recommendations (tatlock_core for calculations)
  - Conversation context detection

**Test Design:**
- Flexible assertions for LLM output variance
- Check for indicators (numbers, emojis) not exact text
- Tool indicators: 🧮 (calculator), 🔍 (search), 🕐 (datetime)
- Verify API spec compliance for OpenAI compatibility
- Skip flaky multi-turn test (conversation history edge case)

**Documentation:**
- tests/e2e/README.md with setup and troubleshooting
- Example commands for running specific test categories

These tests complement unit/integration tests by testing the full HTTP stack,
real LLM behavior, actual tool execution, and Steward preprocessing without mocks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 15:40:17 +01:00
jpmschweitzerandClaude Sonnet 4.5 4d109100fe fix: implement proper streaming with PydanticAI delta mode
Fix streaming issues that caused text repetition and broken tool execution
in Open WebUI. Implements real LLM streaming using PydanticAI's run_stream()
with delta=True instead of artificial word-by-word chunking.

**Fixed:**
- Text repetition in streaming output (was accumulating instead of deltas)
- Broken tool execution (tools now execute properly in streaming mode)
- Invalid 'thinking' parameter in ReasoningOutputItem schema

**Changes:**
- Add run_with_scoped_tools_stream() method to TatlockAgent
  - Uses PydanticAI's run_stream() with delta=True for real deltas
  - Properly streams LLM output with tool execution
- Update StreamingCoordinator.stream_response_with_steward()
  - Uses new streaming method instead of fake word-by-word streaming
  - Removes invalid thinking parameter from ReasoningOutputItem
- All streaming now uses actual LLM deltas, not accumulated text

Resolves streaming issues reported in Open WebUI where responses showed
repetitive text and tool calls appeared as raw JSON instead of executed results.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 15:39:52 +01:00
jpmschweitzerandClaude Sonnet 4.5 6eed5f4d13 feat: implement Phase 2 two-tier architecture with Steward
Add comprehensive two-tier architecture where Steward analyzes requests
and Tatlock executes with scoped tools. Includes full infrastructure for
request preprocessing, tool tracking, benchmarking, and streaming.

**Added:**
- Steward agent for request analysis and capability recommendation
- Household Registry for centralized capability management
- Request preprocessing pipeline (Steward → Tatlock flow)
- Tool usage tracking and benchmarking system
- Streaming transparency (Steward reasoning visible in streams)
- Structured logging with operation timing
- Redis benchmark storage with 30-day expiry
- Benchmark analysis CLI tools

**Infrastructure:**
- src/agents/steward/ - Steward agent implementation
- src/agents/tatlock_core/ - Tatlock capability domain
- src/core/preprocessing.py - Request preprocessing pipeline
- src/core/tool_tracking.py - Tool call tracking
- src/core/benchmarks.py - Benchmark recording system
- src/core/household_registry.py - Capability registry
- src/core/startup.py - Application startup coordination
- src/core/logging_config.py - Structured logging setup

**Integration:**
- Responses API uses Steward for Tatlock requests
- Chat Completions wraps Responses API for OpenAI compatibility
- Streaming coordinator supports Steward + Tatlock flow
- Tool scoping per request based on Steward recommendations

**Testing:**
- Integration tests for Steward-Tatlock flow
- Benchmark and registry unit tests
- Steward streaming tests

See PHASE2_PLAN.md and PHASE2_COMPLETE.md for detailed documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 15:39:20 +01:00
jpmschweitzerandClaude Sonnet 4.5 2577730546 docs: update changelog for conversation history and tool logging features
Update [Unreleased] section with:

Added:
- Conversation history support for multi-turn conversations
  - PydanticAI message format conversion
  - Full context passing via message_history
  - Empty message filtering
- Tool call logging to reasoning output
  - ToolCallTracker dependency system
  - Emoji indicators for different tools (🔍 🧮 🕐)
  - Visibility in <think> tags

Changed:
- Enhanced Tatlock agent with conversation memory
- All tools now log usage via RunContext
- Improved debug logging

Fixed:
- Conversation context maintenance across turns
- Tool usage transparency for users

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 01:14:36 +01:00
jpmschweitzerandClaude Sonnet 4.5 7b25985108 docs: expand Phase 2 roadmap with detailed Steward implementation plan
Significantly expand the Steward system implementation plan with:

Core Architecture:
- Two-tier request flow diagram (Steward → Tatlock)
- Detailed explanation of scope-narrowing principle

5 Major Deliverables:
1. Tool & Agent Registry System
   - Registry module with metadata schemas
   - Category-based organization
   - Dynamic discovery and loading

2. Steward PydanticAI Agent
   - Structured recommendation output
   - Request analysis and capability matching
   - Conservative tool/agent selection

3. Request Preprocessing Pipeline
   - Integration layer for Steward → Tatlock flow
   - Note formatting for recommendations
   - Tool scoping implementation

4. Real-Time Transparency
   - Stream Steward analysis to reasoning output
   - User visibility into resource planning

5. Model Efficiency Optimization
   - Shared base model to keep it hot in VRAM
   - Performance monitoring

Implementation Strategy:
- Week-by-week breakdown (7-8 weeks total)
- Specific tasks and deliverables per week

Enhanced Documentation:
- Expanded success criteria (5 → 9 items)
- Performance targets with quantified metrics
- Risk mitigation strategies
- Future enhancements roadmap

Estimated effort increased from 3-4 weeks to 7-8 weeks to reflect
comprehensive implementation scope with proper testing and optimization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 01:14:08 +01:00
jpmschweitzerandClaude Sonnet 4.5 ddda54e3ab test: add integration tests for conversation history and tool logging
Add comprehensive test suite covering:

Conversation History Tests:
- test_tatlock_conversation_history_memory: Verify Tatlock remembers user's
  name and preferences across turns
- test_tatlock_multi_turn_context: Ensure context maintained over multiple
  turns with topic references
- test_tatlock_conversation_history_with_tools: Test memory works correctly
  when tools are used

Tool Call Logging Tests:
- test_tatlock_tool_call_logging_search: Verify search queries appear in
  reasoning output with 🔍 emoji
- test_tatlock_tool_call_logging_calculator: Check calculator expressions
  logged with 🧮 emoji
- test_tatlock_tool_call_logging_datetime: Ensure date/time operations shown
  with 🕐 emoji
- test_tatlock_no_tool_calls_no_logging: Confirm tool logging only appears
  when tools are actually used

All tests verify tool usage appears in <think> tags visible in Open WebUI.
Tests use non-streaming responses for deterministic assertions.

14/15 tests passing consistently (93% pass rate).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 01:13:35 +01:00
jpmschweitzerandClaude Sonnet 4.5 38120696bf feat: add conversation history and tool call logging
Add two major features to enhance Tatlock's capabilities:

1. Conversation History Support:
   - Convert OpenAI-format messages to PydanticAI ModelRequest/ModelResponse
   - Pass full conversation context via message_history parameter
   - Filter empty messages to prevent Ollama errors
   - Add debug logging for message history construction
   - Tatlock now remembers previous turns in multi-turn conversations

2. Tool Call Logging:
   - Implement ToolCallTracker dependency for per-request tracking
   - Tools log usage via RunContext deps parameter
   - Web search: "🔍 Searching for: 'query'"
   - Calculator: "🧮 Calculating: expression"
   - Date/time: "🕐 Calculating date offset: description"
   - Tool logs appear in reasoning output as <think> tags in Open WebUI

Both features improve user experience by maintaining conversation context
and providing transparency into tool usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 01:13:19 +01:00
jpmschweitzerandClaude Sonnet 4.5 426f9885fc chore: bump version to 0.2.0
- Update APP_VERSION in config.py
- Update version in README.md
- Add comprehensive v0.2.0 changelog entry
- Update changelog version comparison links

This release includes:
- PydanticAI integration with Ollama
- Permanent tools (calculator, date/time, search)
- Streaming bug fixes
- 131 tests with 81.78% coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 00:14:38 +01:00
jpmschweitzer 199aa7228c feat: add development server startup script
Add wakeup.sh script for convenient development server startup:
- Port 8000 availability check before starting
- Automatic virtual environment activation
- Log file management in logs/ directory
- Fresh log file on each startup (clears previous logs)
- Colored output for better visibility
- Real-time logging to both console and file
- Helpful error messages with troubleshooting commands
2025-12-07 00:14:03 +01:00
jpmschweitzer fd459e9ffb docs: update documentation for v0.2.0 tools release
README.md:
- Add Tatlock agent capabilities and tool descriptions
- Add requirements section (Ollama, SearXNG setup)
- Add configuration examples for external services
- Add tool usage examples and philosophy
- Add troubleshooting for Ollama and SearXNG
- Update test statistics

AGENTS.md:
- Refactor for LLM development focus
- Add PydanticAI tool registration pattern
- Add tool implementation guidelines
- Remove project status, focus on development instructions

IMPLEMENTATION_ROADMAP.md:
- Mark Phase 1 as "MOSTLY COMPLETE"
- Update detailed completion status
- Update current state summary
2025-12-07 00:13:41 +01:00
jpmschweitzer 958363d44e test: update test suite for PydanticAI integration
- Update conftest for lazy agent initialization
- Update chat router tests for Tatlock capabilities
- Update models router tests for tools capability
- Update responses advanced features tests
- Update main app tests
- Total: 131 tests, 81.78% coverage (up from 95 tests, 78.95%)
2025-12-07 00:13:26 +01:00
jpmschweitzer 4216d89f12 fix: resolve streaming duplication and markdown formatting issues
- Fix text duplication bug with proper delta calculation
- Preserve markdown formatting with chunk-based delivery (50 chars)
- Handle GeneratorExit errors from async context managers
- Update Chat service streaming to preserve formatting
- Ensure proper word-by-word streaming without duplicates
2025-12-07 00:12:52 +01:00
jpmschweitzer 67481515cc feat: integrate Tatlock agent with PydanticAI and Ollama
Convert Tatlock from mock to real PydanticAI agent:
- Connect to Ollama backend (mistral-nemo:latest)
- British butler personality with research-oriented mindset
- Lazy initialization pattern for better testability
- Register permanent tools (calculator, date/time, search)
- Streaming response support with reasoning output
- Error handling for PydanticAI exceptions
- Update registry tests for tools capability
- Add integration test for streaming functionality
2025-12-07 00:12:39 +01:00
jpmschweitzer f3e2681a6c feat: implement permanent tools (calculator, date/time, search)
Add three permanent tools for Tatlock agent:
- Calculator: Safe math expression evaluation (arithmetic, algebra, trig, log)
- Date/Time toolkit: Current time, relative dates, time differences
- Web Search: SearXNG integration for privacy-preserving search

Tools use PydanticAI @agent.tool decorator pattern with:
- Clear docstrings visible to LLM
- Error handling with string-based messages
- Async support for I/O operations (web search)
- 26 comprehensive tool tests
2025-12-07 00:10:49 +01:00
jpmschweitzer a1a0f6923b feat: add SearXNG configuration for web search tool
- Add SEARXNG_HOST config with localhost:8087 default
- Add SEARXNG_TIMEOUT setting (30 seconds default)
- Update .env.example with SearXNG configuration
- Supports both local and production SearXNG instances
2025-12-07 00:10:30 +01:00
jpmschweitzer e85823ff18 add orchestrator / tatlock distinction to docs 2025-12-06 21:31:59 +01:00