0.9.4 polishing

frdel committed Aug 7, 2025 at 22:41 UTC 04a50df6fcb7aac7108ee0d3033dc210e3409d87
6 files changed +57 -61
python/helpers/fasta2a_server.py
+23 -4
@@ -351,6 +351,21 @@ class DynamicA2AProxy:
351 })
352 return
353
354 + from python.helpers import settings
355 + cfg = settings.get_settings()
356 + if not cfg["a2a_server_enabled"]:
357 + response = b'HTTP/1.1 403 Forbidden\r\n\r\nA2A server is disabled'
358 + await send({
359 + 'type': 'http.response.start',
360 + 'status': 403,
361 + 'headers': [[b'content-type', b'text/plain']],
362 + })
363 + await send({
364 + 'type': 'http.response.body',
365 + 'body': response,
366 + })
367 + return
368 +
369 # Check if reconfiguration is needed
370 if self._reconfigure_needed:
371 try:
@@ -410,11 +425,15 @@ class DynamicA2AProxy:
425 path = path[4:] # Remove '/a2a' prefix
426
427 # Check if path matches token pattern /t-{token}/
413 - if path.startswith('/t-') and '/' in path[3:]:
428 + if path.startswith('/t-'):
429 # Extract token from path
415 - path_parts = path[3:].split('/', 1) # Remove '/t-' prefix
416 - request_token = path_parts[0]
417 - remaining_path = '/' + path_parts[1] if len(path_parts) > 1 else '/'
430 + if '/' in path[3:]:
431 + path_parts = path[3:].split('/', 1) # Remove '/t-' prefix
432 + request_token = path_parts[0]
433 + remaining_path = '/' + path_parts[1] if len(path_parts) > 1 else '/'
434 + else:
435 + request_token = path[3:]
436 + remaining_path = '/'
437
438 # Validate token
439 cfg = settings.get_settings()
python/helpers/settings.py
+31 -24
@@ -97,6 +97,9 @@ class Settings(TypedDict):
97 mcp_server_enabled: bool
98 mcp_server_token: str
99
100 + a2a_server_enabled: bool
101 +
102 +
103
104 class PartialSettings(Settings, total=False):
105 pass
@@ -532,25 +535,6 @@ def convert_out(settings: Settings) -> SettingsOutput:
535 }
536 )
537
535 - # -------- A2A Section --------
536 - a2a_fields: list[SettingsField] = [
537 - {
538 - "id": "show_a2a_connection",
539 - "title": "Show A2A connection info",
540 - "description": "Display the URL (including token) other agents can use to connect via FastA2A.",
541 - "type": "button",
542 - "value": "Show",
543 - }
544 - ]
545 -
546 - a2a_section: SettingsSection = {
547 - "id": "a2a_server",
548 - "title": "A2A Connection",
549 - "description": "Share this connection string with other agents.",
550 - "fields": a2a_fields,
551 - "tab": "external",
552 - }
553 -
538 if runtime.is_dockerized():
539 auth_fields.append(
540 {
@@ -1055,7 +1039,7 @@ def convert_out(settings: Settings) -> SettingsOutput:
1039 {
1040 "id": "mcp_server_enabled",
1041 "title": "Enable A0 MCP Server",
1058 - "description": "Expose Agent Zero as an SSE MCP server. This will make this A0 instance available to MCP clients.",
1042 + "description": "Expose Agent Zero as an SSE/HTTP MCP server. This will make this A0 instance available to MCP clients.",
1043 "type": "switch",
1044 "value": settings["mcp_server_enabled"],
1045 }
@@ -1080,6 +1064,28 @@ def convert_out(settings: Settings) -> SettingsOutput:
1064 "tab": "mcp",
1065 }
1066
1067 + # -------- A2A Section --------
1068 + a2a_fields: list[SettingsField] = []
1069 +
1070 + a2a_fields.append(
1071 + {
1072 + "id": "a2a_server_enabled",
1073 + "title": "Enable A2A server",
1074 + "description": "Expose Agent Zero as A2A server. This allows other agents to connect to A0 via A2A protocol.",
1075 + "type": "switch",
1076 + "value": settings["a2a_server_enabled"],
1077 + }
1078 + )
1079 +
1080 + a2a_section: SettingsSection = {
1081 + "id": "a2a_server",
1082 + "title": "A0 A2A Server",
1083 + "description": "Agent Zero can be exposed as an A2A server. See <a href=\"javascript:openModal('settings/a2a/a2a-connection.html')\">connection example</a>.",
1084 + "fields": a2a_fields,
1085 + "tab": "mcp",
1086 + }
1087 +
1088 +
1089 # External API section
1090 external_api_fields: list[SettingsField] = []
1091
@@ -1148,9 +1154,9 @@ def convert_out(settings: Settings) -> SettingsOutput:
1154 speech_section,
1155 api_keys_section,
1156 auth_section,
1151 - a2a_section,
1157 mcp_client_section,
1158 mcp_server_section,
1159 + a2a_section,
1160 external_api_section,
1161 backup_section,
1162 dev_section,
@@ -1302,7 +1308,7 @@ def get_default_settings() -> Settings:
1308 return Settings(
1309 version=_get_version(),
1310 chat_model_provider="openrouter",
1305 - chat_model_name="openai/gpt-4.1",
1311 + chat_model_name="openai/gpt-5",
1312 chat_model_api_base="",
1313 chat_model_kwargs={"temperature": "0"},
1314 chat_model_ctx_length=100000,
@@ -1312,7 +1318,7 @@ def get_default_settings() -> Settings:
1318 chat_model_rl_input=0,
1319 chat_model_rl_output=0,
1320 util_model_provider="openrouter",
1315 - util_model_name="openai/gpt-4.1-mini",
1321 + util_model_name="openai/gpt-5-mini",
1322 util_model_api_base="",
1323 util_model_ctx_length=100000,
1324 util_model_ctx_input=0.7,
@@ -1327,7 +1333,7 @@ def get_default_settings() -> Settings:
1333 embed_model_rl_requests=0,
1334 embed_model_rl_input=0,
1335 browser_model_provider="openrouter",
1330 - browser_model_name="openai/gpt-4.1",
1336 + browser_model_name="openai/gpt-5",
1337 browser_model_api_base="",
1338 browser_model_vision=True,
1339 browser_model_rl_requests=0,
@@ -1370,6 +1376,7 @@ def get_default_settings() -> Settings:
1376 mcp_client_tool_timeout=120,
1377 mcp_server_enabled=False,
1378 mcp_server_token=create_auth_token(),
1379 + a2a_server_enabled=False,
1380 )
1381
1382
webui/components/settings/a2a/a2a-connection.html renamed
webui/index.html
+1 -1
@@ -551,7 +551,7 @@
551 <div class="settings-tab"
552 :class="{'active': activeTab === 'mcp'}"
553 @click="switchTab('mcp')"
554 - title="MCP">MCP</div>
554 + title="MCP">MCP/A2A</div>
555 <div class="settings-tab"
556 :class="{'active': activeTab === 'developer'}"
557 @click="switchTab('developer')"
webui/public/a2a_server.svg
+1 -4
@@ -1,4 +1 @@
1 -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2 - <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72"/>
3 - <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72"/>
4 -</svg>
1 +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M280-146q-72 0-123-51t-51-123q0-55 30-98.5t78-62.5v31q-35 18-57.5 53T134-320q0 60 43 103t103 43q60 0 103-43t43-103v-14h210q5-14 17-23t27-9q19 0 32.5 13.5T726-320q0 19-13.5 32.5T680-274q-16 0-27.5-8.5T636-306H454q-8 75-59.5 117.5T280-146Zm400 0q-38 0-71.5-15.5T548-206h41q17 14 41 23t50 9q60 0 103-43t43-103q0-60-43-103t-103-43q-17 0-31.5 3.5T620-453L511-635q-21 5-39-8.5T454-680q0-19 13.5-32.5T500-726q19 0 32.5 13.5T546-680q0 8-3 16t-8 13l97 163q11-2 22.5-4t25.5-2q72 0 123 51t51 123q0 72-51 123t-123 51ZM280-274q-19 0-32.5-13.5T234-320q0-20 15.5-35t41.5-10l105-175q-35-26-52.5-62.5T326-680q0-72 51-123t123-51q72 0 123 51t51 123h-28q0-60-43-103t-103-43q-60 0-103 43t-43 103q0 42 21 75.5t59 55.5L315-350q5 6 8 14t3 16q0 19-13.5 32.5T280-274Z"/></svg>
\ No newline at end of file
webui/public/external_api.svg
+1 -28
@@ -1,28 +1 @@
1 -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
2 - <g fill="none" stroke="#000" stroke-width="0.8" stroke-miterlimit="10">
3 - <!-- Central hub node -->
4 - <circle cx="10" cy="10" r="2.5"/>
5 -
6 - <!-- External connection nodes -->
7 - <circle cx="3" cy="3" r="1.5"/>
8 - <circle cx="17" cy="3" r="1.5"/>
9 - <circle cx="3" cy="17" r="1.5"/>
10 - <circle cx="17" cy="17" r="1.5"/>
11 -
12 - <!-- Connection lines -->
13 - <line x1="5.1" y1="4.9" x2="7.9" y2="7.1"/>
14 - <line x1="14.9" y1="4.9" x2="12.1" y2="7.1"/>
15 - <line x1="5.1" y1="15.1" x2="7.9" y2="12.9"/>
16 - <line x1="14.9" y1="15.1" x2="12.1" y2="12.9"/>
17 -
18 - <!-- API endpoints indicators -->
19 - <rect x="1" y="7" width="1" height="6" rx="0.5"/>
20 - <rect x="18" y="7" width="1" height="6" rx="0.5"/>
21 - <rect x="7" y="1" width="6" height="1" rx="0.5"/>
22 - <rect x="7" y="18" width="6" height="1" rx="0.5"/>
23 -
24 - <!-- Data flow arrows -->
25 - <path d="M6 8.5 L7.5 9.5 L6 10.5" fill="none" stroke-width="0.6"/>
26 - <path d="M14 9.5 L12.5 8.5 L14 7.5" fill="none" stroke-width="0.6"/>
27 - </g>
28 -</svg>
1 +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M240.12-66Q201-66 173.5-93.38q-27.5-27.38-27.5-66.5 0-39.12 27.43-66.62 27.42-27.5 66.6-27.5 10.97 0 23.97 3.5 13 3.5 24 9.5l115-143q-20-21-27-46t-2-51l-170-56q-12 23-34.29 37-22.28 14-49.71 14-39.17 0-66.58-27.38Q26-540.76 26-579.88 26-619 53.38-646.5q27.38-27.5 66.5-27.5 39.12 0 66.62 27.42Q214-619.17 214-580q0 6-.5 9t-.5 6l169 59q11-22 32.5-39t51.5-22v-180q-38-6-59-33.5t-21-59.91q0-38.59 27.38-66.09t66.5-27.5q39.12 0 66.62 27.42Q574-879.17 574-840q0 32-21 59.5T494-747v180q30 5 51 22t33 39l169-59q-1-4-1-6.5v-8.5q0-39.17 27.38-66.58Q800.76-674 839.88-674q39.12 0 66.62 27.38 27.5 27.38 27.5 66.5 0 39.12-27.42 66.62Q879.17-486 840-486q-27.11 0-49.55-14Q768-514 756-537l-170 56q5 26-2 51t-27 45l115 143q11-5 24-8.5t23.97-3.5q39.18 0 66.6 27.38Q814-199.24 814-160.12q0 39.12-27.38 66.62Q759.24-66 720.12-66 681-66 653.5-93.42 626-120.83 626-160q0-17.19 5.5-33.1Q637-209 651-223L536-368q-23 16-55.5 16T424-368L309-223q13 14 19 29.9 6 15.91 6 33.1 0 39.17-27.38 66.58Q279.24-66 240.12-66ZM120-514q27 0 46.5-19.5T186-580q0-27-19.5-46.5T120-646q-27 0-46.5 19.5T54-580q0 27 19.5 46.5T120-514ZM240-94q27 0 46.5-19.5T306-160q0-27-19.5-46.5T240-226q-27 0-46.5 19.5T174-160q0 27 19.5 46.5T240-94Zm240-680q27 0 46.5-19.5T546-840q0-27-19.5-46.5T480-906q-27 0-46.5 19.5T414-840q0 27 19.5 46.5T480-774Zm0 394q33 0 56.5-23.5T560-460q0-33-23.5-56.5T480-540q-33 0-56.5 23.5T400-460q0 33 23.5 56.5T480-380ZM720-94q27 0 46.5-19.5T786-160q0-27-19.5-46.5T720-226q-27 0-46.5 19.5T654-160q0 27 19.5 46.5T720-94Zm120-420q27 0 46.5-19.5T906-580q0-27-19.5-46.5T840-646q-27 0-46.5 19.5T774-580q0 27 19.5 46.5T840-514ZM480-840ZM120-580Zm360 120Zm360-120ZM240-160Zm480 0Z"/></svg>
\ No newline at end of file