Skip to content

OLS-2722: olsToolUIs initial support#1576

Draft
iNecas wants to merge 2 commits intoopenshift:mainfrom
iNecas:ols-tool-ui
Draft

OLS-2722: olsToolUIs initial support#1576
iNecas wants to merge 2 commits intoopenshift:mainfrom
iNecas:ols-tool-ui

Conversation

@iNecas
Copy link

@iNecas iNecas commented Mar 2, 2026

Allows plugins to define 'ols.tool-ui' extensions to map the tools to react components to be rendered when the tool gets called.

Sample extensions registration:

{
  "type": "ols.tool-ui",
  "properties": {
    "id": "my-obs/my-tool",
    "component": {
      "$codeRef": "MyToolUI"
    }
  }
}

The ToolUI implemntation receives the tool details in it's argument:

type MyTool = {
  name: 'my-tool';
  args: object,
  // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
  // component implementation
}

Depends on openshift/lightspeed-service#2779

This allows monitoring-plugin to define a UI for obs-mcp tools
image

Related changes leveraging this feature:

@iNecas iNecas marked this pull request as draft March 2, 2026 15:40
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2026
@openshift-ci openshift-ci bot requested review from syedriko and xrajesh March 2, 2026 15:41
@openshift-ci
Copy link

openshift-ci bot commented Mar 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xrajesh for approval. For more information see the Code Review Process.

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

@iNecas iNecas changed the title olsToolUIs initial support OLS-2722: olsToolUIs initial support Mar 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 6, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 6, 2026

@iNecas: This pull request references OLS-2722 which is a valid jira issue.

Details

In response to this:

Allows plugins to define 'ols.tool-ui' extensions to map the tools to react components to be rendered when the tool gets called.

Sample extensions registration:

{
 "type": "ols.tool-ui",
 "properties": {
   "id": "my-obs/my-tool",
   "component": {
     "$codeRef": "MyToolUI"
   }
 }
}

The ToolUI implemntation receives the tool details in it's argument:

type MyTool = {
 name: 'my-tool';
 args: object,
 // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
 // component implementation
}

Depends on openshift/lightspeed-service#2779

This allows monitoring-plugin to define a UI for obs-mcp tools
image

Related changes leveraging this feature:

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Member

@kyoto kyoto left a comment

Choose a reason for hiding this comment

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

Looks good @iNecas. Thanks!

Just 2 minor comments and could you please run npm run lint-fix to address the lint errors and rebase?

import type { OlsToolUIComponent } from '../types';

type ToolUIExtensionProperties = {
/** Id of the component (as refferrenced by the mcp tool) */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** Id of the component (as refferrenced by the mcp tool) */
/** ID of the component (as referenced by the MCP tool) */

Comment on lines +13 to +16
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => {
const ToolComponent = toolUIElement;
return <ToolComponent tool={tool} />;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => {
const ToolComponent = toolUIElement;
return <ToolComponent tool={tool} />;
};
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: ToolComponent }) => {
return <ToolComponent tool={tool} />;
};

@kyoto
Copy link
Member

kyoto commented Mar 17, 2026

Also, we should add a brief description of how to use this extension to the README

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2026
@openshift-merge-robot
Copy link

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.

kyoto and others added 2 commits March 26, 2026 10:42
Allow callers to immediately submit the prompt when opening OLS by
passing submitImmediately: true

Made-with: Cursor
Allows plugins to define 'ols.tool-ui' extensions to map the tools
to react components to be rendered when the tool gets called.

Sample extensions registration:

```json
{
  "type": "ols.tool-ui",
  "properties": {
    "id": "my-obs/my-tool",
    "component": {
      "$codeRef": "MyToolUI"
    }
  }
}
```

The ToolUI implemntation receives the tool details in it's argument:

```ts
type MyTool = {
  name: 'my-tool';
  args: object,
  // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
  // component implementation
}
```
@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8238bb2-e9e1-48b1-aa2e-169d820763c1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 26, 2026
@iNecas
Copy link
Author

iNecas commented Mar 26, 2026

I've rebased and fixed an issue where we were visualizing the tool calls in failed state as well.

I will proceed with final cleanup and will switch to non-draft state for final review after that.

@kyoto
Copy link
Member

kyoto commented Mar 26, 2026

@iNecas Probably also a good idea to wrap the OlsToolUIs in an <ErrorBoundary>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants