Repository navigation
Description
What problem does this solve?
On the tole acp face, an entire turn renders in the host (Termul/Zed) as a bare "Working…" until the turn settles:
- Text is delivered as ONE
agent_message_chunkafter the whole turn completes (documented limitation: "v1 has no intra-turn streaming — the turn loop is synchronous"). A 30–60 s multi-tool turn shows nothing. - Tool activity is invisible except when a permission prompt happens:
AcpPromptannouncestool_callonly in the approval path. ReadOnly tools and auto-allowed writes execute with zero notifications — the host shows no progress at all. - Thinking/reasoning is dropped entirely: GLM-class providers return a
reasoningfield alongsidecontent(verified live against bifrost:"message": {"content": "OK", "reasoning": "..."}), and tole parses onlycontent.
An agent that visibly works (streams, shows tools, shows thought) feels orders of magnitude more trustworthy than one that is silent then answers. This is table stakes for editor-embedded agents.
Proposed solution
Phased, smallest-value-first — each phase independently shippable:
Phase 1 — tool lifecycle events (no provider changes). Give the turn loop an optional progress sink (observer callback/trait on run_turn, threaded through session_host to the ACP conn). Emit the full ACP tool-call lifecycle for EVERY execution: tool_call (pending) → tool_call_update (in_progress) → tool_call_update (completed/failed, with a small output preview). The approval-path announcements move onto the same path instead of being special-cased.
Phase 2 — reasoning as agent_thought_chunk. Parse the provider's reasoning field (OpenAI-compat GLM shape), carry it on the turn outcome alongside the final text, emit it as agent_thought_chunk before the answer. Non-streaming (one chunk at message end) — still a huge visibility win for "what is it doing in there".
Phase 3 — true text streaming. stream: true + SSE parsing in the provider, text deltas forwarded via the Phase-1 sink as incremental agent_message_chunks. This is a deliberate provider wire-shape change — it alters the request body byte-for-byte, so it lands with an updated Tier-1 wire contract (the cache-friendliness contract must be a reviewed, intentional change, not a drift) and the usage ledger still accounted from the final stream chunk. Durable JSONL entries keep storing the final message only — replay/resume semantics unchanged.
Alternatives considered
- Streaming only (skip 1–2) — highest effort for the single most fragile piece; 1–2 deliver most of the perceived progress without touching the provider.
- Polling-based pseudo-progress (heartbeats) — noise without information; the host already shows "Working…".
Are you willing to contribute the implementation?
Yes, I can do it
Activity
ajianaz commentedon Oct 6, 2026
Reference audit (epics/PRD/ACP spec/Termul) — what the agent SHOULD do
Grounding the phased plan in the repo's own planning docs and the host's rendering capabilities; two gaps #196 originally missed, one scope addition.
1. The repo's own documents already promise this
docs/epics.md→ D2 (tole acp, issue feat: tole acp — Agent Client Protocol host (Phase D2) #95) — scope line: "ACP sessions ↔ JSONL sessions, ACP permission requests ↔ the approval gate, streaming turn events. Est: M." — marked ✅ DONE (2026-09-18). What actually shipped: the final answer as one chunk before the response. "Streaming turn events" is an unfinished item inside a story marked done. Implementing ACP: intra-turn visibility — tool lifecycle events, reasoning/thought surfacing, streamed text #196 = completing D2's own acceptance, not a new ambition. (epics.md status wording gets corrected in the same PR per §7 docs-sync.)docs/prd.md→ FR-P1 — theProvidertrait is specified as "stream/chat completion" from day one. The current non-streaming provider is a subset of the PRD's own P0 surface.2. ACP spec gaps found in today's tool announcements (fold into Phase 1)
The tool-calls spec defines a
ToolKindtaxonomy — "Tool kinds help Clients choose appropriate icons and optimize how they display tool execution progress":read | edit | delete | move | search | execute | think | fetch | other, plus an optional programmaticnamefield ("such asread_file").Today
AcpPrompthardcodes"kind": "other"and sends noname. Correct mapping falls straight out of the registry:read_file,tole_session_*readwrite_file,edit_fileeditdelete_filedeleterun_command,git,gh,gitea,job_startexecutecora_search,uteke_recallsearchsystemone_decidethinkagent_start/agent_pollthink(subagent planning/monitoring)Registry-gated tools (cora/uteke/systemone) keep mapping only when present — the mapping is by tool name, computed from
ToolRequest/specs, never assuming registration.3. Termul (the reference host) renders more than we send
From Termul's ACP client (
SessionUpdatehandling) and its plan-compliance doc:agent_thought_chunkis a first-class citizen (ChunkRole::Thought→ thought bubbles) — Phase 2 lands on a host that already renders it.kindmapping is what makes those icons correct.PlanPanelexists and renders standardplanupdates (full-replace semantics,entries[]withcontent/priority/status). Termul keeps a compliance registry of 37 bundled agents; agents that don't emit plans show an empty PlanPanel — tole is in that bucket today.4. Scope addition — Phase 4: plan updates via a model-facing
update_plantoolPlans can't be emitted without a mechanism: register an ACP-face-only
update_plantool (Read-only-equivalent risk tier: it only emits asession/updateplan notification; nothing durable, no side effects) with the same schema the spec/Termul render (content/priority/status). The default ACP system prompt gains one line telling the model to maintain its plan for multi-step tasks. This is how spec-standard agents populate Termul's PlanPanel — and it makes tole a verifiedstandardcitizen in Termul's compliance registry instead ofunknown.5. Optional, not scheduled
available_commands_update(Termul slash menu) andusage_update(context usage display) are both rendered by the host and both need product decisions (what ARE tole's slash commands? cost accounting is in the ledger already) — noted, out of scope for now.Revised phases
name/kindmapping (spec-compliant announcements)agent_thought_chunkstream: true+ SSE, deliberate Tier-1 wire-contract change)update_plantool → standard plan updates (Termul PlanPanel)feat(acp): intra-turn visibility — tool cards, reasoning, plan panel (#…
feat(acp): true text streaming — SSE provider, live deltas, no duplic…
chore(release): v0.7.0 (#225)