Dayward AIWeChat Mini Program
Frontend Agent UX in 7 Days: From Streaming to Generative UI
Week 1 · D3🔒 LockedAbout 4 hours

Tool Call Visualization and Humans in the Loop: Interruption Is Not Local Interception

Merge the three-part tool call events into a stateful card so users can see what the agent is doing, then implement human-in-the-loop approval and get right the thing most teams get wrong: approval is an interrupt and resume of a run, not a modal the frontend throws up to block a request.

Today's goals 0/3

Sign in to tick these off and save your progress.

Today's Goals

  1. Merge the start, args, end, and result events of a tool call into one stateful card
  2. Explain why tool arguments arrive as a streamed string, and what the UI should show while they are incomplete
  3. Implement approval as interrupt and resume, and say where locally intercepted approval breaks down

The first two days were about displaying what the model says well. Today we handle the model doing things — the heart of the trust problem. When you finish, scroll back up and tick the three goals off.

Plain-Language Walkthrough

"One moment, let me check that term"

Occasionally at a conference you hear this: the speaker uses an obscure technical word, the interpreter hesitates, then says into the microphone "one moment, let me confirm that term", flips through a reference for a few seconds, and continues with "that word was...".

Notice how the audience feels during those seconds. They do not think the interpreter is incompetent — they trust them more, because the interpreter said out loud what they were doing. Had the interpreter simply gone silent for five seconds and resumed, the audience would have assumed the equipment failed.

An agent calling a tool is in exactly this position. It needs to query a database, read a file, make a request, and all of that takes time. If the interface only spins during that window, the user does not know what it is doing or how much longer to wait. If instead the interface plainly shows "calling search_documents with these arguments", the user is not only less anxious but more inclined to trust the result, because they watched it happen.

Exposing the intermediate steps rather than hiding them in a black box is one of the sharpest dividing lines between an agent interface and an ordinary chat interface.

Sign in and link WeChat to read

Sign in, then link your WeChat mini program account on the account page. Linked accounts share one free article per day. Unlock additional articles with rewarded videos in the mini program.

Mini program QR code

Scan in WeChat to open Dayward AI. Open the same course and chapter, choose the rewarded video, then refresh this page after completion.

Interview questions

  • Why implement human-in-the-loop approval as run interruption and resumption rather than a frontend modal that blocks the request?为什么人在回路的审批要做成运行中断加恢复,而不是前端弹窗拦住请求?
    Common in ChinaCommon overseasDeep dive#human-in-the-loop#security#protocol-design

    🔒 Unlock this chapter to see the answer keys.

  • Tool call arguments arrive as streamed fragments. What should the UI display before they are complete?工具调用的参数是一段段流式拼出来的,界面在参数还没拼完时应该显示什么?
    Common in ChinaCommon overseasIntermediate#tool-calling#streaming#ui-state

    🔒 Unlock this chapter to see the answer keys.

  • The user rejects a tool call. What should your system do next?用户拒绝了一个工具调用,你的系统接下来应该怎么处理?
    Common in ChinaCommon overseasBasic#ux#error-handling#human-in-the-loop

    🔒 Unlock this chapter to see the answer keys.

  • An agent fires three tool calls concurrently and their events interleave on arrival. How do you keep them straight?Agent 并发发起了三个工具调用,事件交错着到达前端,你怎么保证它们各自归位?
    Common in ChinaCommon overseasIntermediate#streaming#state-management#tool-calling

    🔒 Unlock this chapter to see the answer keys.

Comments