Commit Graph

3 Commits

Author SHA1 Message Date
Teknium
b0427271e3 test(mcp-progress): the SDK round trip sends progress back to back, no sleeps
The real-server test slept 100 ms between updates, which tests/AGENTS.md forbids (HX013) and which
only bounds the delay from below. The updates now go out back to back; the assertions (call identity,
throttle dropped intermediates, final 100% delivered) hold at any speed, and pacing stays pinned on
the controlled-clock test.
2026-10-20 04:41:58 -07:00
Teknium
bcb054ccc1 fix(mcp-progress): progress is owned per chat, CLI shows it only for its own call, stores are released
Greptile review on #141985:
- Desktop keyed live progress by tool call id alone; providers reuse ids (call_0) across chats, so one
  chat overwrote or cleared another's row. Keys are now <session, call id>, and a finished turn
  (message.complete / error) sweeps that session's leftovers so a missed tool.complete never lingers.
- The per-row computed stores were cached forever; they are evicted on onStop like $toolDisclosureOpen.
- The CLI appended any progress to the last started tool's label. tool.started carries no call id, so
  the single spinner now shows progress only while exactly one call runs (labels tracked per tool,
  released on completion and at turn end).
- The SDK round-trip test no longer counts throttled events against wall-clock sleeps; the throttle is
  pinned on a controlled clock instead.
2026-10-20 04:41:58 -07:00
Teknium
60affe7fe2 feat(mcp): forward MCP notifications/progress as live tool.progress events
MCP tool calls now send _meta.progressToken, so servers that emit
notifications/progress (Meshy refine, creative-lab) report live progress.
The executor binds a per-call relay; the MCP handler forwards each
notification to tool_progress_callback as a throttled (<=1 per 500 ms,
final always) tool.progress event. Surfaces:
- gateway event stream + legacy TUI gateway: tool.progress
  {tool_id, name, progress, total, percent, message} (contract registered)
- Desktop: running tool row shows '42% · <message>' beside its timer;
  plugins subscribe with ctx.onEvent('tool.progress')
- CLI: the running tool spinner shows the same text
Documented in the Desktop plugin SDK guide.
2026-10-20 04:41:58 -07:00