From f5cf002eca27d5398c1e048118a45a7a1c539278 Mon Sep 17 00:00:00 2001 From: Matteo Merola Date: Fri, 10 Jul 2026 23:18:26 +0200 Subject: [PATCH] fix(research): deliver the artifact link deterministically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chat reply depended on the model echoing artifact_url and it can drop it (observed in real use). The handler now posts '📄 Full report: ' straight to the originating chat like the other progress updates, and the result note asks the model to repeat the URL verbatim as well. --- humux/core/agent.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/humux/core/agent.py b/humux/core/agent.py index b2037f7..b9a948e 100644 --- a/humux/core/agent.py +++ b/humux/core/agent.py @@ -4325,10 +4325,19 @@ async def gen(prompt: str, max_tokens: int) -> tuple[str, int]: target = Path(ws).expanduser() / ARTIFACTS_SUBDIR / slug / "index.html" target.parent.mkdir(parents=True, exist_ok=True) target.write_text(page, encoding="utf-8") - result["artifact_url"] = f"{self._base_url()}/artifacts/{slug}/" + url = f"{self._base_url()}/artifacts/{slug}/" + result["artifact_url"] = url + # Deliver the link deterministically, like the progress updates + # — the user must get it even if the model's reply drops it. + try: + await progress(f"📄 Full report: {url}") + except Exception: + log.exception("Failed to deliver deep-research artifact link") result["note"] = ( - "Report published as a web artifact. Reply briefly: the key " - "takeaways plus the artifact_url link — do not paste the report." + "Report published as a web artifact; its link was already " + "posted to the chat. Reply briefly: the key takeaways, plus " + "the artifact_url repeated verbatim as a plain URL — do not " + "paste the report." ) except OSError: log.exception("Failed to write deep-research artifact %s", slug)