Skip to content

Commit 1e9c367

Browse files
springai/basic: explain why run()'s systemPrompt parameter is unused
@WorkflowInit requires the constructor and the @WorkflowMethod to share a parameter list, so run(String) must take systemPrompt even though only the constructor uses it. Add a comment so readers don't trip over the apparent unused parameter (and so static analyzers that flagged it have an explanation in-source). Addresses Copilot review on PR #775. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2e02881 commit 1e9c367

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

TASK_QUEUE.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"line": 103,
5656
"reviewer": "copilot-pull-request-reviewer",
5757
"question": "run(String systemPrompt) doesn't use its systemPrompt parameter.",
58-
"status": "unaddressed",
59-
"note": "It IS used — via @WorkflowInit the same argument is passed to the constructor. @WorkflowInit requires matching signatures between the constructor and @WorkflowMethod, so the parameter can't be dropped. Reply explaining this, or add a brief comment in run()."
58+
"status": "addressed",
59+
"note": "Added a comment in run() explaining that @WorkflowInit requires matching parameter lists between the constructor and the @WorkflowMethod, and that the constructor consumed the prompt."
6060
},
6161
{
6262
"file": "springai/multimodel/src/main/java/io/temporal/samples/springai/multimodel/MultiModelApplication.java",

springai/basic/src/main/java/io/temporal/samples/springai/chat/ChatWorkflowImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public ChatWorkflowImpl(String systemPrompt) {
9191

9292
@Override
9393
public String run(String systemPrompt) {
94-
// Wait until the chat is ended
94+
// systemPrompt is unused here on purpose — @WorkflowInit requires the constructor
95+
// and the @WorkflowMethod to share a parameter list, and the constructor above
96+
// already consumed it to build the chat client.
9597
Workflow.await(() -> ended);
9698
return "Chat ended after " + messageCount + " messages.";
9799
}

0 commit comments

Comments
 (0)