Skip to content

[poc]feat: Devfile Creator and Workspace Loader with AI Agent#1515

Open
olexii4 wants to merge 16 commits into
mainfrom
devfile_creator
Open

[poc]feat: Devfile Creator and Workspace Loader with AI Agent#1515
olexii4 wants to merge 16 commits into
mainfrom
devfile_creator

Conversation

@olexii4
Copy link
Copy Markdown
Contributor

@olexii4 olexii4 commented Apr 15, 2026

What does this PR do?

Adds a Devfile Creator feature to the Eclipse Che Dashboard — a full-lifecycle devfile authoring tool with an embedded AI agent that helps users build and refine devfiles interactively. Also extends the Workspace Loader with a DevWorkspace editor tab and AI agent integration for troubleshooting failing workspaces.

Devfile Creator List Page (/devfiles)

  • New navigation entry "Devfiles" in the sidebar with a list of user-created devfiles.
  • Create new devfiles, delete existing ones, and navigate to the detail/editor page.

Devfile Detail / Editor Page (/devfile/:namespace/:devfileName)

  • YAML Editor (CodeMirror 6) with inline devfile schema validation, autocompletion, and syntax highlighting.
  • Validation error display below the editor showing the first schema error (line, column, message).

Workspace Loader — DevWorkspace Tab

  • DevWorkspace editor tab added to the workspace loader page with full YAML editing capabilities.
  • DevWorkspace JSON schema validation — editor uses the DevWorkspace CRD schema (separate from devfile schema) for validation and autocompletion.
  • AI agent integration — same agent panel available for troubleshooting failing workspaces, with init command context describing the workspace failure.

Backend API

Devfile Creator API (/dashboard/api/devfile-creator/namespace/:namespace)
  • REST endpoints for CRUD operations on devfiles stored in the ConfigMap.
  • Raw devfile endpoint (/:id/raw) returns the YAML content directly (used by Create Workspace factory flow).
Agent API (/dashboard/api/agents/namespace/:namespace)
  • Agent pod create/delete endpoints.
  • Terminal URL discovery endpoint.
  • Reverse-proxy for the gritty terminal WebSocket (avoids CORS/auth issues - browser can
    only talk to the dashboard origin.).
AI Agent Registry API (/dashboard/api/ai-agent-registry)
  • Reads agent definitions from a cluster-level ConfigMap using a label selector.
  • Uses SERVICE_ACCOUNT_TOKEN for Kubernetes API authentication.
Schema APIs
  • GET /dashboard/api/devfile?version= — serves static devfile JSON schemas (versions 2.0.0 – 2.3.0).
  • GET /dashboard/api/devworkspace-schema — serves the DevWorkspace CRD JSON schema.
WebSocket Channels
  • CONFIGMAP_WATCH — real-time ConfigMap change notifications for editor sync.
  • AGENT_POD_STATUS — agent pod phase and readiness updates.

Terminal Theming

  • AgentTerminal component wraps a gritty iframe with bi-directional theme sync.
  • Light/dark theme applied to the xterm.js terminal inside the iframe via CSS injection.

CodeMirror Editor

  • Custom CodeMirror 6 integration (DevfileEditor component) with:
    • YAML syntax highlighting
    • JSON Schema-driven linting (Ajv validation → CodeMirror diagnostics)
    • JSON Schema-driven autocompletion

Screenshot/screencast of this PR

Знімок екрана 2026-04-27 о 16 33 43

Demo link

What issues does this PR fix or reference?

Proof of Concept: Devfile Creator with AI Agent

Is it tested? How?

Repositories

  1. olexii4/che-dashboard-agent — AI agent container image and skills. Used to create the AI Agent Registry ConfigMap that registers available agents in the cluster.
  2. olexii4/database-app — A test project (Node.js + MySQL) for testing the AI agent's devfile generation capabilities.

Manual testing

1. Prepare Eclipse Che with AI Authentication
  1. Deploy Eclipse Che with the dashboard image from this PR
  2. Follow the AI Authentication for DevWorkspaces guide to configure AI tool authentication — this sets up the ANTHROPIC_API_KEY secret with controller.devfile.io/mount-as=env annotation so it auto-mounts into agent pods
  3. Apply the AI Agent Registry ConfigMap from olexii4/che-dashboard-agent to register the agent in the cluster
2. Create a devfile with the AI Agent
  1. Navigate to the Devfiles page in the sidebar
  2. Click Create Devfile — a new empty devfile is created and the detail page opens
  3. Click Start Agent to launch the AI agent
  4. Wait for the agent terminal to connect
  5. In the agent terminal, paste:
    add the project https://github.com/olexii4/database-app.git , corresponding containers and commands
    
  6. Wait for the agent to generate the devfile — the editor should update in real time via ConfigMap watch
  7. Verify the generated devfile contains: project definition, container components with correct images, args: [tail, '-f', /dev/null] on non-UDI containers, and build/run commands
3. Create and test the workspace
  1. Click the Create Workspace button in the editor toolbar (should be enabled when devfile has no validation errors)
  2. The Create Workspace page opens with the devfile URL pre-filled
  3. Start the workspace and wait for it to reach Running state
  4. Open the workspace IDE and test the commands defined in the devfile (install, build, start MYSQL server, run, etc.)
4. Test workspace troubleshooting with the AI Agent
  1. Stop the workspace
  2. Open the created devfile in the Devfiles page
  3. Edit the devfile — remove args from the non-UDI containers (e.g. nodejs, mysql):
    args:
      - tail
      - '-f'
      - /dev/null
  4. Save the devfile and create a new workspace from it
  5. The workspace should fail to start with error: Container nodejs has state [postStart hook] failed with an unknown error (see pod events or container logs for more details)
  6. On the workspace loader page, the DevWorkspace tab should appear — click it
  7. Click Start Agent to launch the AI agent for troubleshooting
  8. The agent should diagnose the postStart hook failure, identify the missing args, and suggest adding them back
  9. Apply the fix in the DevWorkspace editor, save, and restart the workspace
  10. Verify the workspace starts successfully

@che-bot
Copy link
Copy Markdown
Contributor

che-bot commented Apr 15, 2026

Click here to review and test in web IDE: Contribute

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olexii4

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olexii4 olexii4 force-pushed the devfile_creator branch 2 times, most recently from fa13de6 to c7681f7 Compare April 17, 2026 02:52
Comment thread packages/dashboard-backend/src/routes/api/aiAgentRegistry.ts Fixed
@olexii4 olexii4 force-pushed the devfile_creator branch 2 times, most recently from 9a70845 to b656324 Compare April 17, 2026 13:02
Comment thread packages/dashboard-backend/src/routes/api/agents.ts Fixed
@olexii4 olexii4 force-pushed the devfile_creator branch 2 times, most recently from 28d6567 to e59939f Compare April 18, 2026 01:35
Comment thread packages/dashboard-backend/src/routes/api/aiAgentRegistry.ts Fixed
@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

5 similar comments
@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

Comment thread packages/dashboard-backend/src/routes/api/agents.ts Fixed
@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

6 similar comments
@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@github-actions
Copy link
Copy Markdown

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

olexii4 added 15 commits May 5, 2026 16:44
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Sonnet 4.5
Signed-off-by: Oleksii Orel <oorel@redhat.com>
…nal integration

Assisted-by: Claude Opus 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Assisted-by: Claude Opus 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Add comprehensive unit tests for Devfile Creator components, stores,
containers, pages, and services to meet the 92%/85% coverage thresholds.

Assisted-by: Claude Opus 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 force-pushed the devfile_creator branch from 78e62f6 to 8806c77 Compare May 5, 2026 14:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1515 (linux/amd64, linux/arm64)

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1515", name: che-dashboard}]}}]"

@eclipse-che eclipse-che deleted a comment from codecov Bot May 6, 2026
@olexii4
Copy link
Copy Markdown
Contributor Author

olexii4 commented May 6, 2026

/retest

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 82.96703% with 1147 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.57%. Comparing base (ad9a2cf) to head (8806c77).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
...ackages/dashboard-backend/src/routes/api/agents.ts 46.09% 283 Missing ⚠️
...d-backend/src/routes/api/helpers/terminal/index.ts 13.52% 147 Missing ⚠️
...dashboard-frontend/src/containers/Loader/index.tsx 57.67% 113 Missing ⚠️
...d-frontend/src/containers/DevfileDetails/index.tsx 71.38% 92 Missing and 1 partial ⚠️
...kages/dashboard-backend/src/routes/api/devfiles.ts 62.71% 85 Missing ⚠️
...shboard-backend/src/routes/api/helpers/agentPod.ts 87.03% 80 Missing ⚠️
...c/devworkspaceClient/services/configMapWatchApi.ts 35.53% 78 Missing ⚠️
...rd-frontend/src/components/DevfileEditor/index.tsx 82.33% 45 Missing and 2 partials ⚠️
...ages/dashboard-frontend/src/pages/Loader/index.tsx 76.47% 40 Missing ⚠️
...rd-backend/src/routes/api/helpers/devfile/index.ts 78.26% 35 Missing ⚠️
... and 27 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1515      +/-   ##
==========================================
- Coverage   92.52%   91.57%   -0.96%     
==========================================
  Files         562      609      +47     
  Lines       55927    63630    +7703     
  Branches     4224     4852     +628     
==========================================
+ Hits        51746    58266    +6520     
- Misses       4134     5303    +1169     
- Partials       47       61      +14     

☔ View full report in Codecov by Sentry.
📢 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.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 23, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

olexii4 added a commit that referenced this pull request May 28, 2026
WCAG 2.2.2 (Pause, Stop, Hide, Level A) requires a mechanism to stop
any auto-updating animation lasting more than 5 seconds. The workspace
start page showed a continuous spinner with no way to stop the process.

Add a kebab actions dropdown (EllipsisVIcon) to the loader page header,
matching the pattern used in PR #1515. The dropdown contains:
- Start: enabled when workspace is stopped/failed, calls startWorkspace()
- Stop:  enabled when workspace is starting/running, calls stopWorkspace()

Implementation follows PR #1515:
- Header: accepts optional 'actions' prop rendered right-aligned
- LoaderPage: builds the Dropdown with Start/Stop DropdownItems;
  visible only when a workspace object exists (not during factory-create)
  workspaceStatus is passed explicitly (not derived inside the page)
- LoaderContainer: connects startWorkspace + stopWorkspace dispatch,
  derives workspaceStatus, forwards onStartWorkspace/onStopWorkspace

Signed-off-by: Oleksii Orel <oorel@redhat.com>
olexii4 added a commit that referenced this pull request May 28, 2026
WCAG 2.2.2 (Pause, Stop, Hide, Level A) requires a mechanism to stop
any auto-updating animation lasting more than 5 seconds. The workspace
start page showed a continuous spinner with no way to stop the process.

Add a kebab actions dropdown (EllipsisVIcon) to the loader page header,
matching the pattern used in PR #1515. The dropdown contains:
- Start: enabled when workspace is stopped/failed, calls startWorkspace()
- Stop:  enabled when workspace is starting/running, calls stopWorkspace()

Also preserve Events tab content after stopping: remove the STOPPED
guard in WorkspaceEvents so users can review startup events after
pressing Stop (the event data stays in the Redux store and is still
useful for debugging a failed start).

Implementation follows PR #1515:
- Header: accepts optional 'actions' prop rendered right-aligned
- LoaderPage: builds the Dropdown with Start/Stop DropdownItems;
  visible only when a workspace object exists
- LoaderContainer: connects startWorkspace + stopWorkspace dispatch

Signed-off-by: Oleksii Orel <oorel@redhat.com>
olexii4 added a commit that referenced this pull request May 28, 2026
WCAG 2.2.2 (Pause, Stop, Hide, Level A) requires a mechanism to stop
any auto-updating animation lasting more than 5 seconds. The workspace
start page showed a continuous spinner with no way to stop the process.

Add a kebab actions dropdown (EllipsisVIcon) to the loader page header,
matching the pattern used in PR #1515. The dropdown contains:
- Start: enabled when workspace is stopped/failed, calls startWorkspace()
- Stop:  enabled when workspace is starting/running, calls stopWorkspace()

Also preserve Events tab on the loader page after stopping: add
hideWhenStopped prop to WorkspaceEvents (default true, keeping the
original behavior on WorkspaceDetails). Set hideWhenStopped={false}
on the loader page so startup events remain visible after pressing Stop.
The Workspace Details page still hides events when the workspace is
STOPPED.

Implementation follows PR #1515:
- Header: accepts optional 'actions' prop rendered right-aligned
- LoaderPage: builds the Dropdown with Start/Stop DropdownItems;
  passes hideWhenStopped={false} to WorkspaceEvents
- LoaderContainer: connects startWorkspace + stopWorkspace dispatch

Signed-off-by: Oleksii Orel <oorel@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants