Skip to content

Commit 85524e0

Browse files
authored
Merge pull request #671 from AnguseZhang/fix/clean-tmp-dir
refactor: 修改上传报告函数以使用可配置的临时目录路径
2 parents e47e9c7 + 6e8e17a commit 85524e0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

agents/matmaster_agent/utils/io_oss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ async def upload_base64_to_oss(data: str, oss_path: str) -> dict:
193193

194194
async def upload_report_md_to_oss(
195195
params: ReportUploadParams,
196+
temp_dir_path: str = './tmp',
196197
) -> Optional[ReportUploadResult]:
197198
"""Upload markdown report content to OSS and return its URL."""
198199

199200
report_markdown = (params.report_markdown or '').strip()
200201
if not report_markdown:
201202
return None
202203

203-
tmp_path = f'./tmp/report_{params.session_id}_{params.invocation_id}'
204-
async with temp_dir(tmp_path) as tdir:
204+
async with temp_dir(temp_dir_path) as tdir:
205205
filename = f'matmaster_report_{params.invocation_id}.md'
206206
md_file_path = tdir / filename
207207
md_file_path.write_text(report_markdown, encoding='utf-8')

0 commit comments

Comments
 (0)