diff --git a/agent.py b/agent.py index bdc4511..32b9b0e 100644 --- a/agent.py +++ b/agent.py @@ -1032,14 +1032,10 @@ async def _persist_text(ctx: RunContext[NoAuth], run_id: str, filename: str, tex sha = hashlib.sha256(data).hexdigest() artifact_uri: str | None = None try: - view = await ctx.workspace.open_view( - purpose="persist revenue recovery output", - hints=[rel_path], - max_files=1, - mode=WorkspaceMode.READ_WRITE_OVERLAY, - reason="write generated output under outputs/revenue-recovery", - ) - await view.write(rel_path, data) + writer = getattr(ctx.workspace, "write_bytes", None) + if writer is None: + raise RuntimeError("workspace client does not expose direct output writes") + writer(rel_path, data) except Exception as exc: # workspace may be unavailable in local smoke calls; artifact still persists. await ctx.emit_event(AgentEvent(kind="workspace_write_warning", payload={"path": rel_path, "message": str(exc)[:300]})) try: