feat: keep what agents deliver and serve it at signed links (ADR-0004)
The Orchestration engine keeps every completed agent Execution it relays, by tenant, Customer case and Execution, and serves its record and files at signed, expiring links. A KAB workflow step, which takes one output per step, is given one JSON document of links (`deliver: links`); other callers still get each file, and what they are given is kept either way. - store.py, links.py, delivery.py, serving.py; the relay keeps and links - the card declares `deliver`, `sources` and an output schema - image: STORE_DIR on a /data volume; PUBLIC_URL and LINK_SECRET settings - option 1's tests replaced by tests of the links document Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,8 +38,13 @@ SETTINGS = OrchestrationSettings(_env_file=None, HEARTBEAT_SECONDS=3600) # type
|
||||
|
||||
|
||||
def finished(
|
||||
task_id: str, files: dict[str, str], status: str = "completed"
|
||||
task_id: str,
|
||||
files: dict[str, str],
|
||||
status: str = "completed",
|
||||
guide: str | None = None,
|
||||
) -> StreamResponse:
|
||||
"""A completed task with `files`; `guide` is sent as markdown, as the Execution
|
||||
engine sends its final Deliverable."""
|
||||
message = Message(
|
||||
message_id=str(uuid.uuid4()),
|
||||
role=Role.ROLE_AGENT,
|
||||
@@ -57,7 +62,11 @@ def finished(
|
||||
Artifact(
|
||||
artifact_id=f"{task_id}-{name}",
|
||||
name=name,
|
||||
parts=[new_text_part(text)],
|
||||
parts=[
|
||||
new_text_part(text, media_type="text/markdown")
|
||||
if name == guide
|
||||
else new_text_part(text)
|
||||
],
|
||||
)
|
||||
for name, text in files.items()
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user