fix(tasks): limit titles and display descriptions

This commit is contained in:
sam committed 2026-10-16 21:50:13 +11:00
1 parent 1b8abd3509
commit dcc201e7bb
6 files changed
+117 -76

No files matched your search

+5
View File
@@ -8,6 +8,7 @@ import (
"io"
"net/http"
"strings"
"unicode/utf8"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -94,6 +95,10 @@ func (s *Server) handleWorkRequest(w http.ResponseWriter, r *http.Request) {
http.Error(w, "identity, workflow, title, and instructions are required", http.StatusBadRequest)
return
}
if utf8.RuneCountInString(request.Title) > 80 {
http.Error(w, "title must be 80 characters or fewer; put details in instructions", http.StatusBadRequest)
return
}
iface, code, err := s.workRequestInterface(r.Context(), request)
if err != nil {
http.Error(w, err.Error(), code)