This commit is contained in:
team3
2026-07-23 11:54:31 +02:00
parent f07ef9653d
commit 09f9ea74a6
18 changed files with 364 additions and 85 deletions

View File

@@ -29,7 +29,7 @@ import httpx
from config import (MAX_CONCURRENT_AGENTS, MAX_CONCURRENT_AGENTS_PER_TOPIC,
MAX_CONCURRENT_API_AGENTS, OPENCODE_CONFIG, PROVIDERS,
RAM_MIN_FREE_PCT, resolve_role)
RAM_MIN_FREE_PCT, fake_agents_aktiv, resolve_role)
log = logging.getLogger("planer.agents")
@@ -270,7 +270,7 @@ async def run_agent(
"""Ein LLM-Call der Rolle `role`. → (rc, stdout, stderr). Wirft AgentInfraError,
wenn die Infrastruktur nicht nutzbar ist (Rolle unkonfiguriert, Provider down,
leere Antwort ohne Session) — der Lauf soll dann pausieren, nicht raten."""
if os.getenv("PLANER_FAKE_AGENTS"): # Sekunden-Smoke: deterministisch statt LLM
if fake_agents_aktiv(): # Sekunden-Smoke: deterministisch statt LLM
import fake_agents
start = time.monotonic()
res = await fake_agents.respond(agent_key, prompt, capabilities)
@@ -514,7 +514,10 @@ async def _run_text_api(agent_key: str, prompt: str, timeout: int, model: str,
"messages": [{"role": "user", "content": prompt}],
**_api_model_opts(model),
}
headers = {"x-api-key": os.environ.get("MINIMAX_API_KEY", ""), "anthropic-version": _API_VERSION}
api_key = os.environ.get("MINIMAX_API_KEY")
if not api_key:
raise AgentInfraError("MINIMAX_API_KEY fehlt — in .env setzen")
headers = {"x-api-key": api_key, "anthropic-version": _API_VERSION}
track_key = agent_key
n = 2
while track_key in _active_api: