framely / community

MIT License
0 stars 2 forks source link

[Bug]: DirectlyFillAction error #17

Closed yigexu closed 2 years ago

yigexu commented 2 years ago

Is there an existing issue for this?

Current Behavior

Let me know if this is my bug, or yours. The only change I (consciously) made is add mv entry confirmation. You could check it out at https://framely.naturali.io/org/6209b54dff5c77cdfc255577/agent/6209b808ff5c77cdfc256ce6/frame/620ca46d6fee3e8aaeb46144/slot/6214571433a75aab1591a07a

Screen Shot 2022-02-23 at 3 24 06 PM

07:19:45.815 [http-nio-8080-exec-10] ERROR i.framely.dispatcher.FrameController - fail to response for query : first; error : java.lang.ClassCastException: class kotlin.Unit cannot be cast to class java.lang.String (kotlin.Unit is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap') java.lang.ClassCastException: class kotlin.Unit cannot be cast to class java.lang.String (kotlin.Unit is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap') at restaurant002.restaurantC214.CustomSpiceNoodle$createBuilder$1$invoke$1.set(restaurant002_restaurantC214.kt:447) at io.framely.core.AnnotatedWrapperFiller.directlyFill(filler.kt:484) at io.framely.core.DirectlyFillAction.run(compiled.kt:310) at io.framely.core.DirectlyFillActionBySlot.run(compiled.kt:329) at io.framely.core.SeqResponseAction.run(action.kt:685) at io.framely.core.MapResponseAction.run(action.kt:755) at io.framely.core.SeqAction.run(action.kt:721) at io.framely.core.SlotDoneAction.run(action.kt:517) at io.framely.core.SlotPostAskAction.run(action.kt:496) at io.framely.core.DialogManager.response(execution.kt:103)

Expected Behavior

/

Use Case

/

Steps To Reproduce

Screen Shot 2022-02-23 at 3 22 18 PM

Label of org.project

restaurant002 /restaurantC214

Framely Link

https://framely.naturali.io/org/6209b54dff5c77cdfc255577/agent/6209b808ff5c77cdfc256ce6/intent?page=0&imported=false&search=

Test Case

No response

Additional information

No response

Zeng666666 commented 2 years ago

triage 是创建时的初始默认状态,如果被 remove,自动化时,机器人便找不到该 issue; todo 是 after discussion,相关负责人已经决定要做、但还没开始做的状态(因为相关负责人手头上可能还有没有完成的工作,所以标记为 todo;

就像所有的 order 都有状态一样,不应该出现有一个 order 没有状态的情况。

假设我们有上千个 issue,人工肯定是无法准确追踪的,bot 会根据 label 进行追踪,如果没有 process label,该 issue 便会沉没。未来我们会有自动 close 的 action,当 issue 符合被 close 的条件时,就会被自动 closed。

文档中有说明,具体可见: https://naturali-io.feishu.cn/docs/doccnWbeD1KcWVdooQZAcw0nAqh

image

image

Zeng666666 commented 2 years ago

简单来讲,就是“最淡的黄色”是 issue 的默认初始状态

XiaoboYuan commented 2 years ago

看上去是在某个conditional state update里面,fill slot action试图把一个没有返回值的fucntion赋值给一个string @yigexu

yigexu commented 2 years ago

我开始也觉得的是state update的问题,但是state update里面set 的 target是mv slot,没有string这个type。以及它的source是slot,所以也不应该有unit

On Wed, 23 Feb 2022 at 16:29, Xiaobo Yuan @.***> wrote:

看上去是在某个conditional state update里面,fill slot action试图把一个没有返回值的fucntion赋值给一个string @yigexu https://github.com/yigexu

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#issuecomment-1048545619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRUKG5SMSTYEVXUSW67RGDU4SLIHANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

yigexu commented 2 years ago

我刚才看了一下平台,regardless state update的设置,我这里唯一一个unit返回值的函数是clearShoppingCart,which定义在response中还远远没对话到那里 @XiaoboYuan

XiaoboYuan commented 2 years ago

image @yigexu 问题应该在这

yigexu commented 2 years ago

我的。

xiaoyunwu commented 2 years ago

can you think about what we can do to prevent this from happening for builder?

On Wed, Feb 23, 2022 at 12:47 AM yigexu @.***> wrote:

Closed #17 https://github.com/framely/community/issues/17.

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#event-6123324113, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYKUMC3X3CSUSLPRFLAB3U4SNJ7ANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were assigned.Message ID: @.***>

yigexu commented 2 years ago

对我来说,“this”可以定义为:builder 知道怎么设置正确,但是因为种种原因,忘记完成所有的设置(实际上,我不是忘记设置code expression,而是在临时尝试各种方案后,忘记最终删除这条annotation) 我觉得这个问题太大了,目前很难抽象;优先级上也不应该现在去处理。

如果只是想prevent再次发生specifically这一类场景,那么

  1. 从逻辑上看的方案是:我们梳理platform上带有赋值操作的annotation的设计,要求操作符右侧不可为空白。state update选择fill slot后的作为target的code expression是其中一例。
  2. 需要runtime验证的方案是:platform限制code expression输入框 (不包括 code expression 以${}注入形式中括号内) 的内容不可为空。

On Wed, 23 Feb 2022 at 23:33, xiaoyun wu @.***> wrote:

can you think about what we can do to prevent this from happening for builder?

On Wed, Feb 23, 2022 at 12:47 AM yigexu @.***> wrote:

Closed #17 https://github.com/framely/community/issues/17.

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#event-6123324113, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABJYKUMC3X3CSUSLPRFLAB3U4SNJ7ANCNFSM5PDQ3I4A

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

You are receiving this because you were assigned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#issuecomment-1048908595, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRUKG2BQ4FXAAM26V4QWSTU4T44PANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you modified the open/close state.Message ID: @.***>

Zeng666666 commented 2 years ago

这个目前前端没有这方面的逻辑,Dialogflow CX 是这样做的: image

Zeng666666 commented 2 years ago

因为前端的自动保存,只是保存数据,数据是分开储存的,储存时无法即刻、实时校验

image

xiaoyunwu commented 2 years ago

runtime means where the program is running. many program/chatbot will not run on our platform. So platform is not a good place for runtime error.

On Wed, Feb 23, 2022 at 9:33 PM zeng @.***> wrote:

因为前端的自动保存,只是保存数据,数据是分开储存的,储存时无法即刻、实时校验

[image: image] https://user-images.githubusercontent.com/37056884/155463863-21896c1c-d6eb-404d-8587-438d0a9f5caa.png

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#issuecomment-1049510228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYKUJXVCGPKHS4FUXPNLDU4W7IZANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were assigned.Message ID: @.***>

xiaoyunwu commented 2 years ago

:我们梳理platform上带有赋值操作的annotation的设计,要求操作符右侧不可为空白。 @lu zeng @.***> can we try this?

On Wed, Feb 23, 2022 at 9:35 PM Sean Wu @.***> wrote:

runtime means where the program is running. many program/chatbot will not run on our platform. So platform is not a good place for runtime error.

On Wed, Feb 23, 2022 at 9:33 PM zeng @.***> wrote:

因为前端的自动保存,只是保存数据,数据是分开储存的,储存时无法即刻、实时校验

[image: image] https://user-images.githubusercontent.com/37056884/155463863-21896c1c-d6eb-404d-8587-438d0a9f5caa.png

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#issuecomment-1049510228, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJYKUJXVCGPKHS4FUXPNLDU4W7IZANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were assigned.Message ID: @.***>

yigexu commented 2 years ago

@xiaoyunwu 第二种方案我说的可能不是很清楚。我的意思是: 当 code expression 的输入框内容是空白时,run time 计算出来,它也一定是空白。我现有的经验告诉我,runtime不接受code expression被执行完是空白;但是在实现层面上,我只能推导,要想 100% sure需要晓波确认。

我的推导是:我认为 code expression 输入框前后都是由 runtime 的代码 encode的。假设code expression输入框内填的是A,那么: 输入框用作condition时,runtime 的代码应该大致是:if (A); 输入框用作 fill slot时,runtime的代码可能可以抽象成 some slot = A 如果没做过什么特殊处理,A是空白肯定会compile失败。

这些分析是可以静态地做出来的。

yigexu commented 2 years ago

或者没必要确认,因为要求coide expression输入框内不能为空白是更强的限制。

On Thu, 24 Feb 2022 at 14:25, yigexu @.***> wrote:

@xiaoyunwu https://github.com/xiaoyunwu 第二种方案我说的可能不是很清楚。我的意思是: 当 code expression 的输入框内容是空白时,run time 计算出来,它也一定是空白。我现有的经验告诉我,runtime不接受code expression被执行完是空白;但是在实现层面上,我只能推导,要想 100% sure需要晓波确认。

我的推导是:我认为 code expression 输入框前后都是由 runtime 的代码 encode的。假设code expression输入框内填的是A,那么: 输入框用作condition时,runtime 的代码应该大致是:if (A); 输入框用作 fill slot时,runtime的代码可能可以抽象成 some slot = A 如果没做过什么特殊处理,A是空白肯定会compile失败。

这些分析是可以静态地做出来的。

— Reply to this email directly, view it on GitHub https://github.com/framely/community/issues/17#issuecomment-1049534735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRUKG4TTQFIU6J7JXCYWZTU4XFPLANCNFSM5PDQ3I4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

Zeng666666 commented 2 years ago

:我们梳理platform上带有赋值操作的annotation的设计,要求操作符右侧不可为空白。 @lu zeng @.> can we try this? On Wed, Feb 23, 2022 at 9:35 PM Sean Wu @.> wrote: runtime means where the program is running. many program/chatbot will not run on our platform. So platform is not a good place for runtime error. On Wed, Feb 23, 2022 at 9:33 PM zeng @.> wrote: > 因为前端的自动保存,只是保存数据,数据是分开储存的,储存时无法即刻、实时校验 > > [image: image] > https://user-images.githubusercontent.com/37056884/155463863-21896c1c-d6eb-404d-8587-438d0a9f5caa.png > > — > Reply to this email directly, view it on GitHub > <#17 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ABJYKUJXVCGPKHS4FUXPNLDU4W7IZANCNFSM5PDQ3I4A > . > Triage notifications on the go with GitHub Mobile for iOS > https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 > or Android > https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. > > You are receiving this because you were assigned.Message ID: > @.> >

防守是一种方法,引导同样也是。

而防守法,防的是 builder 应填而未填的内容。

image