Repository navigation
Approval is unreachable from a UI-initiated Remote call: no open turn, no agent #11178
zhangj1164
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
One line
A
@Remotemethod invoked from a client panel has no compliant way to ask a human for confirmation.ctx.approval.request()requires an open turn and anagent; a call made between interactions has neither. The alternatives left to a plugin author are a self-issued token or a client-side dialog, and neither of them is an approval.Verified on
0.2.1-rc.2(latest) and0.2.1-rc.4(next)dsh-user-approvalrequest()throwsapproval.request() outside an open turn: the approval/asked + approval/decided audit pair must be turn-enclosed…before appending anything. The constraint is identical in rc.2 and rc.4.request()throws without an open turn, and a panel-initiated call has no turn to be inside of.Why the usual workarounds do not close it
ctx.userQuestions.ask(): no turn requirement, but in the Web profile the forwarding listener (dsh-api-remotes,user-questions/requestwaterfall) throwsforwarded scoped event "user-questions/request" must carry its Agent directlywhenagentis absent, so an agent-less ask has no client to render it and fails closed; an agent-scoped ask additionally requires the exact live root agent. A question is also not an approval: noapproval/asked/approval/decidedaudit, and noask/neverpolicy.What this cost us
Our one sensitive method (
readExternalPath, which reads an arbitrary host path) had no caller, so we removed its@Remoteregistration and kept it host-internal — narrowing the surface rather than faking a confirmation (details: zhangj1164/dsh-mega-plugins#95). That retreat works for that method, but the next "user clicks → host performs a sensitive action" hits the same wall, which is why I am reporting the general case.Ask
Either of these would settle it:
Related threads: #9551 (a plugin ctx cannot observe
approval/request), #6989 (approvals after a restart). Neither covers an ask that never happens inside a turn.All reactions