OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Trigger microagents on agent keywords

Open neubig opened this issue 9 months ago • 3 comments

What problem or use case are you trying to solve?

Currently microagents are triggered when the user mentions a keyword, but not when an agent mentions a keyword.

Describe the UX of the solution you'd like

Mentions of keywords by the agent should trigger the microagent.

neubig avatar Mar 25 '25 18:03 neubig

Is this really a bug? I do not think so. As long as you execute the slot functions in setup, you will get this warning, which has nothing to do with whether you use functional components to wrap it.

import { createApp, h, defineComponent } from 'vue'

const Comp = defineComponent({
  setup(props, { slots }) {
    // a warning raised, this is as expected
    const s = slots.default && slots.default()

    return () => s
  }
})

createApp({
  setup() {
    return () => h(Comp, () => 'sss')
  }
}).mount('#header')



HcySunYang avatar Feb 19 '21 04:02 HcySunYang

@HcySunYang But then I should get the warning too when I execute the MyComponent directly in App.vue (instead of MyContainer), right? But then there is no warning. so something seems to be wrong there...

A little bit of context of the bigger picture what I try to accomblish: I want to tell the parent component if any of the child components are considered "empty" (based on their data AND slot content). In vue2 those slots where just empty when no element was rendered (with functional components), but since vue3 I can't tell if the component has a v-if="false" on the root element. I just see the an array with the components or in some cases an entry of type "Symbol(Comment)" ($el is not accessible). So I guess I have to use provide and inject. But those need to be performed in setup (and not in render). So there seems to be no other way to invoke the slot function in setup, to determine if there is something to show.

plehnen avatar Feb 19 '21 08:02 plehnen

Ok, I made a PR to make the warning consistent when calling the slot function outside the render function.

However, more and more users request similar capabilities. They hope to call the slot function in the setup function to determine whether the slot content exists or meets expectations. Maybe we don’t need to report that warning message, but instead, emphasize it in the document.

HcySunYang avatar Feb 19 '21 13:02 HcySunYang

Fixed since 3.2.0

Repros in 3.2.0: https://codesandbox.io/p/sandbox/vue-warns-incorrectly-if-component-is-surrounded-by-functional-component-3257-rdvzmh

GeoffreyParrier avatar May 21 '25 12:05 GeoffreyParrier