agentram 0.1.34 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agentram/cli.py +22 -14
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/agentram/cli.py
CHANGED
|
@@ -751,10 +751,11 @@ def run_textual_tui(context: McpContext) -> bool:
|
|
|
751
751
|
def on_input_changed(self, event: Input.Changed) -> None:
|
|
752
752
|
if event.input.id != "input":
|
|
753
753
|
return
|
|
754
|
-
value = event.value
|
|
755
|
-
if value.startswith("/"):
|
|
754
|
+
value = event.value
|
|
755
|
+
if value.startswith("/") and " " not in value:
|
|
756
756
|
self.show_palette(value)
|
|
757
|
-
|
|
757
|
+
elif self.suggestions:
|
|
758
|
+
self.suggestions = []
|
|
758
759
|
self.hide_palette()
|
|
759
760
|
|
|
760
761
|
def action_accept_suggestion(self) -> None:
|
|
@@ -1344,10 +1345,8 @@ def supervisor_workflow_text(context: McpContext, prompt: str) -> str:
|
|
|
1344
1345
|
]
|
|
1345
1346
|
)
|
|
1346
1347
|
|
|
1347
|
-
def
|
|
1348
|
-
|
|
1349
|
-
max_retries = max(0, min(5, int(os.getenv("AGENTRAM_MAIN_MAX_RETRIES", "1"))))
|
|
1350
|
-
return max_steps, max_retries
|
|
1348
|
+
def main_loop_retry_limit() -> int:
|
|
1349
|
+
return max(0, min(5, int(os.getenv("AGENTRAM_MAIN_MAX_RETRIES", "1"))))
|
|
1351
1350
|
|
|
1352
1351
|
def run_main_agent_loop(
|
|
1353
1352
|
context: McpContext,
|
|
@@ -1363,14 +1362,16 @@ def run_main_agent_loop(
|
|
|
1363
1362
|
outputs["small"] = small_agent_observe(context, small_agent, prompt, "main_result", outputs["main"], plan, memory_context)
|
|
1364
1363
|
return {"outputs": outputs, "steps": 0, "status": "no_main", "retries": 0}
|
|
1365
1364
|
|
|
1366
|
-
|
|
1365
|
+
max_retries = main_loop_retry_limit()
|
|
1367
1366
|
retries = 0
|
|
1368
|
-
status = "
|
|
1367
|
+
status = "running"
|
|
1368
|
+
step = 0
|
|
1369
1369
|
previous_main_outputs: list[str] = []
|
|
1370
1370
|
small_notes: list[str] = []
|
|
1371
1371
|
|
|
1372
|
-
|
|
1373
|
-
|
|
1372
|
+
while True:
|
|
1373
|
+
step += 1
|
|
1374
|
+
step_prompt = build_main_loop_prompt(prompt, plan, memory_context, previous_main_outputs, small_notes, step)
|
|
1374
1375
|
try:
|
|
1375
1376
|
main_output = call_agent_endpoint(main_agent, step_prompt)
|
|
1376
1377
|
except Exception as error: # noqa: BLE001 - agent boundary
|
|
@@ -1407,14 +1408,17 @@ def build_main_loop_prompt(
|
|
|
1407
1408
|
previous_main_outputs: list[str],
|
|
1408
1409
|
small_notes: list[str],
|
|
1409
1410
|
step: int,
|
|
1410
|
-
max_steps: int,
|
|
1411
1411
|
) -> str:
|
|
1412
1412
|
history = "\n\n".join([*previous_main_outputs[-3:], *small_notes[-3:]]) or "-"
|
|
1413
1413
|
return "\n".join(
|
|
1414
1414
|
[
|
|
1415
|
-
f"AgentRAM main loop step {step}
|
|
1416
|
-
"
|
|
1415
|
+
f"AgentRAM main loop step {step}.",
|
|
1416
|
+
"No hard step limit. Continue until user goal is complete or blocked.",
|
|
1417
|
+
"Do not stop early if unfinished work remains. Do not invent completion.",
|
|
1417
1418
|
"If complete, include DONE. If blocked, include BLOCKER and reason.",
|
|
1419
|
+
"Main agent may use normal coding-agent tools, including git read operations such as status/diff when useful.",
|
|
1420
|
+
"Before destructive git actions or commits, ask user approval explicitly.",
|
|
1421
|
+
"If file changes require user approval, request approval before editing.",
|
|
1418
1422
|
"User request:",
|
|
1419
1423
|
prompt,
|
|
1420
1424
|
"Supervisor / execution plan:",
|
|
@@ -1719,6 +1723,10 @@ def model_error_hint(message: str) -> str:
|
|
|
1719
1723
|
return message + " | Fix: start your OpenAI-compatible server at base_url, or change --base-url."
|
|
1720
1724
|
if "http 403" in lower or "403" in lower and "groq" in lower:
|
|
1721
1725
|
return message + " | Fix: Groq rejected auth/model. Rotate/check API key, ensure provider=openai-compatible, base_url=https://api.groq.com/openai/v1, and use a Groq-supported model name."
|
|
1726
|
+
if "http 500" in lower and "fetch failed" in lower:
|
|
1727
|
+
return message + " | Fix: local OpenAI-compatible proxy failed to fetch upstream model. Check proxy logs, upstream API key, provider route, model name, and network. AgentRAM request reached your local server."
|
|
1728
|
+
if "http 500" in lower:
|
|
1729
|
+
return message + " | Fix: local/provider server crashed or failed upstream. Check server logs, model route, API key, and provider health."
|
|
1722
1730
|
if "http 404" in lower or "404: not found" in lower:
|
|
1723
1731
|
return message + " | Fix: verify base_url includes /v1, provider supports /chat/completions, and model name exists."
|
|
1724
1732
|
if "http 400" in lower and "not supported" in lower:
|
package/package.json
CHANGED