MCPcopy Create free account
hub / github.com/compozy/agh / newTaskReviewSubmitCommand

Function newTaskReviewSubmitCommand

internal/cli/task.go:1113–1174  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

1111}
1112
1113func newTaskReviewSubmitCommand(deps commandDeps) *cobra.Command {
1114 input := taskReviewSubmitInput{}
1115 var asAgent bool
1116 cmd := &cobra.Command{
1117 Use: "submit <review-id>",
1118 Short: "Submit one task-run review verdict",
1119 Args: exactOneNonBlankArg(),
1120 RunE: func(cmd *cobra.Command, args []string) error {
1121 client, err := clientFromDeps(deps)
1122 if err != nil {
1123 return err
1124 }
1125 request, err := buildTaskRunReviewVerdictRequest(args[0], input)
1126 if err != nil {
1127 return err
1128 }
1129 var result TaskRunReviewVerdictRecord
1130 if asAgent {
1131 credentials, identityErr := requireAgentCommandIdentity(
1132 cmd.Context(),
1133 deps,
1134 client,
1135 agentActionCLI("task.review.submit"),
1136 )
1137 if identityErr != nil {
1138 return identityErr
1139 }
1140 result, err = client.SubmitTaskRunReviewVerdictAsAgent(
1141 cmd.Context(),
1142 args[0],
1143 request,
1144 credentials,
1145 )
1146 } else {
1147 result, err = client.SubmitTaskRunReviewVerdict(cmd.Context(), args[0], request)
1148 }
1149 if err != nil {
1150 return err
1151 }
1152 return writeCommandOutput(cmd, taskRunReviewVerdictBundle(&result))
1153 },
1154 }
1155 cmd.Flags().StringVar(&input.RunID, "run", "", "Task run ID")
1156 cmd.Flags().StringVar(&input.OutcomeRaw, cliOutcomeKey, "", "Verdict outcome")
1157 cmd.Flags().Float64Var(&input.Confidence, "confidence", 0, "Verdict confidence from 0 to 1")
1158 cmd.Flags().StringVar(&input.Reason, "reason", "", "Verdict reason")
1159 cmd.Flags().StringVar(&input.DeliveryID, "delivery-id", "", "Idempotent delivery ID")
1160 cmd.Flags().
1161 StringArrayVar(&input.MissingWork, "missing-work", nil, "Missing work item (repeatable)")
1162 cmd.Flags().StringVar(&input.MissingWorkRaw, "missing-work-json", "", "Missing work JSON array")
1163 cmd.Flags().
1164 StringVar(&input.NextRoundGuidance, "next-round-guidance", "", "Guidance for continuation rounds")
1165 cmd.Flags().StringVar(&input.ReviewText, "review-text", "", "Full review text")
1166 cmd.Flags().
1167 BoolVar(&asAgent, "as-agent", false, "Submit review using the current AGH-managed agent session identity")
1168 mustMarkFlagRequired(cmd, "run")
1169 mustMarkFlagRequired(cmd, cliOutcomeKey)
1170 mustMarkFlagRequired(cmd, "confidence")

Callers 1

newTaskReviewCommandFunction · 0.85

Calls 10

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
agentActionCLIFunction · 0.85
writeCommandOutputFunction · 0.85
mustMarkFlagRequiredFunction · 0.85

Tested by

no test coverage detected