mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-06 13:12:27 +01:00
Preserve owner-scoped compaction and the web-only routing boundary
This commit is contained in:
+4
-1
@@ -25430,7 +25430,10 @@ 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":
|
||||||
|
strict_spec = (route_state.get("spec_surface") and
|
||||||
|
os.getenv("ODYSSEUS_SPEC_MODE", "strict").strip().lower() == "strict")
|
||||||
|
if not strict_spec:
|
||||||
allowed = _web_only_route_tools(_last_user, disabled_tools)
|
allowed = _web_only_route_tools(_last_user, disabled_tools)
|
||||||
schemas = [
|
schemas = [
|
||||||
schema for schema in schemas
|
schema for schema in schemas
|
||||||
|
|||||||
@@ -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