The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): refuse backtick in URL artifact capture (#118415)
Hermes Agente3841b1a0e5b
diff --git a/apps/desktop/src/app/artifacts/artifact-utils.ts b/apps/desktop/src/app/artifacts/artifact-utils.tsindex c86fcc672cc..8e48bf29b5c 100644--- a/apps/desktop/src/app/artifacts/artifact-utils.ts+++ b/apps/desktop/src/app/artifacts/artifact-utils.ts@@ -30,7 +30,7 @@ export interface ArtifactLoadResult {const MARKDOWN_IMAGE_RE = /!\[([^\]]*)\]\(([^)\s]+)\)/gconst MARKDOWN_LINK_RE = /\[([^\]]+)\]\(([^)\s]+)\)/g-const URL_RE = /https?:\/\/[^\s<>"')]+/g+const URL_RE = /https?:\/\/[^\s<>"')`]+/gconst PATH_RE = /(^|[\s("'`])((?:\/|~[\\/]|\.\.?[\\/]|\\\\)[^\s"'`<>]+(?:\.[a-z0-9]{1,8})?)/giconst WINDOWS_PATH_RE = /(^|[\s("'`])([A-Za-z]:[\\/][^\s"'`<>]+(?:\.[a-z0-9]{1,8})?)/giconst IMAGE_EXT_RE = /\.(?:png|jpe?g|gif|webp|svg|bmp)(?:\?.*)?$/idiff --git a/apps/desktop/src/app/artifacts/index.test.ts b/apps/desktop/src/app/artifacts/index.test.tsindex f07146ea4ea..e3ab56cc12b 100644--- a/apps/desktop/src/app/artifacts/index.test.ts+++ b/apps/desktop/src/app/artifacts/index.test.ts@@ -65,6 +65,26 @@ describe('collectArtifactsForSession', () => {})})+ it('stops a URL capture at a closing backtick even when punctuation follows it', () => {+ // The closing delimiter can carry trailing punctuation (`…`,) — the+ // trailing-punctuation trim alone would leave the backtick behind, so the+ // capture itself must refuse it.+ const artifacts = collectArtifactsForSession(makeSession(), [+ {+ content: 'Deployed at `https://voice.qwickapps.com`, take a look.',+ role: 'assistant',+ timestamp: 2000+ }+ ])++ expect(artifacts).toHaveLength(1)+ expect(artifacts[0]).toMatchObject({+ href: 'https://voice.qwickapps.com',+ kind: 'link',+ value: 'https://voice.qwickapps.com'+ })+ })+it('does not index passive links and paths observed in tool output', () => {const messages: SessionMessage[] = [{