Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(remote-access): close workbench auth seams

Max496c086f77a0
diff --git a/core/show_session_events.py b/core/show_session_events.py
index 179537aad..4be7d7aad 100644
--- a/core/show_session_events.py
+++ b/core/show_session_events.py
@@ -64,6 +64,7 @@ SHOW_EVENT_ERROR_I18N_KEYS = {
"event_id_conflict": "show.event.idConflict",
"show_event_dispatch_failed": "show.event.dispatchFailed",
"show_event_dispatch_pending": "show.event.acceptanceUnknown",
+ "unsupported_event_type": "show.event.unsupportedEventType",
}
SHOW_TRIGGER_KIND = {
"human.annotation.created": "show_annotation",
diff --git a/storage/messages_service.py b/storage/messages_service.py
index aff79961b..5f93896d1 100644
--- a/storage/messages_service.py
+++ b/storage/messages_service.py
@@ -14,7 +14,7 @@ import re
import time
import uuid
from datetime import datetime, timezone
-from typing import Any, Iterable, Optional
+from typing import Any, Iterable, Mapping, Optional
from sqlalchemy import and_, case, delete, func, or_, select, update
from sqlalchemy.engine import Connection
@@ -34,6 +34,7 @@ from storage.models import (
)
from storage.pagination import PageRequest, PageResult, page_result_from_limit_plus_one
from storage.sessions_service import session_agent_display_label
+from vibe.authorization import AuthorizationContext, require_instance_role
from vibe.message_identity import HARNESS_TYPE, INPUT_TURN_AUTHOR_TYPES, NOTIFY_TYPE, VAULT_TYPE
from vibe.message_types import types_with
@@ -156,7 +157,10 @@ def _native_harness_provenance(native_message_id: Any) -> tuple[str | None, str
def _attach_harness_provenance(
- conn: Connection, payloads: list[dict[str, Any]]
+ conn: Connection,
+ payloads: list[dict[str, Any]],
+ *,
+ authorization_context: AuthorizationContext | Mapping[str, Any] | None = None,
) -> list[dict[str, Any]]:
"""Read-side provenance for every durable Harness chat message.
@@ -188,6 +192,7 @@ def _attach_harness_provenance(
exec_by_msg[payload["id"]] = native_id[len(_AGENT_RUN_NATIVE_PREFIX):]
if not exec_by_msg:
return payloads
+ context = require_instance_role(authorization_context, "viewer")
# execution_id == agent_runs.id. The source SESSION differs by run kind:
# - source_kind='agent' → source_actor IS the caller session id.
@@ -257,9 +262,12 @@ def _attach_harness_provenance(
meta_by_session: dict[str, dict[str, Optional[str]]] = {}
if source_by_exec:
+ from storage import project_access_service
+
for row in conn.execute(
select(
agent_sessions.c.id,
+ agent_sessions.c.scope_id,
agent_sessions.c.title,
agent_sessions.c.agent_name,
agent_sessions.c.agent_backend,
@@ -278,11 +286,20 @@ def _attach_harness_provenance(
),
),
)
- )
+ )
.where(
agent_sessions.c.id.in_(set(source_by_exec.values()))
)
).mappings():
+ project_id = project_access_service.project_id_from_scope_id(row["scope_id"])
+ if (
+ not context.is_instance_owner
+ and (
+ project_id is None
+ or not project_access_service.can_read_project(conn, context, project_id)
+ )
+ ):
+ continue
meta_by_session[row["id"]] = {
"title": row["title"],
"agent_name": session_agent_display_label(row),
@@ -777,6 +794,7 @@ def list_session_messages(
limit: int = 50,
types: Optional[Iterable[str]] = None,
include_private_metadata: bool = False,
+ authorization_context: AuthorizationContext | Mapping[str, Any] | None = None,
tail: bool = False,
) -> dict[str, Any]:
"""Return messages for one session in chronological order with cursor pagination.
@@ -933,7 +951,11 @@ def list_session_messages(
has_newer = len(newer) > effective_limit
newer = newer[:effective_limit]
- merged = _attach_harness_provenance(conn, older + anchor_rows + newer)
+ merged = _attach_harness_provenance(
+ conn,
+ older + anchor_rows + newer,
+ authorization_context=authorization_context,
+ )
return {
"messages": merged,
"next_after_id": newer[-1]["id"] if has_newer and newer else None,
@@ -954,6 +976,7 @@ def list_session_messages(
)
for row in conn.execute(query).mappings().all()
],
+ authorization_context=authorization_context,
)
has_older = len(rows) > effective_limit
rows = rows[:effective_limit]
@@ -986,6 +1009,7 @@ def list_session_messages(
)
for row in conn.execute(query).mappings().all()
],
+ authorization_context=authorization_context,
)
has_older = len(rows) > effective_limit
rows = rows[:effective_limit]
@@ -1019,6 +1043,7 @@ def list_session_messages(
)
for row in conn.execute(query).mappings().all()
],
+ authorization_context=authorization_context,
)
# Probe one extra row against the clamped page size: a full page alone does
# not prove there is another page, but the extra row does.
diff --git a/tests/test_instance_authorization.py b/tests/test_instance_authorization.py
index bd3422e15..85b106c61 100644
--- a/tests/test_instance_authorization.py
+++ b/tests/test_instance_authorization.py
@@ -240,6 +240,7 @@ def test_remote_http_policy_defaults_local_machine_and_unknown_routes_to_local_o
("POST", "/api/memory/runtime/restart", REMOTE_HTTP_LOCAL_ONLY),
("POST", "/api/memory/clear", REMOTE_HTTP_LOCAL_ONLY),
("GET", "/api/projects/proj-1/agents-md", REMOTE_HTTP_LOCAL_ONLY),
+ ("POST", "/api/projects", REMOTE_HTTP_LOCAL_ONLY),
("GET", "/show/ses-1/", REMOTE_HTTP_ALLOWED),
("POST", "/show/ses-1/__show/events", REMOTE_HTTP_ALLOWED),
("POST", "/api/config", REMOTE_HTTP_PAYLOAD_FILTERED),
diff --git a/tests/test_messages_service.py b/tests/test_messages_service.py
index 580ec2c14..07616adaa 100644
--- a/tests/test_messages_service.py
+++ b/tests/test_messages_service.py
@@ -13,12 +13,14 @@ from sqlalchemy import select
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from storage import project_access_service
from storage import message_deliveries, messages_service
from storage.db import create_sqlite_engine
from storage.importer import ensure_sqlite_state
from storage.models import agent_runs, agent_sessions, messages, scopes, vault_requests
from storage.pagination import PageRequest
from storage.settings_service import upsert_scope
+from vibe.authorization import AuthorizationContext
from vibe.message_identity import HARNESS_TYPE
@@ -340,6 +342,98 @@ def test_agent_run_provenance_skips_missing_source_session(isolated_state):
assert "source_session_id" not in by_id["msg_ghost"]
+def test_agent_run_provenance_hides_inaccessible_source_session(isolated_state):
+ engine = create_sqlite_engine()
+ with engine.begin() as conn:
+ target_scope = upsert_scope(
+ conn,
+ platform="avibe",
+ scope_type="project",
+ native_id="proj_visible",
+ now="2026-08-04T00:00:00Z",
+ )
+ hidden_scope = upsert_scope(
+ conn,
+ platform="avibe",
+ scope_type="project",
+ native_id="proj_hidden",
+ now="2026-08-04T00:00:00Z",
+ )
+ project_access_service.apply_project_access_intent(
+ conn,
+ {
+ "project_id": "proj_visible",
+ "revision": 1,
+ "mode": "restricted",
+ "bindings": [
+ {
+ "principal_kind": "email",
+ "principal_value": "[email protected]",
+ "access_role": "viewer",
+ }
+ ],
+ },
+ )
+ project_access_service.apply_project_access_intent(
+ conn,
+ {
+ "project_id": "proj_hidden",
+ "revision": 1,
+ "mode": "restricted",
+ "bindings": [],
+ },
+ )
+ _seed_session(conn, target_scope, "ses_target")
+ _seed_titled_agent_session(
+ conn,
+ hidden_scope,
+ "ses_hidden_source",
+ title="Hidden Source",
+ agent_name="pm",
+ )
+ _insert_agent_run(
+ conn,
+ "execHidden",
+ session_id="ses_target",
+ source_kind="agent",
+ source_actor="ses_hidden_source",
+ )
+ _insert_harness_msg(
+ conn,
+ target_scope,
+ "ses_target",
+ author_name="agent_run",
+ native_message_id="agent_run:execHidden",
+ msg_id="msg_hidden",
+ created_at="2026-08-04T00:00:01Z",
+ )
+
+ remote_editor = AuthorizationContext(
+ instance_role="editor",
+ is_remote=True,
+ )
+ with engine.connect() as conn:
+ remote_result = messages_service.list_session_messages(
+ conn,
+ session_id="ses_target",
+ authorization_context=remote_editor,
+ )
+ local_result = messages_service.list_session_messages(
+ conn,
+ session_id="ses_target",
+ )
+
+ remote_message = next(row for row in remote_result["messages"] if row["id"] == "msg_hidden")
+ assert "source_session_id" not in remote_message
+ assert "source_session_title" not in remote_message
+ assert "source_session_agent_name" not in remote_message
+
+ local_message = next(row for row in local_result["messages"] if row["id"] == "msg_hidden")
+ assert local_message["source_session_id"] == "ses_hidden_source"
+ assert local_message["source_session_title"] == "Hidden Source"
+
+
def test_vault_callback_message_provenance_enrichment(isolated_state):
engine = create_sqlite_engine()
with engine.begin() as conn:
diff --git a/tests/test_show_session_events.py b/tests/test_show_session_events.py
index d3d9f8c93..44c122123 100644
--- a/tests/test_show_session_events.py
+++ b/tests/test_show_session_events.py
@@ -1545,11 +1545,14 @@ def test_localized_show_event_errors_follow_configured_language(
conflict = localized_show_event_error("event_id_conflict")
pending = localized_show_event_error("show_event_dispatch_pending")
+ unsupported = localized_show_event_error("unsupported_event_type")
assert conflict.code == "event_id_conflict"
assert str(conflict) == "此 Show 事件 ID 已绑定到不同的事件内容。"
assert pending.code == "show_event_dispatch_pending"
assert str(pending) == "Show 事件可能仍在处理中,未在本地重复提交。"
+ assert unsupported.code == "unsupported_event_type"
+ assert str(unsupported) == "Show Page 写入必须使用受支持的人类事件或标记解析类型。"
def test_direct_dispatching_show_event_requires_acceptance_before_visibility(isolated_state):
diff --git a/tests/test_ui_remote_access_auth.py b/tests/test_ui_remote_access_auth.py
index 94d5d1bb6..7778d389e 100644
--- a/tests/test_ui_remote_access_auth.py
+++ b/tests/test_ui_remote_access_auth.py
@@ -1214,6 +1214,7 @@ def test_remote_session_execution_settings_are_blocked_before_store_access(
@pytest.mark.parametrize(
("method", "path", "json_body"),
[
+ ("POST", "/api/projects", {"display_name": "Remote only"}),
("POST", "/api/projects", {"folder_path": "/tmp/remote-project"}),
("PATCH", "/api/projects/proj-local", {"folder_path": "/tmp/remote-project"}),
("PATCH", "/api/projects/proj-local", {"agent_name": "codex"}),
@@ -2613,6 +2614,73 @@ async def test_remote_show_write_rejects_agent_provenance_event_types(
assert _show_event_response_json(response)["code"] == "unsupported_event_type"
+async def test_show_write_unsupported_event_error_uses_request_locale(
+ monkeypatch,
+ tmp_path,
+):
+ from vibe.authorization import AuthorizationContext
+
+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
+ config = _save_config(tmp_path)
+ config.language = "zh"
+ config.save()
+ remote_context = AuthorizationContext(instance_role="editor", is_remote=True)
+
+ def unexpected_store():
+ raise AssertionError("an unsupported event must not be stored")
+
+ monkeypatch.setattr(ui_server, "_show_session_event_store", unexpected_store)
+
+ with app.test_request_context(
+ "/show/ses-remote/__show/events",
+ method="POST",
+ base_url="https://alex.avibe.bot",
+ headers={"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8"},
+ ):
+ g.authorization_context = remote_context
+ response = await ui_server._show_event_response_from_payload(
+ "ses-remote",
+ {"type": "assistant.mark.created", "actor": "agent", "payload": {}},
+ )
+
+ body = _show_event_response_json(response)
+ assert body["code"] == "unsupported_event_type"
+ assert body["message"] == "Show Page 写入必须使用受支持的人类事件或标记解析类型。"
+
+
+async def test_public_show_write_unsupported_event_error_uses_request_locale(
+ monkeypatch,
+ tmp_path,
+):
+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
+ config = _save_config(tmp_path)
+ config.language = "zh"
+ config.save()
+
+ def unexpected_store():
+ raise AssertionError("an unsupported public event must not be stored")
+
+ monkeypatch.setattr(ui_server, "_show_session_event_store", unexpected_store)
+
+ with app.test_request_context(
+ "/show/share/shr_test/__show/events",
+ method="POST",
+ base_url="https://alex.avibe.bot",
+ headers={"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8"},
+ ):
+ response = await ui_server._show_event_response_from_payload(
+ "ses-public",
+ {"type": "assistant.mark.created", "actor": "agent", "payload": {}},
+ public=True,
+ public_share_id="shr_test",
+ allow_dispatch=False,
+ )
+
+ body = _show_event_response_json(response)
+ assert body["code"] == "unsupported_event_type"
+ assert body["message"] == "Show Page 写入必须使用受支持的人类事件或标记解析类型。"
+
+
async def test_remote_show_write_accepts_human_event_and_mark_resolution(
monkeypatch,
tmp_path,
@@ -2776,6 +2844,139 @@ def test_remote_owner_can_still_read_authorized_session_history(
]
+def test_remote_editor_session_history_hides_inaccessible_source_provenance(
+ monkeypatch,
+ tmp_path,
+):
+ from storage import project_access_service, workbench_sessions_service
+ from storage.db import create_sqlite_engine
+ from storage.importer import ensure_sqlite_state
+ from storage.models import agent_runs, messages
+ from storage.settings_service import upsert_scope
+
+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
+ config = _save_config(tmp_path)
+ ensure_sqlite_state()
+ engine = create_sqlite_engine()
+ with engine.begin() as conn:
+ visible_scope = upsert_scope(
+ conn,
+ platform="avibe",
+ scope_type="project",
+ native_id="proj_visible",
+ now="2026-08-04T00:00:00Z",
+ )
+ hidden_scope = upsert_scope(
+ conn,
+ platform="avibe",
+ scope_type="project",
+ native_id="proj_hidden",
+ now="2026-08-04T00:00:00Z",
+ )
+ project_access_service.apply_project_access_intent(
+ conn,
+ {
+ "project_id": "proj_visible",
+ "revision": 1,
+ "mode": "restricted",
+ "bindings": [
+ {
+ "principal_kind": "email",
+ "principal_value": "[email protected]",
+ "access_role": "viewer",
+ }
+ ],
+ },
+ )
+ project_access_service.apply_project_access_intent(
+ conn,
+ {
+ "project_id": "proj_hidden",
+ "revision": 1,
+ "mode": "restricted",
+ "bindings": [],
+ },
+ )
+ target_session = workbench_sessions_service.create_session(
+ conn,
+ scope_id=visible_scope,
+ agent_backend="codex",
+ agent_name="worker",
+ )
+ hidden_session = workbench_sessions_service.create_session(
+ conn,
+ scope_id=hidden_scope,
+ agent_backend="codex",
+ agent_name="worker",
+ title="Hidden Source",
+ )
+ conn.execute(
+ agent_runs.insert().values(
+ id="run_cross_project",
+ run_type="agent_run",
+ status="succeeded",
+ cancel_requested=0,
+ source_kind="agent",
+ source_actor=hidden_session["id"],
+ session_id=target_session["id"],
+ created_at="2026-08-04T00:00:01Z",
+ updated_at="2026-08-04T00:00:01Z",
+ metadata_json="{}",
+ )
+ )
+ conn.execute(
+ messages.insert().values(
+ id="msg_cross_project",
+ scope_id=visible_scope,
+ session_id=target_session["id"],
+ platform="avibe",
+ author="harness",
+ type="harness",
+ source="harness",
+ author_name="agent_run",
+ native_message_id="agent_run:run_cross_project",
+ content_text="prompt",
+ content_json="{}",
+ metadata_json="{}",
+ created_at="2026-08-04T00:00:02Z",
+ updated_at="2026-08-04T00:00:02Z",
+ )
+ )
+
+ client = app.test_client()
+ client.set_cookie(
+ remote_access.SESSION_COOKIE_NAME,
+ remote_session_cookie(config, "[email protected]", "user-editor", role="editor"),
+ domain="alex.avibe.bot",
+ )
+ messages_response = client.get(
+ f"/api/sessions/{target_session['id']}/messages",
+ base_url="https://alex.avibe.bot",
+ environ_base=_remote_peer(),
+ )
+ bootstrap_response = client.get(
+ f"/api/sessions/{target_session['id']}/bootstrap",
+ base_url="https://alex.avibe.bot",
+ environ_base=_remote_peer(),
+ )
+
+ assert messages_response.status_code == 200
+ messages_payload = next(
+ row for row in messages_response.get_json()["messages"] if row["id"] == "msg_cross_project"
+ )
+ assert "source_session_id" not in messages_payload
+ assert "source_session_title" not in messages_payload
+ assert "source_session_agent_name" not in messages_payload
+
+ assert bootstrap_response.status_code == 200
+ bootstrap_payload = next(
+ row for row in bootstrap_response.get_json()["messages"] if row["id"] == "msg_cross_project"
+ )
+ assert "source_session_id" not in bootstrap_payload
+ assert "source_session_title" not in bootstrap_payload
+ assert "source_session_agent_name" not in bootstrap_payload
+
+
def test_remote_viewer_can_read_but_cannot_use_management_api(monkeypatch, tmp_path):
monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
config = _save_config(tmp_path)
@@ -2819,7 +3020,7 @@ def test_remote_viewer_can_read_but_cannot_use_management_api(monkeypatch, tmp_p
[
("viewer", 403, 403, 403, 200, 403, 403),
("editor", 200, 200, 200, 200, 400, 403),
- ("owner", 200, 200, 200, 200, 400, 400),
+ ("owner", 200, 200, 200, 200, 400, 403),
],
)
def test_remote_instance_role_route_matrix(
diff --git a/vibe/authorization.py b/vibe/authorization.py
index dd91d4ff0..222a6a6f7 100644
--- a/vibe/authorization.py
+++ b/vibe/authorization.py
@@ -357,6 +357,7 @@ _REMOTE_LOCAL_ONLY_HTTP_RULES = tuple(
"POST",
r"^/api/sessions/[^/]+/(?:messages|attachments|cancel|queue/[^/]+/send-now)$",
),
+ ("POST", r"^/api/projects$"),
("POST", r"^/api/asr/transcribe$"),
("POST", r"^/api/show/sessions/[^/]+/(?:events|prewarm)$"),
("GET", r"^/api/settings$"),
@@ -388,10 +389,7 @@ _REMOTE_LOCAL_ONLY_HTTP_RULES = tuple(
_REMOTE_PAYLOAD_FILTERED_HTTP_RULES = tuple(
(method, re.compile(pattern))
for method, pattern in (
- (
- "POST",
- r"^/api/(?:config|projects|sessions)$",
- ),
+ ("POST", r"^/api/(?:config|sessions)$"),
("PATCH", r"^/api/(?:projects|sessions)/[^/]+$"),
)
)
diff --git a/vibe/i18n/en.json b/vibe/i18n/en.json
index b6bb90092..84f5a708c 100644
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@ -16,7 +16,8 @@
"event": {
"acceptanceUnknown": "The Show event may still be processing. It was not replayed locally.",
"dispatchFailed": "The Show event was recorded, but its agent turn could not be delivered.",
- "idConflict": "This Show event ID is already bound to different event contents."
+ "idConflict": "This Show event ID is already bound to different event contents.",
+ "unsupportedEventType": "Show Page writes require a supported human event or mark resolution type."
}
},
"harness": {
diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.json
index f774fc983..0b603b30a 100644
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@ -16,7 +16,8 @@
"event": {
"acceptanceUnknown": "Show 事件可能仍在处理中,未在本地重复提交。",
"dispatchFailed": "Show 事件已记录,但未能投递对应的 Agent turn。",
- "idConflict": "此 Show 事件 ID 已绑定到不同的事件内容。"
+ "idConflict": "此 Show 事件 ID 已绑定到不同的事件内容。",
+ "unsupportedEventType": "Show Page 写入必须使用受支持的人类事件或标记解析类型。"
}
},
"harness": {
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 094846bed..036504758 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -2414,8 +2414,6 @@ def _remote_payload_is_allowed(method: str, path: str, payload: Any) -> bool:
return _payload_has_only_fields(payload, {"title"})
if normalized_method == "PATCH" and re.fullmatch(r"/api/projects/[^/]+", path):
return _payload_has_only_fields(payload, {"display_name"})
- if normalized_method == "POST" and path == "/api/projects":
- return _payload_has_only_fields(payload, {"display_name"})
return False
@@ -8423,6 +8421,7 @@ async def sessions_bootstrap(session_id: str):
session_id=session_id,
limit=50,
types=messages_service.TRANSCRIPT_TYPES,
+ authorization_context=authorization_context,
tail=True,
)
from storage import message_deliveries
@@ -9092,9 +9091,14 @@ def sessions_messages_list(session_id: str):
tail = request.args.get("tail") == "1"
engine = _projects_engine()
+ authorization_context = getattr(g, "authorization_context", None)
with engine.connect() as conn:
try:
- workbench_sessions_service.get_session(conn, session_id)
+ workbench_sessions_service.get_session(
+ conn,
+ session_id,
+ authorization_context=authorization_context,
+ )
except LookupError as err:
return jsonify({"error": str(err)}), 404
# Chat transcript = the dialogue + turn-terminal markers. avibe turns
@@ -9114,6 +9118,7 @@ def sessions_messages_list(session_id: str):
around_run_id=around_run_id,
limit=limit,
types=messages_service.TRANSCRIPT_TYPES,
+ authorization_context=authorization_context,
tail=tail,
)
return jsonify(result)
@@ -9144,9 +9149,14 @@ def sessions_activity(session_id: str):
group_id = request.args.get("group_id") or None
engine = _projects_engine()
+ authorization_context = getattr(g, "authorization_context", None)
with engine.connect() as conn:
try:
- workbench_sessions_service.get_session(conn, session_id)
+ workbench_sessions_service.get_session(
+ conn,
+ session_id,
+ authorization_context=authorization_context,
+ )
except LookupError as err:
return jsonify({"error": str(err)}), 404
if group_id:
@@ -12252,16 +12262,7 @@ async def _show_event_response_from_payload(
# callers keep the full supported set.
event_type = str(payload.get("type") or "").strip()
if event_type not in HUMAN_EVENT_TYPES and event_type != "assistant.mark.resolved":
- return (
- jsonify(
- {
- "ok": False,
- "code": "unsupported_event_type",
- "error": "Remote Show Page writes require a supported human event or mark resolution type.",
- }
- ),
- 400,
- )
+ return _unsupported_show_event_type_response()
# The echo of the stored event goes back to whoever posted it, so a remote
# author must not learn the local screenshot path from its own response.
remote = not public and _is_remote_show_page_request()
@@ -12554,6 +12555,15 @@ def _show_event_dispatch_pending_error() -> ShowSessionEventError:
return localized_show_event_error("show_event_dispatch_pending")
+def _unsupported_show_event_type_response():
+ error = localized_show_event_error("unsupported_event_type")
+ return _coded_error_response(
+ error.code,
+ str(error),
+ 400,
+ )
+
+
def _load_session_message(session_id: str, message_id: str) -> dict[str, Any] | None:
from storage import messages_service
@@ -13887,16 +13897,7 @@ async def serve_public_show_page(share_id, asset_path):
payload = _sanitize_public_show_event_payload(_show_events_payload_from_request())
event_type = str(payload.get("type") or "").strip()
if event_type not in HUMAN_EVENT_TYPES and event_type != "assistant.mark.resolved":
- return (
- jsonify(
- {
- "ok": False,
- "code": "unsupported_event_type",
- "error": "Public Show Page writes require a supported human event or mark resolution type.",
- }
- ),
- 400,
- )
+ return _unsupported_show_event_type_response()
return await _show_event_response_from_payload(
page.session_id,
payload,