Replies: 4 comments
|
Seeing #4270 carry What I want to fix is the silence inside the agent loop. Today, these text slots are often empty: A prompt change may already be enough to improve that. The model can say what it is about to do before the first non-trivial tool call, then update the user when it finds something important or changes direction. This works with Responses, Chat Completions, and Anthropic because they can all emit ordinary Assistant Text. For Responses, I would still preserve its native So the first slice I have in mind is small: update the prompt, and make sure Responses metadata survives replay. That solves the user-facing problem without asking Chat Completions and Anthropic to imitate a Responses-specific concept. It also avoids adding another authority that has to stay in sync across storage, Runtime Host, CLI, and UI. I prefer this shape because it keeps the common path KISS. The shared layer only models what the protocols actually share, while provider-specific information stays with the provider. This is only my current view. I may be missing a consumer or replay constraint that makes the broader phase model necessary, so please push back. I would rather work through those cases here before settling on the implementation. 中文#4270 把 我现在想解决的是 agent loop 中间没有文字的问题。模型在调用工具前、发现重要信息或改变方向时,输出普通的 Assistant Text 就够了。这是 Responses、Chat Completions 和 Anthropic 都有的能力。 Responses 原生的 这样第一阶段只需要改提示词,再确认 Responses metadata 能无损回放。公共层保持 KISS,也不会要求其他协议模拟 Responses,或者新增一套需要跨多个层级同步的 authority。 这只是我目前的判断。如果还有我没有考虑到的消费者或 replay 约束,欢迎直接 push back,我们可以继续在这里把它讨论清楚。 |
Implementation update after prompt-only testingI tested the smaller prompt-only direction proposed above and then followed the behavior through the Runtime, persistence, reconnect, CLI, TUI, and GUI paths. The experiment changed my conclusion in one important way: optional prompt guidance improves cooperative models, but it does not reliably create an observable update on phase-less providers. In a live test, a provider went directly to the work tools and emitted no progress text. The implementation in #4270 now uses this boundary:
This keeps the two visible layers separate:
The UI now reflects that hierarchy. During execution, commentary remains visible and the reasoning/tool records between updates sit in an inner processing disclosure. Once the final answer begins, all earlier work is moved under an outer duration disclosure and collapsed once. The final answer stays visible. A user's manual reopen is preserved. The provider-neutral phase now has concrete consumers rather than being metadata propagated in anticipation of a future UI:
Native OpenAI Responses phase remains native evidence only when the selected adapter actually preserves it. Open-responses compatibility adapters, Chat Completions, and Anthropic are treated as phase-less; Maka derives its own product semantic from step topology rather than claiming those protocols expose the Responses field. The cost is explicit: phase-less, tool-capable root turns make one additional provider request for the progress prelude. The benefit is a deterministic first user-visible update and stable final-answer identity across all consumers. Direct answers and native-phase providers avoid that cost. I also verified the full path with paid models:
For the latest Claude run, the durable sequence was: The PR includes matching before/after GUI captures and TUI/CLI coverage. It does not expose hidden reasoning or render the raw event log as commentary. |
Visual comparisonThese captures use the same persisted turn, viewport ( Flat baselineThis is the same turn rendered without the new outer work-log disclosure. Commentary, runtime activity, and the final answer have little visual separation: Settled turnWhen the final answer begins, prior commentary, reasoning, and runtime activity collapse under a duration header. The final answer stays in the normal transcript: Reopened work logManual expansion restores the model-authored commentary and the nested event-derived activity disclosure. This shows the intended hierarchy: commentary and activity are adjacent, but they remain different semantic layers. |
|
Thanks for running this against real paid models — that's the right way to test it. I've read through #4270, and I think the shape has grown past what the problem needs. Four things, roughly in order of how much they weigh on me. 1. providerPhase ?? (completedStep ? 'final_answer' : undefined)For phase-less providers, I'd keep it as a Responses/Codex adaptation: store it, preserve it faithfully, and let the adapter do the one check that genuinely needs the native value — a turn ending in explicit Most consumers don't need it. 2. Splitting the step budget worries me more than the field does. 3. The tool itself is heavier than the behaviour it buys. 4. And I don't think prompt-only has been ruled out yet. The evidence against it is one live run where a provider went straight to tools. Your original baseline was thorough — 50 artifacts, 43 rows, 6 turns — so I'd want the counter-evidence at a similar bar before we conclude the simpler path can't work: which model, how many attempts, and what the prompt said then. The current fragment is written around the tool, so it can't stand in for a prompt-only version. On the underlying goal — a user shouldn't stare at a silent turn — tool activity is already visible in the UI today. Making that a better summary is worth doing, and it needs neither The collapse hierarchy is a different matter, and the captures sold me on it. I'd keep that and the import fix and drop the cross-protocol parts. Since epoch 79 is a protocol break, I'd rather we agree before spending it. Tell me where I've got this wrong — especially on how narrow 简体中文感谢你拿真实的付费模型跑了验证——这是测试这件事的正确方式。我读了 #4270,觉得方案的形态已经超出问题本身的需要了。四点,大致按分量排序。 1. providerPhase ?? (completedStep ? 'final_answer' : undefined)对 phase-less 的 provider, 我倾向把它保留为 Responses/Codex 的适配:存下来、忠实保留,并让 adapter 去做那个唯一真正需要 native 值的检查——显式以 大多数消费者并不需要它。 2. 比起字段本身,拆分步数预算更让我担心。 3. 工具本身比它换来的行为更重。 4. 另外我认为 prompt-only 还没有被排除。 反对它的证据是一次实测中某个 provider 直接去调了工具。你原来的基线很扎实——50 个 artifact、43 行、6 个 turn——所以在断定更简单的路走不通之前,我希望反面证据也能达到类似标准:哪个模型、试了几次、当时的提示词是什么。现在这版片段是围绕工具写的,无法代表 prompt-only 版本。 至于底层目标——用户不该盯着一个沉默的 turn——工具活动今天在 UI 上本来就是可见的。把它做成更好的摘要值得做,而这既不需要 折叠层级是另一回事,截图说服了我。我会保留它和导入修复,去掉跨协议的那些部分。另外 epoch 79 是协议破坏性变更,我更希望先达成一致再花掉它。 如果哪里我判断错了,请直接指出——尤其是 (Drafted with AI assistance; I verified the adapter's phase source, the step-budget change, the CLI fallback, and the prompt fragment against #4270's diff myself.) |



Uh oh!
There was an error while loading. Please reload this page.
English
Summary
Maka should expose two separate kinds of in-turn observability:
They may appear next to each other in the conversation, but they are not the same channel and should not share one message type.
This proposal is about inline observability during an active turn. It does not propose exposing hidden reasoning, dumping raw event-log rows into the transcript, or changing the continuation model discussed in #3567.
Problem
Long-running Maka turns can currently feel silent: the model calls tools, the UI shows tool activity, and the first model-authored user-visible text often arrives only after the work is complete.
There are three separate causes:
ModelStreamEvent,TextDeltaEvent,TextCompleteEvent,RuntimeEventTextContent, andAssistantMessageall represent text without distinguishing commentary from the final answer (model protocol, session events, stored message).phase, and Maka preserves text-end provider metadata, but it remains provider-owned metadata rather than a normalized product semantic (adapter).The renderer is not fundamentally unable to show commentary. The timeline already preserves text/tool ordering, and
finalAssistantReplyText()explicitly describes text between tool calls as work-in-progress narration (source). The missing pieces are model behavior, normalized semantics, and distinct presentation.As one bounded observation rather than a project-wide benchmark, I inspected a recent local development workspace:
final_answerphases and nocommentaryphase.This supports the narrower diagnosis that Maka is generally not producing commentary today; it is not merely producing it and losing it in the renderer.
Product contract
Maka should treat four channels as distinct:
Commentary
Commentary is assistant-authored text. It can be contextual and personalized:
It costs output tokens, is persisted as model text, and may need to be replayed with its provider step.
Runtime activity
Runtime activity is derived from execution facts:
It must not be stored as assistant-authored text, included in model history, or charged as model output. The live form should be projected from
SessionEvents; the settled form should reconcile against durable messages andRuntimeEvents, following the existing live/durable tool-activity pattern. This is a compact projection over the event stream, not a raw event-log dump.Recommended architecture
1. Add a provider-neutral assistant text phase
Carry an optional
phasethrough the existing text lifecycle rather than adding parallelcommentary_delta/commentary_completeevent types:ModelStreamEvent;TextDeltaEventand authoritativeTextCompleteEvent;RuntimeEventTextContent;AssistantMessage;SessionAssistantDeltaand active stream state;phaseremains optional because providers do not emit it consistently. A completed text event is authoritative; live deltas may remain phase-unknown until metadata or step structure resolves them.Maka's Codex fixtures already contain both
phase: "commentary"andphase: "final_answer", while the current importer drops the field (fixture, importer). Preserving it would also fix imported-session fidelity.2. Normalize phase conservatively
Recommended precedence:
Two invariants matter:
final_answerfollowed by a tool call is contradictory. Treat it as commentary for product behavior and retain the raw provider metadata for diagnostics.phase=commentaryand no final answer, do not silently accept that commentary as the successful terminal response. Allow one bounded continuation when the normal step budget permits, then fail visibly if the protocol remains inconsistent.The second guard should use explicit phase, not language heuristics such as matching "I will" or "next I will."
3. Add a root-session responsiveness contract
The main-session prompt should ask the model to:
This should be event/phase driven, not timer driven. "Every N seconds" would be unreliable for the model and would encourage token-heavy filler.
The default should apply to user-facing root sessions. Child-agent output should stay governed by its orchestration surface rather than flooding the parent transcript.
4. Keep the activity projection separate
The activity UI should consume tool and execution events, aggregate adjacent facts, and expand into the existing detailed tool cards:
The activity projection must never synthesize model-style claims such as "I found the root cause." It should only state facts supported by events.
5. Preserve final-answer identity
Only
phase=final_answershould power:Commentary remains visible in chronological transcript/history but is not treated as the answer. Legacy phase-less turns retain today's last-text fallback.
Runtime Host compatibility
SessionAssistantDeltauses a strict allowed-key decoder (source). Adding an optional wire-levelphasetherefore requires a Runtime Host compatibility-epoch increment. The currentmainepoch is 76; older clients would otherwise reject the unknown field and tear down the connection.Reconnect also needs the phase in active assistant stream state, or a client joining mid-turn can render the same text differently from a continuously connected client.
Why the narrower alternatives are insufficient
Prompt only
This is useful as a quick experiment and may immediately improve behavior because the existing timeline can display text around tools. It is not a complete feature:
Subscribe to the raw event log
This can produce the lower Runtime activity summary. It cannot produce the upper model-authored commentary, because execution events do not contain the model's contextual explanation or judgment.
The renderer should also continue consuming the Runtime Host's bounded
SessionEventprojection rather than independently tailing the storage database. The Host already owns remote observation, reconnection, redaction, sequencing, and live/durable reconciliation.Add separate commentary event types
This duplicates the existing text pipeline's streaming, persistence, truncation, redaction, replay, reconnect, and rendering behavior. An optional semantic phase on text is smaller and keeps one chronology.
Implementation slices
PR 1: Phase foundation
AssistantTextPhase.This PR can be behavior-preserving except for imported-session fidelity.
PR 2: Commentary production and terminal semantics
PR 3: Presentation
Before PR 3, prepare two or three rendered UI alternatives at matching viewports and states so the visual hierarchy can be selected independently of the protocol decision.
Acceptance tests
commentary → tools → commentary → tools → final_answer.Relationship to existing work
Questions for maintainers
AssistantTextPhasebecome a provider-neutral core semantic?My recommendation is yes to questions 1-3, keep the three implementation slices, and treat the compact activity summary as the presentation half of the same product contract while preserving its independent runtime-derived data path.
Investigated and drafted with AI assistance (OpenAI Codex); code and observed behavior were verified against
apache/makamainat4cbe22413b29abf811de1f3fb3e8516ced7952ba.中文
摘要
Maka 应当在一个活跃 Turn 内提供两种彼此独立的可观察信息:
它们可以在界面上相邻,但不应共用一种消息类型。
这个提案解决活跃 Turn 内的轻量可观察性,不开放隐藏推理,不把 raw event log 原样塞进聊天,也不重新讨论 #3567 中的 park、poll、notify 和 continuation 机制。
当前问题
Maka 的长任务目前经常表现为:模型直接调用工具,界面显示工具活动,直到全部工作结束后才出现第一段模型自然语言。
原因分成三层:
phase,Maka 也会保留 text-end metadata,但它仍是 provider 私有字段,没有成为产品语义。UI 本身并非完全无法显示 commentary。现有 timeline 已经能保持“文字 → 工具 → 文字”的顺序,缺的是模型产出、统一 phase 和独立展示。
作为有限观察而非全局 benchmark,我检查了一个近期本地开发 workspace:
final_answer,没有commentary。因此当前主要问题是模型没有生成 commentary,而不是前端已经收到 commentary 后把它丢掉。
产品契约
四种通道应明确分开:
Commentary 是 assistant-authored text,会消耗 token、持久化,并可能需要随着 provider step replay。
Activity 来自执行事实,不应创建 assistant message、不应进入模型历史,也不应计为模型输出。实时部分从
SessionEvent投影,settled 部分与 durable messages /RuntimeEvent对账。它是 event stream 的紧凑展示,不是 raw event log dump。推荐架构
1. 增加 provider-neutral phase
在现有 text 生命周期上增加可选
phase:ModelStreamEvent;TextDeltaEvent与权威的TextCompleteEvent;RuntimeEventTextContent;AssistantMessage;SessionAssistantDelta与 active stream state;不要增加一套平行的
commentary_delta/commentary_complete,否则会复制 text pipeline 的 streaming、持久化、redaction、replay、重连和渲染。2. 保守判定 phase
需要两条不变量:
final_answer后仍有 tool call 是协议矛盾。产品行为上按 commentary 处理,同时保留原始 metadata 做诊断。phase=commentary结束、却没有 final answer 时,不能把 commentary 静默当作成功终态。step budget 允许时只进行一次有界 continuation,再次异常则明确失败。第二条只能依赖明确 phase,不能用“我先”“我会”等语言关键词猜测。
3. 增加 root-session responsiveness prompt
主会话模型应当:
不采用“每 N 秒更新”这种定时规则,以免产生不可执行且浪费 token 的填充文本。
默认只作用于用户可见 root session。子 agent 的输出由编排界面管理,避免淹没父会话。
4. Activity 保持独立
Activity 只能陈述事件支持的事实,不能生成“我找到了根因”这种模型判断。
5. final answer 身份
只有
phase=final_answer驱动:Commentary 保留在时间线中,但不被当作答案。旧的 phase-less Turn 继续使用当前 last-text fallback。
Runtime Host 兼容性
SessionAssistantDelta使用严格 allowed-key decoder。增加 wire-levelphase必须提高 Runtime Host compatibility epoch。当前main的 epoch 是 76,否则旧 Client 会因未知字段在流中断开。重连时 active assistant stream 也必须携带 phase,否则中途加入的 Client 会和持续在线的 Client 得到不同展示。
为什么两个简单方案不够
只改 prompt
可以作为快速实验,并可能立即改善产出,但不是完整 feature:
只订阅 raw event log
只能生成下方 Runtime activity,无法生成上方模型 commentary,因为事件里没有模型的上下文解释和判断。
Renderer 也应继续消费 Runtime Host 的 bounded
SessionEventprojection,而不是独立 tail storage DB。Host 已经负责 remote observation、重连、redaction、顺序以及 live/durable 对账。实施分期
PR 1:Phase foundation
AssistantTextPhase;PR 2:Commentary production 与终态语义
PR 3:Presentation
PR 3 开始前先制作两到三个相同 viewport 和状态的 UI 方案,单独确定视觉层级。
与现有工作的关系
希望维护者确认的问题
AssistantTextPhase是否应成为 provider-neutral core semantic?我的建议是问题 1-3 选择 yes,保持三个 implementation slice,并把 activity summary 视为同一产品契约的 presentation 部分,但继续维持独立的 runtime-derived 数据路径。
本调查和草稿由 OpenAI Codex 辅助完成;代码与观察行为已对照
apache/makamain的4cbe22413b29abf811de1f3fb3e8516ced7952ba验证。All reactions