The repository JSONB column on the issue table is unused. This removes it end-to-end: migration to drop the column, sqlc queries, Go handler/ service/daemon/protocol structs, TypeScript types, and the RepositoryEditor UI component. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
65 lines
2 KiB
Go
65 lines
2 KiB
Go
package daemon
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// BuildPrompt constructs the task prompt for an agent CLI.
|
|
func BuildPrompt(task Task, workdir string) string {
|
|
var b strings.Builder
|
|
b.WriteString("You are running as a local coding agent for a Multica workspace.\n")
|
|
b.WriteString("Complete the assigned issue using the local environment.\n")
|
|
b.WriteString("Return a concise Markdown comment suitable for posting back to the issue.\n")
|
|
b.WriteString("If you cannot complete the task because context, files, or permissions are missing, return status \"blocked\" and explain the blocker in the comment.\n\n")
|
|
|
|
fmt.Fprintf(&b, "Working directory: %s\n", workdir)
|
|
fmt.Fprintf(&b, "Agent: %s\n", task.Context.Agent.Name)
|
|
fmt.Fprintf(&b, "Issue title: %s\n\n", task.Context.Issue.Title)
|
|
|
|
if task.Context.Issue.Description != "" {
|
|
b.WriteString("Issue description:\n")
|
|
b.WriteString(task.Context.Issue.Description)
|
|
b.WriteString("\n\n")
|
|
}
|
|
|
|
if len(task.Context.Issue.AcceptanceCriteria) > 0 {
|
|
b.WriteString("Acceptance criteria:\n")
|
|
for _, item := range task.Context.Issue.AcceptanceCriteria {
|
|
fmt.Fprintf(&b, "- %s\n", item)
|
|
}
|
|
b.WriteString("\n")
|
|
}
|
|
|
|
if len(task.Context.Issue.ContextRefs) > 0 {
|
|
b.WriteString("Context refs:\n")
|
|
for _, item := range task.Context.Issue.ContextRefs {
|
|
fmt.Fprintf(&b, "- %s\n", item)
|
|
}
|
|
b.WriteString("\n")
|
|
}
|
|
|
|
if task.Context.WorkspaceContext != "" {
|
|
b.WriteString("Workspace context:\n")
|
|
b.WriteString(task.Context.WorkspaceContext)
|
|
b.WriteString("\n\n")
|
|
}
|
|
|
|
if task.Context.Agent.Skills != "" {
|
|
b.WriteString("Agent skills/instructions:\n")
|
|
b.WriteString(task.Context.Agent.Skills)
|
|
b.WriteString("\n\n")
|
|
}
|
|
|
|
b.WriteString("Comment requirements:\n")
|
|
b.WriteString("- Lead with the outcome.\n")
|
|
b.WriteString("- Mention concrete files or commands if you changed anything.\n")
|
|
b.WriteString("- Mention blockers or follow-up actions if relevant.\n")
|
|
|
|
return b.String()
|
|
}
|
|
|
|
// ResolveTaskWorkdir determines the working directory for a task.
|
|
func ResolveTaskWorkdir(reposRoot string) string {
|
|
return reposRoot
|
|
}
|