ac4af942ab15eba20fb8404391642c64ef828d0e
The existing setup only attached the file/stderr handlers to the 'pallas' namespace, so every record emitted by fast-agent, fastmcp, the MCP SDK, Anthropic, uvicorn etc. disappeared into Rich's progress display and never hit pallas.log. When one of those libraries raised and logged 'something failed' via logger.error(..., exc_info=True), we ended up grepping a Rich-overwritten TTY for a traceback that was already long gone -- exactly the situation blocking the current Mnemosyne debug. This patch: * Extends _JSONFormatter to serialise exc_info/stack_info as a 'traceback' field when present, so Loki/grep sees the full stack. * Attaches the same file+stderr handlers to the *root* logger so every library's records (and any uncaught logger.error tracebacks) land in pallas.log with the stack attached. * Keeps the 'pallas' logger's own handlers (propagate=False) so our records are unaffected by any later root-handler manipulation. * Tags our handlers with _pallas_attached so repeated setup_logging() calls are idempotent -- important because uvicorn workers and fast-agent subagent subprocesses each reinitialise logging. httpx/httpcore stay at WARNING so we don't flood the log with per- request body traces on a DEBUG deployment. Demote third-party namespaces further in a follow-up if needed.
Pallas — FastAgent MCP Bridge
Pallas is the generic runtime that turns fast-agent agent definitions into StreamableHTTP MCP servers.
It is completely deployment-agnostic: all environment-specific values (agent names, ports, hosts, model) live in the calling project's agents.yaml and fastagent.config.yaml.
Installation
pip install git+ssh://git@git.helu.ca:22022/r/pallas.git
Or as a project dependency in pyproject.toml:
dependencies = [
"pallas-mcp @ git+ssh://git@git.helu.ca:22022/r/pallas.git",
]
Usage
Pallas reads configuration from the working directory at runtime.
my-project/
├── agents/
│ ├── __init__.py
│ └── jarvis.py # FastAgent definitions
├── agents.yaml # Deployment topology
├── fastagent.config.yaml # FastAgent + model config
└── fastagent.secrets.yaml # API keys (gitignored)
Run from your project root:
pallas # start all agents + registry
pallas --agent jarvis # start a single agent
Or via python -m:
python -m pallas.server
agents.yaml format
name: my-project # used in log prefixes and registry names
version: "1.0.0"
host: my-host.example.com # hostname for registry URLs
namespace: com.example.my-project
registry_port: 8200
agents:
jarvis:
module: agents.jarvis # importable Python module path
port: 8201
title: Jarvis
description: "My assistant agent"
depends_on: [research] # optional: start these first
research:
module: agents.research
port: 8250
title: Research Agent
description: "Web search and knowledge graph"
fastagent.config.yaml extensions
Pallas reads two extra keys beyond the standard fast-agent config:
default_model: openai.my-custom-model-name
# Explicit capability declarations — avoids brittle name-regex heuristics
model_capabilities:
vision: false
context_window: 200000
max_output_tokens: 32000
Capabilities are published in the registry and used to register unknown models
with fast-agent's ModelDatabase.
Environment variable
| Variable | Default | Purpose |
|---|---|---|
PALLAS_AGENTS_CONFIG |
agents.yaml |
Override path to deployment config |
What Pallas provides
| Module | Purpose |
|---|---|
pallas.server |
CLI entry point and agent orchestration |
pallas.registry |
GET /.well-known/mcp/server.json registry server |
pallas.multimodal_server |
MultimodalAgentMCPServer — AgentMCPServer subclass with image support |
pallas.health |
LLM preflight validation + get_health MCP tool |
Description
FastAgent MCP Bridge — generic runtime for serving FastAgent agents over StreamableHTTP
Languages
Python
100%