jpmschweitzerandClaude 3e495daa73 fix(webber-api): clear mypy, and the dead code it was covering for
55 errors to zero. Nearly all of them traced back to two causes rather than 55.

THE DECORATOR. @logged wraps ~24 functions across this package and was declared
`def decorator(func: Callable):` with no ParamSpec and no return annotation, so
it erased the signature of everything it touched. ToolResult.execute() is
annotated `-> ToolResult`; through the decorator it came back Any, and mypy
reported 33 no-any-return errors spread across the tools and agents. Each looked
like a local annotation slip. All of them were one decorator. Typed with
ParamSpec/TypeVar; the async branch casts at the await rather than loosening R,
because loosening R would put the Any straight back into every caller.

THE MISSING TYPE PARAMETER. BaseAgent was not generic, so _create_agent returned
a bare Agent — Agent[Any, Any] — and pydantic_ai then typed every run() result
as Any. BaseAgent is now Generic[CtxT] bound to AgentContext, _agent is declared
on the base instead of reached through hasattr, and the three tool-registration
functions take their agent's real context type. tools_streaming.py already did
this; the other three had not been updated.

Eight `execute` overrides carry a targeted ignore rather than a package-wide
disable_error_code. Every tool narrows the base's **kwargs to its own named
parameters, which is a real LSP violation — but nothing anywhere is typed as
BaseTool, and every call site constructs the concrete tool. The abstract method
earns its place by making a tool without execute impossible to instantiate. The
reasoning lives in BaseTool.execute's docstring; the per-site suppressions mean
an override that IS unsound still gets caught.

BaseAgent.run_stream widened to AsyncIterator[str | StreamEvent], which is what
callers already receive: task streams structured events, explore and plan stream
strings, and the router branches on isinstance with a comment calling the string
path legacy. The annotation now says what the code does.

AND THE PART THAT MATTERS MORE THAN THE TYPES.

Chasing the last error found that the Ollama sanitiser has been broken. It
fetched the parent's chat getter with `AsyncOpenAI.chat.fget`, and openai made
`chat` a functools.cached_property, whose getter is `.func`. Touching `.chat`
raised AttributeError — meaning the content: null workaround that CLAUDE.md
documents as live would have failed on the first completion any agent attempted.
Confirmed in the running container (openai 2.46.0) as well as locally (2.15.0).

Two things hid it. The line carried a bare `# type: ignore`, which suppressed
precisely the complaint that would have caught it. And /agents/run and
/agents/stream have served zero requests in 30 days, so nothing exercised the
path. A mitigation can rot completely while every check stays green, if no check
actually runs it.

The lookup now reads whichever getter the descriptor exposes and raises a
legible TypeError if openai adopts a third shape. tests/test_ollama_provider.py
walks the chain an agent request walks, short of the network call —
mutation-checked: all four fail against the old lookup.

215 passed, 23 skipped, plus the four new. mypy clean over 90 files.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 16:27:51 +02:00
2026-01-15 07:54:33 +01:00
2026-01-15 07:54:33 +01:00

Webber - Multi-Agent AI Development System

A Claude Code-inspired development assistant powered by local LLMs via Ollama.

Features

  • 3 Agents - Explore (read-only), Plan (architecture), Task (orchestrator)
  • 8 Tools - File read/write/edit, glob, grep, bash, web search
  • Conversations - Multi-turn memory with context summarization
  • Streaming - Real-time response display
  • Self-hosted - Runs on your own hardware with Ollama

Structure

This is a monorepo containing three subprojects:

Directory Description
webber-api/ FastAPI backend server with agent orchestration
webber-cli/ Command-line client for interacting with the API
webber-sandbox/ Test project for functional testing

Additional Directories

Directory Description
sandbox-templates/ Reusable project templates for the sandbox
.gitea/workflows/ CI/CD workflows for releases

Quick Start

1. Start the API Server

cd webber-api
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
./wakeup.sh

2. Set Up the CLI

cd webber-cli
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .

# Test connection
webber-cli status

3. Explore with Webber

# One-shot exploration
webber-cli explore "find all bugs in the code" -d /path/to/project

# Interactive chat
webber-cli chat -d /path/to/project

Available Tools

Tool Description
read_file Read file contents with line numbers
glob_files Find files by pattern
grep_content Search file contents with regex
bash_readonly Safe bash commands (ls, git status, etc.)
edit_file Find-and-replace editing
write_file Create/overwrite files
bash Full bash with safety controls
web_search Search web via SearXNG

Agents

Agent Purpose Tools
Explore Fast codebase navigation, search Read-only (glob, grep, read, bash_readonly)
Plan Design implementation strategies Read-only (same as Explore)
Task Autonomous multi-step execution All tools + spawn_agent

API Endpoints

# Stateless agent execution
POST /agents/run          # Execute agent, get response
POST /agents/stream       # Execute with SSE streaming
GET  /agents/             # List available agents

# Stateful conversations (multi-turn memory)
POST /conversations/              # Create conversation
GET  /conversations/              # List conversations
POST /conversations/{id}/messages # Add message, get agent response

Versioning

This project uses prefixed tags for independent release cycles:

  • api/v0.4.0 - Triggers API Docker build and deployment
  • cli/v0.1.0 - Triggers CLI installer build (future)

Requirements

  • Python 3.12+
  • Ollama running with gemma4:e2b model
  • Docker (for production deployment)
  • SearXNG (optional, for web search)

Documentation

  • CLAUDE.md - Agent development guidelines (repo-wide)
  • webber-api/docs/COVERAGE.md - Feature coverage and roadmap
  • webber-api/docs/architecture.md - System architecture
  • webber-cli/README.md - CLI usage guide

License

MIT

S
Description
Mrs. Webber
Readme
522 KiB
2026-08-11 16:30:09 +02:00
Languages
Python 97%
Shell 2%
Makefile 0.9%
Dockerfile 0.1%