Consolidate Odysseus agent harness and tool contracts

This commit is contained in:
pewdiepie-archdaemon
2026-09-17 10:07:40 +00:00
parent 84aa9a91de
commit 218d762427
229 changed files with 28899 additions and 1551 deletions
+8 -3
View File
@@ -18,8 +18,11 @@ def create_office_document(
upload_id: str,
title: str,
body_text: Optional[str] = None,
language: str = "markdown",
*,
owner: Optional[str] = None,
) -> Optional[str]:
"""Create a markdown Document for an Office attachment and set it active.
"""Create a Document for an Office attachment and set it active.
Returns the new doc_id, or None on failure / empty body. The full
extracted body lives in `current_content`, so the agent can fetch
@@ -42,15 +45,17 @@ def create_office_document(
doc_id = str(uuid.uuid4())
ver_id = str(uuid.uuid4())
sess = db.query(DbSession).filter(DbSession.id == session_id).first()
if owner and sess and sess.owner != owner:
raise ValueError("Office document session belongs to a different owner")
doc = Document(
id=doc_id,
session_id=session_id,
title=title,
language="markdown",
language=language or "markdown",
current_content=body_text,
version_count=1,
is_active=True,
owner=sess.owner if sess else None,
owner=owner or (sess.owner if sess else None),
)
ver = DocumentVersion(
id=ver_id,