diff --git a/src/main/logseq/cli/command/agent.cljs b/src/main/logseq/cli/command/agent.cljs index 5ee149eb95..ad700b6b9a 100644 --- a/src/main/logseq/cli/command/agent.cljs +++ b/src/main/logseq/cli/command/agent.cljs @@ -177,6 +177,7 @@ "Reply instructions:" "For a short reply, append a comment after the requesting comment." "For a long reply, write a normal block tree after the comments area and append a comment that references that tree." + "When referencing result blocks in DB graphs, reference result blocks with [[block-uuid]], not ((block-uuid))." "If the request is blocked or fails, make that clear in the reply."])) (def ^:private prompt-template-vars diff --git a/src/test/logseq/cli/command/agent_test.cljs b/src/test/logseq/cli/command/agent_test.cljs index 55622c0f14..4fa9c20632 100644 --- a/src/test/logseq/cli/command/agent_test.cljs +++ b/src/test/logseq/cli/command/agent_test.cljs @@ -245,6 +245,17 @@ (is (string/starts-with? preview "codex --sandbox danger-full-access exec --json --skip-git-repo-check '")) (is (string/includes? preview "Ship the CLI bridge"))))) +(deftest test-default-comment-prompt-documents-db-graph-block-ref-syntax + (let [prompt (#'agent-command/build-comment-codex-prompt + {:graph "demo" + :agent-name "build-host" + :comment (comment-block {}) + :target-tree-texts ["- Target block"] + :comments-area-tree-text "- Comments" + :comment-tree-text "- [[build-host]] summarize"})] + (is (string/includes? prompt "reference result blocks with [[block-uuid]], not ((block-uuid))")) + (is (not (string/includes? prompt "reference result blocks with ((block-uuid))"))))) + (deftest test-prompt-templates (testing "prompt builders render supplied graph templates" (let [prompt (agent-command/build-codex-prompt