[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-07-08 07:18:31 +00:00
committed by GitHub
parent aa1ac64a3f
commit b8bd033df1
3 changed files with 15 additions and 10 deletions

View File

@ -129,7 +129,10 @@ def _wrap_build_draft_agent_soul_prompt(prompt: str | None) -> str:
if not prompt_body:
return _BUILD_DRAFT_AGENT_SOUL_PROMPT + "\n\nIntended task for later normal runs:\nNo task prompt was provided."
fence = _markdown_backtick_fence(prompt_body)
return _BUILD_DRAFT_AGENT_SOUL_PROMPT + f"\n\nIntended task for later normal runs:\n{fence}text\n{prompt_body}\n{fence}"
return (
_BUILD_DRAFT_AGENT_SOUL_PROMPT
+ f"\n\nIntended task for later normal runs:\n{fence}text\n{prompt_body}\n{fence}"
)
def _agent_soul_prompt_for_layer(

View File

@ -646,14 +646,14 @@ def test_push_drive_from_environment_kind_skill_standardizes_skill_directory(
uploaded_paths: list[str] = []
def fake_upload(*, path: str) -> UploadedToolFileResource:
uploaded_paths.append(Path(path).name)
return UploadedToolFileResource(
mapping=AgentStubFileMapping(
transfer_method="tool_file",
reference=_reference(Path(path).name),
),
tool_file_id=Path(path).name,
)
uploaded_paths.append(Path(path).name)
return UploadedToolFileResource(
mapping=AgentStubFileMapping(
transfer_method="tool_file",
reference=_reference(Path(path).name),
),
tool_file_id=Path(path).name,
)
monkeypatch.setattr("dify_agent.agent_stub.cli._drive.upload_tool_file_resource_from_environment", fake_upload)
monkeypatch.setattr(

View File

@ -236,7 +236,9 @@ def test_upload_file_from_environment_rejects_missing_download_url(
)
monkeypatch.setattr(
"dify_agent.agent_stub.cli._files.request_agent_stub_file_download_sync",
lambda **_kwargs: type("Response", (), {"filename": "report.pdf", "mime_type": "application/pdf", "size": 12})(),
lambda **_kwargs: type(
"Response", (), {"filename": "report.pdf", "mime_type": "application/pdf", "size": 12}
)(),
)
with pytest.raises(AgentStubTransferError, match="missing download_url"):