Skip to content

Agent Zero AI framework

fix: OpenRouter header format, pipx install, code exec output truncation, and model config UI improvements

frdela7bfc7798bf1
diff --git a/conf/model_providers.yaml b/conf/model_providers.yaml
index 7eba45619..b64c080b9 100644
--- a/conf/model_providers.yaml
+++ b/conf/model_providers.yaml
@@ -124,9 +124,7 @@ chat:
extra_headers:
"HTTP-Referer": "https://agent-zero.ai/"
"X-Title": "Agent Zero"
- "X-OpenRouter-Categories":
- - personal-agent
- - cloud-agent
+ "X-OpenRouter-Categories": "personal-agent,cloud-agent"
sambanova:
name: Sambanova
litellm_provider: sambanova
diff --git a/docker/base/fs/ins/install_python.sh b/docker/base/fs/ins/install_python.sh
index 417395ebc..71c9513ef 100644
--- a/docker/base/fs/ins/install_python.sh
+++ b/docker/base/fs/ins/install_python.sh
@@ -55,7 +55,7 @@ pyenv install 3.12.4
source /opt/venv-a0/bin/activate
# upgrade pip and install static packages
-pip install --no-cache-dir --upgrade pip
+pip install --no-cache-dir --upgrade pip pipx
# Install some packages in specific variants
pip install --no-cache-dir \
diff --git a/plugins/_code_execution/tools/code_execution_tool.py b/plugins/_code_execution/tools/code_execution_tool.py
index ed16caea5..da4f000f4 100644
--- a/plugins/_code_execution/tools/code_execution_tool.py
+++ b/plugins/_code_execution/tools/code_execution_tool.py
@@ -265,8 +265,10 @@ class CodeExecution(Tool):
)
last_lines.reverse()
for idx, line in enumerate(last_lines):
+ line = line.strip()
+ line = line if len(line) <= 500 else line[:250] + line[-250:]
for pat in prompt_patterns:
- if pat.search(line.strip()):
+ if pat.search(line):
PrintStyle.info(
"Detected shell prompt, returning output early."
)
diff --git a/plugins/_model_config/webui/models-summary.html b/plugins/_model_config/webui/models-summary.html
index ed051076f..4284d73c7 100644
--- a/plugins/_model_config/webui/models-summary.html
+++ b/plugins/_model_config/webui/models-summary.html
@@ -1,4 +1,5 @@
<html>
+
<head>
<title>Model Configuration</title>
</head>
@@ -9,79 +10,77 @@
</script>
<div x-data>
- <template x-if="$store.modelConfig">
- <div>
- <div class="section-title">Model Configuration</div>
- <div class="section-description">
- Model settings are managed through the Model Configuration plugin, supporting per-project and per-agent overrides.
- </div>
-
- <div style="display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;">
- <button class="btn btn-field" @click="(async () => {
- const pluginMeta = { name: '_model_config', always_enabled: true, per_project_config: true, per_agent_config: true, has_config_screen: true };
- if ($store.pluginToggle?.open) await $store.pluginToggle.open(pluginMeta);
- await $store.pluginSettingsPrototype.open('_model_config', { perProjectConfig: true, perAgentConfig: true });
- openModal('components/plugins/plugin-settings.html');
- })()">
- Configure Models
- </button>
- <button class="btn btn-field" @click="openModal('/plugins/_model_config/webui/api-keys.html')">
- Manage API Keys
- </button>
- </div>
-
- <!-- Read-only model config summary -->
- <div x-data="{ loading: true, models: [] }"
- x-init="
+ <template x-if="$store.modelConfig">
+ <div>
+ <div class="section-title">Model Configuration</div>
+ <div class="section-description">
+ AI models can be configured globally, per project, per agent and using quick-switch presets as well.
+ </div>
+
+ <!-- Read-only model config summary -->
+ <div x-data="{ loading: true, models: [] }" x-init="
models = await $store.modelConfig.loadModelsSummary().catch(() => []);
loading = false;
- "
- class="model-summary">
- <div class="model-summary-header">
- <div class="field-title">Current Models</div>
- <div class="field-description">Active model configuration resolved from global, project, and agent profile scopes.</div>
- </div>
- <div x-show="loading" style="text-align:center; padding:12px;">
- <span class="material-symbols-outlined spinning" style="font-size:18px;">progress_activity</span>
- </div>
- <template x-if="!loading && models.length">
- <div class="model-summary-grid">
- <template x-for="m in models" :key="m.title">
- <div class="model-summary-row">
- <span class="material-symbols-outlined model-summary-icon" x-text="m.icon"></span>
- <span class="model-summary-label" x-text="m.title"></span>
- <span class="model-summary-value">
- <span x-text="m.provider" style="opacity:0.6;"></span>
- <span style="opacity:0.3; margin:0 4px;">/</span>
- <span x-text="m.name"></span>
- </span>
+ " class="model-summary">
+ <div class="model-summary-header">
+ <div class="field-title">Current Models</div>
+ <div class="field-description">Active model configuration resolved from global, project, and agent profile
+ scopes.</div>
+ </div>
+ <div x-show="loading" style="text-align:center; padding:12px;">
+ <span class="material-symbols-outlined spinning" style="font-size:18px;">progress_activity</span>
+ </div>
+ <template x-if="!loading && models.length">
+ <div class="model-summary-grid">
+ <template x-for="m in models" :key="m.title">
+ <div class="model-summary-row">
+ <span class="material-symbols-outlined model-summary-icon" x-text="m.icon"></span>
+ <span class="model-summary-label" x-text="m.title"></span>
+ <span class="model-summary-value">
+ <span x-text="m.provider" style="opacity:0.6;"></span>
+ <span style="opacity:0.3; margin:0 4px;">/</span>
+ <span x-text="m.name"></span>
+ </span>
+ </div>
+ </template>
</div>
</template>
</div>
- </template>
- </div>
- </div>
- </template>
+
+ <div style="display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;">
+ <button class="btn btn-field" @click="$store.pluginListStore.openPluginConfig('_model_config')">
+ Configure Models
+ </button>
+ <button class="btn btn-field" @click="openModal('/plugins/_model_config/webui/api-keys.html')">
+ Manage API Keys
+ </button>
+ </div>
+
+ </div>
+ </template>
</div>
<style>
.model-summary {
margin-top: 14px;
}
+
.model-summary-header {
margin-bottom: 8px;
}
+
.model-summary-grid {
display: flex;
flex-direction: column;
background: var(--color-input);
- border: 1px solid var(--color-border);
- border-radius: 8px;
- padding: 0.75em 1em;
+ /* border: 1px solid var(--color-border);
+ border-radius: 8px; */
+ /* padding: 0.75em 1em; */
max-width: 100%;
overflow: hidden;
box-sizing: border-box;
}
+
.model-summary-row {
display: flex;
align-items: center;
@@ -90,20 +89,24 @@
font-size: 0.82rem;
min-width: 0;
}
+
.model-summary-row:not(:last-child) {
border-bottom: 1px solid var(--color-border);
}
+
.model-summary-icon {
font-size: 16px;
opacity: 0.45;
flex-shrink: 0;
}
+
.model-summary-label {
width: 80px;
flex-shrink: 0;
font-weight: 500;
opacity: 0.7;
}
+
.model-summary-value {
flex: 1;
min-width: 0;
@@ -111,18 +114,22 @@
text-overflow: ellipsis;
white-space: nowrap;
}
+
@media (max-width: 600px) {
.model-summary-grid {
padding: 0.5em 0.5em;
}
+
.model-summary-row {
flex-wrap: wrap;
padding: 8px 8px;
gap: 4px;
}
+
.model-summary-label {
width: auto;
}
+
.model-summary-value {
width: 100%;
flex-basis: 100%;
@@ -134,4 +141,5 @@
}
</style>
</body>
-</html>
+
+</html>
\ No newline at end of file