Skip to content

feat(organization): add Agent Tasks overview entry - #2976

Open
RemiBonnet wants to merge 1 commit into
stagingfrom
agent-task-demo-entry
Open

RemiBonnet wants to merge 1 commit into
stagingfrom
agent-task-demo-entry

Conversation

@RemiBonnet

@RemiBonnet RemiBonnet commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Issue: N/A

  • Adds a dismissible Agent Tasks entry to the organization overview.
  • Sends presenters to the Service creation flow for the first available project and environment, where Agent Task templates are displayed.
  • Keeps the card behind the existing argentic-workflow feature flag and preserves the Open Policy entry.

Screenshots / Recordings

Not included.

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • Targeted Prettier formatting
  • Targeted ESLint
  • yarn tsc --noEmit -p apps/console/tsconfig.app.json

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

Summary by cubic

Adds a dismissible Agent Tasks card to the organization overview that routes users to the service creation flow for their first project and environment.

  • The card is rendered only when the argentic-workflow feature flag is enabled and a project with environments exists.
  • Dismissing the card persists locally, and the Open Policy highlight remains in the sidebar.

Written for commit 78b6022. Summary will update on new commits.

Review in cubic

@nx-cloud

nx-cloud Bot commented Sep 16, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 78b6022

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 1m 11s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 2m 41s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 41s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-16 15:37:21 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 issues found across 3 files

Confidence score: 3/5

  • In section-agent-tasks-highlight.tsx, selecting only projects[0] can hide the card when that project lacks environments even though another project is eligible, causing a user-facing feature omission; select the first project with an available environment.
  • In section-agent-tasks-highlight.tsx, the global dismissal storage key makes dismissing the card in one organization suppress it across all organizations in the same browser; scope the key by organizationId.
  • In section-agent-tasks-highlight.tsx, dismissed cards still trigger project and environment requests despite rendering nothing, wasting network and query work; gate the project query with isVisible and avoid the environment lookup after dismissal.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx">

<violation number="1" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:13">
P2: Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by `organizationId` so dismissal applies only to the current organization.</violation>

<violation number="2" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:14">
P2: After dismissal, this component still fetches projects and environments even though it always returns `null`. Include `isVisible` in the project query enablement and pass an empty project ID to `useEnvironments` when the card is hidden.</violation>

<violation number="3" location="apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx:15">
P2: When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after `projects[0]`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment on lines +14 to +16
const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
const firstProject = projects[0]
const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: After dismissal, this component still fetches projects and environments even though it always returns null. Include isVisible in the project query enablement and pass an empty project ID to useEnvironments when the card is hidden.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 14:

<comment>After dismissal, this component still fetches projects and environments even though it always returns `null`. Include `isVisible` in the project query enablement and pass an empty project ID to `useEnvironments` when the card is hidden.</comment>

<file context>
@@ -0,0 +1,80 @@
+  const { organizationId = '' } = useParams({ strict: false })
+  const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+  const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+  const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+  const firstProject = projects[0]
+  const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })
</file context>
Suggested change
const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
const firstProject = projects[0]
const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })
const { data: projects = [] } = useProjects({
organizationId,
enabled: isAgenticWorkflowEnabled && isVisible,
})
const firstProject = projects[0]
const { data: environments = [] } = useEnvironments({
projectId: isAgenticWorkflowEnabled && isVisible ? (firstProject?.id ?? '') : '',
})

const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
const firstProject = projects[0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after projects[0].

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 15:

<comment>When the first project has no environments, the card disappears even if another project has an environment. Select the first project with an available environment, rather than stopping after `projects[0]`.</comment>

<file context>
@@ -0,0 +1,80 @@
+  const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+  const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+  const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+  const firstProject = projects[0]
+  const { data: environments = [] } = useEnvironments({ projectId: firstProject?.id ?? '' })
+  const firstEnvironment = environments[0]
</file context>

export function SectionAgentTasksHighlight() {
const { organizationId = '' } = useParams({ strict: false })
const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by organizationId so dismissal applies only to the current organization.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/console/src/app/components/section-agent-tasks-highlight/section-agent-tasks-highlight.tsx, line 13:

<comment>Dismissing this card in one organization hides it in every organization opened in the same browser because the storage key is global. Scope the key by `organizationId` so dismissal applies only to the current organization.</comment>

<file context>
@@ -0,0 +1,80 @@
+export function SectionAgentTasksHighlight() {
+  const { organizationId = '' } = useParams({ strict: false })
+  const isAgenticWorkflowEnabled = Boolean(useFeatureFlagEnabled('argentic-workflow'))
+  const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
+  const { data: projects = [] } = useProjects({ organizationId, enabled: isAgenticWorkflowEnabled })
+  const firstProject = projects[0]
</file context>
Suggested change
const [isVisible, setIsVisible] = useLocalStorage(AGENT_TASKS_HIGHLIGHT_VISIBLE_KEY, true)
const [isVisible, setIsVisible] = useLocalStorage(`agent-tasks-highlight-visible-${organizationId}`, true)

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.43%. Comparing base (422c02b) to head (78b6022).

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2976      +/-   ##
===========================================
- Coverage    50.08%   49.43%   -0.66%     
===========================================
  Files         1349      710     -639     
  Lines        29144    17376   -11768     
  Branches      8574     5205    -3369     
===========================================
- Hits         14596     8589    -6007     
+ Misses       12152     7406    -4746     
+ Partials      2396     1381    -1015     
Flag Coverage Δ
unittests 49.43% <ø> (-0.66%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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