Agent Processing State new Agent 处理状态 web
A visible status sequence that explains what an AI agent is doing between input and result
让用户看见 AI Agent 在输入和结果之间正在做什么的状态序列
- ✓Read requestInput understood
- 2Inspect filesSearching the project
- 3Prepare changesWaiting
标本可交互,可以直接操作。
Anatomy — every part, named解剖 —— 每个部件的名字
-
1 Processing step list处理步骤列表
<ol> + data-stateThe ordered phases the agent can pass through.
Agent 可能经过的有序阶段。
Prompt fragmentPrompt 片段an ordered list of named agent phases with completed, active, and pending states
一个列出 Agent 阶段的有序列表,区分已完成、当前和待处理
-
2 Active step当前步骤
data-state="active"The one phase currently doing work.
此刻正在执行的唯一阶段。
Prompt fragmentPrompt 片段one active row with a short verb phrase such as Searching sources or Preparing answer
一个活动行,用简短动词短语描述当前工作,例如正在搜索资料或准备回答
-
3 Processing status处理状态
role=statusA concise live announcement for meaningful transitions.
对有意义的阶段变化进行简短播报。
Prompt fragmentPrompt 片段a polite status region that announces phase changes without narrating every token
一个礼貌的状态区域,只播报阶段变化,不叙述每个 token
-
4 Cancel or retry action取消或重试操作
buttonA recovery path when waiting is optional or work fails.
等待可取消或工作失败时的恢复路径。
Prompt fragmentPrompt 片段a visible Cancel during work and Retry after an error, preserving the original request
执行中显示取消,错误后显示重试,并保留原始请求
Prompt — paste into your agentPrompt —— 直接粘贴给你的代理
Build an AI agent processing state as a compact step sequence: queued, thinking, using a tool, and complete/error. Keep one current step visually prominent, pair it with plain-language status text, announce only meaningful changes in role="status", expose a cancel or retry action when relevant, and preserve the full sequence when prefers-reduced-motion is enabled.
构建一个 Agent 处理状态,用紧凑的步骤序列展示排队、思考、调用工具和完成/失败。当前步骤要最突出,配上直白的状态文字;用 role="status" 只播报有意义的状态变化;在适用时提供取消或重试;开启 prefers-reduced-motion 时仍保留完整步骤序列。
Debug prompt — when it misbehaves调试 Prompt —— 当它不听话时
Debug my AI processing state. Check that every state comes from one explicit state machine; the active step cannot get stuck after a response or error; aria-live does not repeat every token; tool calls name the action and target; cancel and retry remain reachable; hidden/offscreen animation stops; and reduced motion leaves a clear static state marker. The symptom:
调试我的 Agent 处理状态。检查所有状态是否来自一个明确的状态机;回答或错误后活动步骤不能卡住;aria-live 不能逐帧重复播报;工具调用要说清动作和目标;取消和重试始终可达;隐藏或离屏后停止动画;减少动态效果时仍有清晰的静态状态标记。症状:
In code代码里叫什么
| Framework框架 | Symbol符号 | Note说明 |
|---|---|---|
| ARIA | role=status + aria-live | announce meaningful state changes, not every animation frame |
| Motion | state machine | keep queued, thinking, tool, success, and error states explicit |
| HTML | <ol> + data-state | preserve a readable step sequence when motion is disabled |
| CSS | prefers-reduced-motion | replace pulse with a static active marker |