Skip to content

AB#33053 fix AI cooldown wait state#2472

Merged
jacobwillsmith merged 1 commit into
devfrom
bugfix/AB#33053-ai-cooldown-wait-state-follow-up
May 15, 2026
Merged

AB#33053 fix AI cooldown wait state#2472
jacobwillsmith merged 1 commit into
devfrom
bugfix/AB#33053-ai-cooldown-wait-state-follow-up

Conversation

@jacobwillsmith
Copy link
Copy Markdown
Contributor

Summary

Fixes inconsistent AI cooldown wait-state behavior across generate flows.

Changes

  • Routes selected attachment summary generation through the queued AI generation path.
  • Adds queue-time validation for selected attachment summary requests.
  • Carries selected attachment IDs through the attachment summary background job.
  • Ensures cooldown is stamped before generation requests are marked completed.
  • Ensures affected generate buttons participate in the shared cooldown countdown.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Routes the "selected attachment summary" generation through the queued AI generation pipeline (instead of a direct sync API call), so the cooldown/rate-limit countdown reliably applies and shared generate buttons participate in the same wait state. Also reorders job completion so the rate-limit timestamp is stamped before the request is marked completed, preventing a window where the UI sees "Completed" without a cooldown.

Changes:

  • New QueueAttachmentSummaryRequestDto (with ApplicationId + optional AttachmentIds) flows from JS → app service → queue → background job → AttachmentSummaryService, with validation at queue time and again in the service.
  • All four AI background jobs swap the order of MarkCompletedInNewUowAsync and StampRateLimitBestEffortAsync so cooldown is stamped first.
  • ChefsAttachments.js now calls the queued endpoint and reuses AIGenerationButtonState.monitor; the Generate button gets the shared ai-generate-btn class so it joins the cooldown countdown. Two now-unused public methods are removed from IAttachmentSummaryAppService.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Views/Shared/Components/ReviewList/ReviewList.js Adds ai-generate-btn class to Generate workflow button so it shares cooldown styling.
Views/Shared/Components/ChefsAttachments/ChefsAttachments.js Switches selected-attachment summary generation to the queued path with status monitoring.
GrantApplications/GrantApplicationAppService.cs New DTO-based QueueAttachmentSummaryAsync, plus ResolveAttachmentSummaryIdsAsync validation.
GrantApplications/Automation/BackgroundJobs/RunApplicationAIPipelineJob.cs Stamp rate-limit before marking completed (skipped & happy path).
GrantApplications/Automation/BackgroundJobs/GenerateAttachmentSummaryJob.cs Pass AttachmentIds to service; swap completion/stamp order.
GrantApplications/Automation/BackgroundJobs/GenerateApplicationScoringJob.cs Swap completion/stamp order.
GrantApplications/Automation/BackgroundJobs/GenerateApplicationAnalysisJob.cs Swap completion/stamp order.
GrantApplications/Automation/ApplicationAIGenerationQueue.cs Forward attachmentIds into the background job args.
Application.Contracts/GrantApplications/QueueAttachmentSummaryRequestDto.cs New input DTO.
Application.Contracts/GrantApplications/IGrantApplicationAppService.cs Updated interface signature.
Application.Contracts/.../GenerateAttachmentSummaryBackgroundJobArgs.cs Adds AttachmentIds to job args.
Unity.AI.Application/Attachments/AttachmentSummaryAppService.cs Removes the two direct sync generate endpoints (now routed via queue).
Unity.AI.Application/AI/Operations/IAttachmentSummaryService.cs Adds optional attachmentIds parameter.
Unity.AI.Application/AI/Operations/AttachmentSummaryService.cs Implements selected-attachment filtering with membership validation.
Unity.AI.Application.Contracts/Automation/IApplicationAIGenerationQueue.cs Adds attachmentIds to queue contract.
Unity.AI.Application.Contracts/Attachments/IAttachmentSummaryAppService.cs Removes obsolete public methods.

@github-actions
Copy link
Copy Markdown

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 734
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@jacobwillsmith jacobwillsmith force-pushed the bugfix/AB#33053-ai-cooldown-wait-state-follow-up branch from a189cbe to 9080c29 Compare May 15, 2026 17:28
@sonarqubecloud
Copy link
Copy Markdown

@jacobwillsmith jacobwillsmith marked this pull request as ready for review May 15, 2026 17:34
@github-actions
Copy link
Copy Markdown

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 734
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@jacobwillsmith jacobwillsmith merged commit 4bb323e into dev May 15, 2026
25 checks passed
@jacobwillsmith jacobwillsmith deleted the bugfix/AB#33053-ai-cooldown-wait-state-follow-up branch May 15, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants