Hold resumed turns and public-link visitors to the right wiki rules

A paused turn is found by the agent owner's id, so anyone holding one of
the owner's agent keys could resume the owner's own chat with its saved
wiki edit rights. A resume now counts as an API or widget caller when
either the saved state or the resuming request is one, cuts the wiki tool
to wiki_view unless the wiki allows outside edits, and gives the tool
executor the same flags. A request that names an agent, by key or id, may
only resume that agent's turn; otherwise the claim is released and the
request refused.

Public-link visitors run as themselves and reach only wikis they may edit,
so the wiki switch no longer applies to them. Instead every wiki write in
a public-link run waits for the visitor's approval, so the agent owner's
prompt or sources can't steer an edit to the visitor's wiki unasked.
This commit is contained in:
arc53-machine committed 2026-09-29 16:37:58 +01:00
1 parent 91e70d2f0c
commit 051452c438
10 files changed
+405 -64

No files matched your search

+2 -2
View File
@@ -1010,7 +1010,7 @@ class TestResumeMarkResuming:
"llm_name": "openai",
"api_key": "k",
"user_api_key": None,
"agent_id": None,
"agent_id": "agent-1",
"agent_type": "ClassicAgent",
"prompt": "",
"json_schema": None,
@@ -1038,7 +1038,7 @@ class TestResumeMarkResuming:
# The body api_key resolves to its owning user.
fake_repo = MagicMock()
fake_repo.find_by_key.return_value = {"user_id": "owner-1"}
fake_repo.find_by_key.return_value = {"id": "agent-1", "user_id": "owner-1"}
@contextmanager
def _fake_db_readonly():