Hold /v1 key holders to the API write allowlist

The /v1 route runs with the agent owner's token, so the processor took a
key holder for the owner: writes on the owner's connected accounts ran or
waited for an approval the client could send. The route now marks the
processor as an external caller server-side, which keeps the allowlist
in force for the run and any resume, including state saved before.
This commit is contained in:
arc53-machine committed 2026-09-29 15:36:36 +01:00
1 parent 72e1dc5fc3
commit 656e3abbd0
3 files changed
+173 -4

No files matched your search

+3 -1
View File
@@ -261,7 +261,9 @@ def chat_completions():
internal_data["persist"] = True
try:
processor = StreamProcessor(internal_data, decoded_token, trace_source="v1")
# The token is the owner's, so tell the processor the caller is a key
# holder: their writes on the owner's accounts need the allowlist.
processor = StreamProcessor(internal_data, decoded_token, trace_source="v1", external_caller=True)
flush_trace_after_request(processor)
# Set when this request took the resume claim, so a refusal can release it.
claimed_conversation_id = None