refactor: systemPrompt → pure string, threadId injected by agent layer

- CreateRoleArgs.systemPrompt simplified to string (no more ctx callback)
- buildAgentPrompt injects real ctx.threadId in Tools section
- All four roles compute prompt at construction time from config only
- Removed duplicate ctx.threadId injection from reviewer/committer prompts

小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-06 12:25:41 +00:00
parent c9cdfe37db
commit fce2bf7441
9 changed files with 22 additions and 51 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import type { AgentFn, Role, ThreadContext } from "@uncaged/workflow";
import type { AgentFn, Role } from "@uncaged/workflow";
import { createRole } from "@uncaged/workflow-agent-llm";
import type { LlmProvider } from "@uncaged/workflow-util-role";
import * as z from "zod/v4";
@@ -40,7 +40,7 @@ export function createCoderRole(
return createRole({
name: "coder",
schema: coderMetaSchema,
systemPrompt: async (_ctx: ThreadContext) => coderSystemPrompt(config),
systemPrompt: coderSystemPrompt(config),
agent: adapter,
extract: {
provider: extract.provider,