4 Commits

Author SHA1 Message Date
54d639c13a Merge pull request 'feat: upgrade fast-agent-mcp to 0.7.22, add Fable 5 / Opus 4.8 Mantle wire names' (#4) from feat/fast-agent-0.7.22 into main
Reviewed-on: #4
2026-07-25 10:46:59 +00:00
b38d4b1c69 feat: upgrade fast-agent-mcp to 0.7.22, add Fable 5 / Opus 4.8 Mantle wire names
Bumps the runtime from 0.7.15 to 0.7.22 (last 0.7.x release). All five
monkey-patched surfaces (MCPAgentClientSession.send_request/call_tool,
MCPAggregator._execute_on_server/_create_session_factory/call_tool),
ToolRunnerHooks, and both AnthropicConverter private methods patched by
mantle_shims were verified unchanged in signature at 0.7.22.

Adds claude-opus-4-8 and claude-fable-5 to MANTLE_WIRE_NAMES; both are
natively known to fast-agent's ModelDatabase as of 0.7.17+ (1M context).

58/58 tests pass; server/patch modules import cleanly on 0.7.22.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 06:34:12 -04:00
9193b6d385 Merge pull request 'feat: deployment-level no_shell policy (agents.yaml no_shell: true)' (#3) from feat/no-shell-config into main
Reviewed-on: #3
2026-07-17 22:43:03 +00:00
4809d781ff feat: deployment-level no_shell policy (agents.yaml no_shell: true)
fast-agent auto-activates its shell execute tool on any agent with
skills configured, and Context.no_shell — the only opt-out — has no
constructor or config knob. Add install_no_shell(), a wrapper on
fast_agent.context.initialize_context that stamps no_shell=True on
every context, installed from server.main() when the deployment's
agents.yaml sets a truthy top-level no_shell: key. Skill loading via
read_skill is unaffected. Default behaviour unchanged for deployments
without the key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 14:03:23 -04:00
4 changed files with 45 additions and 2 deletions

View File

@@ -474,3 +474,36 @@ def install() -> None:
_patch_create_session_factory()
_patch_aggregator_call_tool()
def install_no_shell() -> None:
"""Disable fast-agent's shell runtime for every agent in this process.
fast-agent auto-activates its ``execute`` shell tool on any agent that
has skills configured (``MCPAgent._ensure_shell_runtime_for_skills``);
the only opt-out is ``Context.no_shell``, which fast-agent's own CLI
sets by direct assignment but which has no ``FastAgent``-constructor or
config-file knob. The context is created inside ``run()`` before agents
are constructed, so we wrap ``initialize_context`` to stamp the flag on
every context it returns. Skill loading itself is unaffected — the
``read_skill`` tool registers independently of the shell.
NOT installed by ``install()``: this is deployment policy, not a runtime
fix. ``server.main()`` calls it when the deployment's ``agents.yaml``
sets a truthy top-level ``no_shell:`` key.
"""
from fast_agent import context as _fa_context
if getattr(_fa_context.initialize_context, "_pallas_no_shell_patched", False):
return
_original_initialize_context = _fa_context.initialize_context
async def _initialize_context_no_shell(*args: Any, **kwargs: Any):
ctx = await _original_initialize_context(*args, **kwargs)
ctx.no_shell = True
return ctx
_initialize_context_no_shell._pallas_no_shell_patched = True # type: ignore[attr-defined]
_fa_context.initialize_context = _initialize_context_no_shell
logger.info("no_shell patch installed — agents will not get the shell tool")

View File

@@ -42,6 +42,8 @@ logger = logging.getLogger(__name__)
MANTLE_WIRE_NAMES: dict[str, str] = {
"claude-haiku-4-5": "anthropic.claude-haiku-4-5",
"claude-opus-4-7": "anthropic.claude-opus-4-7",
"claude-opus-4-8": "anthropic.claude-opus-4-8",
"claude-fable-5": "anthropic.claude-fable-5",
}

View File

@@ -18,6 +18,7 @@ from pathlib import Path
import yaml
from pallas import _fastagent_patch
from pallas.log import set_agent_component, set_project, setup_logging
from pallas.multimodal_server import MultimodalAgentMCPServer
@@ -390,6 +391,13 @@ def main() -> None:
setup_logging()
# Team-level policy: a truthy top-level ``no_shell:`` in agents.yaml
# keeps fast-agent's shell tool off every agent in this deployment
# (it otherwise auto-activates on agents with skills configured).
# After setup_logging() so the install log record isn't lost.
if config.get("no_shell"):
_fastagent_patch.install_no_shell()
if args.agent:
port = agents[args.agent]["port"]
logger.info("Starting %s agent on port %d", args.agent, port)

View File

@@ -1,10 +1,10 @@
[project]
name = "pallas-mcp"
version = "0.5.1"
version = "0.6.0"
description = "FastAgent MCP Bridge — generic runtime for serving FastAgent agents over StreamableHTTP"
requires-python = ">=3.13.5"
dependencies = [
"fast-agent-mcp==0.7.15",
"fast-agent-mcp==0.7.22",
"httpx",
"prometheus-client",
"pyyaml",