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

@olexii4 olexii4 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

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

che-bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@openshift-ci

openshift-ci Bot commented Apr 15, 2026

Copy link
Copy Markdown

[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 a commit that referenced this pull request Jun 3, 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>
artaleks9 pushed a commit that referenced this pull request Jun 4, 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>
@github-actions

Copy link
Copy Markdown

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

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, linux/s390x)

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 16 commits July 20, 2026 16:23
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>
- Remove IUserProfileApi from devworkspaceClient mocks (deleted in main
  via refactor: remove user profile API #1587)
- Remove duplicate 'actions' prop from Header component (artifact of
  conflict resolution)
- Add @codemirror/state and @codemirror/view to resolutions to prevent
  duplicate module instances between project-level and theme-one-dark's
  nested copy, which caused TypeScript type incompatibility errors
- Update EXCLUDED/prod.md with bumped @codemirror package versions
  (autocomplete 6.20.1→6.20.3, language 6.12.3→6.12.4,
  state 6.6.0→6.7.1, view 6.41.0→6.43.6) that resolved differently
  after yarn.lock regeneration
- Regenerate .deps/dev.md and .deps/prod.md for updated dependencies

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
@github-actions

Copy link
Copy Markdown

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

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}]}}]"

@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

@olexii4: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v19-dashboard-happy-path 909d136 link true /test v19-dashboard-happy-path

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-ci

openshift-ci Bot commented Aug 8, 2026

Copy link
Copy Markdown

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.

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.

4 participants