mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-27 00:02:21 +01:00
Preserve owner-scoped compaction and the web-only routing boundary
This commit is contained in:
+13
-10
@@ -25430,16 +25430,19 @@ async def stream_agent_loop(
|
|||||||
if schema.get("function", {}).get("name") not in disabled_tools
|
if schema.get("function", {}).get("name") not in disabled_tools
|
||||||
and schema.get("name") not in disabled_tools
|
and schema.get("name") not in disabled_tools
|
||||||
]
|
]
|
||||||
if _pure_web_turn and tool_surface != "full" and not (route_state.get("spec_surface") and os.getenv("ODYSSEUS_SPEC_MODE", "strict").strip().lower() == "strict"):
|
if _pure_web_turn and tool_surface != "full":
|
||||||
allowed = _web_only_route_tools(_last_user, disabled_tools)
|
strict_spec = (route_state.get("spec_surface") and
|
||||||
schemas = [
|
os.getenv("ODYSSEUS_SPEC_MODE", "strict").strip().lower() == "strict")
|
||||||
schema for schema in schemas
|
if not strict_spec:
|
||||||
if (
|
allowed = _web_only_route_tools(_last_user, disabled_tools)
|
||||||
schema.get("function", {}).get("name")
|
schemas = [
|
||||||
or schema.get("name")
|
schema for schema in schemas
|
||||||
) in allowed
|
if (
|
||||||
or schema.get("function", {}).get("name") in external_names
|
schema.get("function", {}).get("name")
|
||||||
]
|
or schema.get("name")
|
||||||
|
) in allowed
|
||||||
|
or schema.get("function", {}).get("name") in external_names
|
||||||
|
]
|
||||||
schemas = _drop_legacy_email_alias_schemas_when_mcp_available(schemas)
|
schemas = _drop_legacy_email_alias_schemas_when_mcp_available(schemas)
|
||||||
schemas = _apply_tool_surface_to_schemas(schemas, tool_surface)
|
schemas = _apply_tool_surface_to_schemas(schemas, tool_surface)
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -634,8 +634,16 @@ async def maybe_compact(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Use utility model if configured, otherwise fall back to session model
|
# Use utility model if configured, otherwise fall back to session model
|
||||||
# Compact with the chat model itself (the one being evaluated), never a separate utility model.
|
util_url, util_model, util_headers = resolve_endpoint(
|
||||||
compact_url, compact_model, compact_headers = endpoint_url, model, headers
|
"utility",
|
||||||
|
fallback_url=endpoint_url,
|
||||||
|
fallback_model=model,
|
||||||
|
fallback_headers=headers,
|
||||||
|
owner=owner,
|
||||||
|
)
|
||||||
|
compact_url = util_url or endpoint_url
|
||||||
|
compact_model = util_model or model
|
||||||
|
compact_headers = util_headers if util_url else headers
|
||||||
|
|
||||||
prompt = SELF_SUMMARY_SYSTEM_PROMPT.replace(
|
prompt = SELF_SUMMARY_SYSTEM_PROMPT.replace(
|
||||||
"{count}", str(len(older))
|
"{count}", str(len(older))
|
||||||
|
|||||||
Reference in New Issue
Block a user