Skip to content

feat(site): add AI task status to deployment banner #18919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link

@devin-ai-integration devin-ai-integration bot commented Jul 18, 2025

feat(site): add AI task status to deployment banner

Summary

Adds AI task statistics display to the Coder homepage deployment banner, showing active, completed, and failed AI task counts. This implements both the backend API (/api/experimental/aitasks/stats) and frontend integration to surface AI agent activity to users.

Key Components:

  • Backend: New experimental API endpoint with Go struct definitions
  • Frontend: Integration with deployment banner, respects CODER_HIDE_AI_TASKS configuration
  • UI: Clean display with tooltips and icons matching existing banner style

Review & Testing Checklist for Human

  • CRITICAL: Verify hardcoded mock data approach - Backend currently returns fixed values (3 active, 15 completed, 2 failed). Confirm this is acceptable for demo/testing purposes and understand timeline for real data integration
  • Test actual UI rendering - Load Coder dashboard and verify AI stats appear correctly in deployment banner with proper styling and tooltips
  • Verify configuration hiding works - Test that setting CODER_HIDE_AI_TASKS=true properly hides the AI stats section
  • Manual API testing - Hit /api/experimental/aitasks/stats directly to confirm endpoint works and returns expected JSON structure
  • Check TypeScript type generation - Verify CI properly generates AITasksStatsResponse type (I manually added it due to local Go version issues)

Recommended Test Plan:

  1. Start local Coder instance and navigate to homepage
  2. Verify AI stats appear in deployment banner
  3. Test with CODER_HIDE_AI_TASKS=true to confirm hiding
  4. Check browser network tab for successful API calls
  5. Verify tooltips and responsive design work properly

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    Backend["codersdk/aitasks.go<br/>AITasksStatsResponse struct"]:::major-edit
    Handler["coderd/aitasks.go<br/>aiTasksStats handler"]:::major-edit  
    Routes["coderd/coderd.go<br/>Route registration"]:::minor-edit
    
    
    API["site/src/api/api.ts<br/>getAITasksStats method"]:::major-edit
    Query["site/src/api/queries/aitasks.ts<br/>Query helper"]:::major-edit
    Banner["site/src/modules/dashboard/<br/>DeploymentBanner.tsx"]:::major-edit
    BannerView["site/src/modules/dashboard/<br/>DeploymentBannerView.tsx"]:::major-edit
    Types["site/src/api/typesGenerated.ts<br/>TypeScript types"]:::minor-edit
    
    Backend --> Handler
    Handler --> Routes
    Backend --> Types
    Types --> API
    API --> Query  
    Query --> Banner
    Banner --> BannerView
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end

classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB  
classDef context fill:#FFFFFF
Loading

Notes

  • Environment Issues: Local Go version (1.18) incompatible with project requirements (1.24), preventing full local testing and type generation
  • Mock Data: Backend uses hardcoded statistics for demonstration - needs real AI task tracking integration
  • Session Details: Implemented by @devin for @bpmct, session: https://app.devin.ai/sessions/0279d5b7f7d6495cadaf926f293e3465
  • CI Status: All technical checks passing except CLA (administrative issue)

- Add AITasksStatsResponse interface for AI task statistics
- Create aiTasksStats query helper for fetching AI task data
- Add getAITasksStats API method to fetch task statistics
- Integrate AI task status display in DeploymentBannerView
- Show active, completed, and failed AI task counts with icons
- Respect hide_ai_tasks configuration setting
- Follow existing deployment banner styling patterns

Co-Authored-By: ben@coder.com <me@bpmct.net>
@devin-ai-integration devin-ai-integration bot requested a review from aslilac as a code owner July 18, 2025 19:45
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@devin-ai-integration devin-ai-integration bot changed the title feat(site): Add AI task status to deployment banner feat(site): add AI task status to deployment banner Jul 18, 2025
devin-ai-integration bot and others added 4 commits July 18, 2025 20:20
Co-Authored-By: ben@coder.com <me@bpmct.net>
- Add AITasksStatsResponse struct to codersdk/aitasks.go
- Implement aiTasksStats handler in coderd/aitasks.go with mock data
- Register /api/experimental/aitasks/stats route in coderd/coderd.go
- Remove manual TypeScript type definition (will be auto-generated by CI)

Co-Authored-By: ben@coder.com <me@bpmct.net>
- Fix unused receiver warning in aiTasksStats handler
- Ensure AITasksStatsResponse type is properly exported
- Apply code formatting fixes

Co-Authored-By: ben@coder.com <me@bpmct.net>
- Reorder imports in DeploymentBanner.tsx per biome formatter
- Resolves fmt CI check failure

Co-Authored-By: ben@coder.com <me@bpmct.net>
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

not even close

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.

1 participant