subagents: a stopped run closes the tool it had opened
A tool card is drawn from tool_started and only its tool_call closes it.
When the user stopped a run while a sub-agent was mid-tool, the sub-agent
was cancelled, the parent dropped its sink, and the matching tool_call was
never sent — the card spun until the page was reloaded.

The sub-agent now reports its in-flight tool from the CancelledError
handler, and both batch paths (sequential and parallel) drain the sink
after cancelling instead of discarding it, so that event reaches the
client ahead of the parent's synthetic "stopped by the user" result.

The webclient settles anything still pending at stream_end,
stream_stopped and error as a safety net for a lost frame or a dying
server, with a visible "interrupted" note rather than a silent close.

The TUI needs nothing: it renders tool_call as a result panel and carries
no pending state, so it gets the fix through the backend alone.
1 parent 38cd31f commit 8492357a6978cc08771d72e82de928af5c9f126b
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 8 hours ago
Showing 15 changed files
View
docs/tasks.md
View
docs/websocket.md
View
navi/core/agent.py
View
navi/core/subagent_runner.py
View
tests/unit/core/test_agent.py
View
tests/unit/core/test_parallel_tools.py
View
webclient/dist/assets/index-BsheFzin.js 0 → 100644
Not supported
View
webclient/dist/assets/index-DokDc2cW.js 100644 → 0
Not supported
View
webclient/dist/index.html
View
webclient/dist/sw.js
View
webclient/src/i18n/messages/en.js
View
webclient/src/i18n/messages/ru.js
View
webclient/src/i18n/messages/uk.js
View
webclient/src/stores/chat.js
View
webclient/tests/unit/stores/chat.test.js