Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
476 changes: 313 additions & 163 deletions api/pkg/server/docs.go

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions api/pkg/server/spec_driven_task_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"time"

"github.com/gorilla/mux"
"github.com/helixml/helix/api/pkg/ptr"
"github.com/helixml/helix/api/pkg/services"
"github.com/helixml/helix/api/pkg/types"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -292,9 +291,11 @@ func (s *HelixAPIServer) approveSpecs(w http.ResponseWriter, r *http.Request) {
return
}

now := time.Now()
existingTask.SpecApprovedBy = user.ID
existingTask.SpecApprovedAt = ptr.To(time.Now())
existingTask.SpecApprovedAt = &now
existingTask.Status = types.TaskStatusSpecApproved
existingTask.StatusUpdatedAt = &now
existingTask.SpecApproval = &req

err = s.Store.UpdateSpecTask(ctx, existingTask)
Expand Down Expand Up @@ -657,12 +658,14 @@ func (s *HelixAPIServer) startPlanning(w http.ResponseWriter, r *http.Request) {
task.UpdatedAt = time.Now()

// Check if Just Do It mode is enabled - skip spec and go straight to implementation
now := time.Now()
if task.JustDoItMode {
task.Status = types.TaskStatusQueuedImplementation
} else {
// Normal mode: Start spec generation
task.Status = types.TaskStatusQueuedSpecGeneration
}
task.StatusUpdatedAt = &now

// Save the task with queued status first (so response reflects immediate status)
err = s.Store.UpdateSpecTask(ctx, task)
Expand Down Expand Up @@ -730,6 +733,9 @@ func (s *HelixAPIServer) updateSpecTask(w http.ResponseWriter, r *http.Request)
// Update fields if provided
if updateReq.Status != "" {
task.Status = updateReq.Status
// Update StatusUpdatedAt so task appears at top of new column in Kanban
now := time.Now()
task.StatusUpdatedAt = &now
}
if updateReq.Priority != "" {
task.Priority = updateReq.Priority
Expand Down
5 changes: 3 additions & 2 deletions api/pkg/server/spec_task_design_review_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"time"

"github.com/gorilla/mux"
"github.com/helixml/helix/api/pkg/ptr"
"github.com/helixml/helix/api/pkg/services"
"github.com/helixml/helix/api/pkg/store"
"github.com/helixml/helix/api/pkg/system"
Expand Down Expand Up @@ -267,10 +266,12 @@ func (s *HelixAPIServer) submitDesignReview(w http.ResponseWriter, r *http.Reque

case "request_changes":
review.Status = types.SpecTaskDesignReviewStatusChangesRequested
review.RejectedAt = ptr.To(time.Now())
now := time.Now()
review.RejectedAt = &now
review.OverallComment = req.OverallComment

specTask.Status = types.TaskStatusSpecRevision
specTask.StatusUpdatedAt = &now
specTask.SpecRevisionCount++

if err := s.Store.UpdateSpecTask(ctx, specTask); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions api/pkg/server/spec_task_workflow_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (s *HelixAPIServer) approveImplementation(w http.ResponseWriter, r *http.Re
specTask.ImplementationApprovedBy = user.ID
specTask.ImplementationApprovedAt = &now
specTask.Status = types.TaskStatusPullRequest
specTask.StatusUpdatedAt = &now

if err := s.Store.UpdateSpecTask(ctx, specTask); err != nil {
http.Error(w, fmt.Sprintf("Failed to update spec task: %s", err.Error()), http.StatusInternalServerError)
Expand Down Expand Up @@ -191,6 +192,7 @@ func (s *HelixAPIServer) approveImplementation(w http.ResponseWriter, r *http.Re
// Don't record approval yet - user needs to review after rebase
// Keep in implementation_review status so agent stays alive
specTask.Status = types.TaskStatusImplementationReview
specTask.StatusUpdatedAt = &now
if err := s.Store.UpdateSpecTask(ctx, specTask); err != nil {
http.Error(w, fmt.Sprintf("Failed to update spec task: %s", err.Error()), http.StatusInternalServerError)
return
Expand Down Expand Up @@ -266,6 +268,7 @@ func (s *HelixAPIServer) approveImplementation(w http.ResponseWriter, r *http.Re
specTask.MergedToMain = true
specTask.MergedAt = &now
specTask.Status = types.TaskStatusDone
specTask.StatusUpdatedAt = &now
specTask.CompletedAt = &now

log.Info().
Expand Down
Loading
Loading