mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-08 05:18:49 +03:00
feat(desktop): polish desktop shell and shared WebUI surfaces (#4195)
* feat(desktop): add native host scaffold
* feat(webui): track turns and usage in gateway
* feat(webui): polish desktop chat experience
* feat(apps): add ArcGIS and Joplin logos
* feat(desktop): polish shell and shared surfaces
* fix(webui): avoid preview chips for glob references
* test: align CI expectations for token fallback
* feat(webui): preview prompt rail entries
* feat(webui): add prompt navigator drawer
* style(webui): refine prompt navigator placement
* style(webui): align prompt navigator with header actions
* style(webui): simplify prompt navigator header
* refactor(webui): clean thread resource refresh
* feat(desktop): add native reply notifications
* fix(webui): preserve desktop restart and replay state
* fix(desktop): harden gateway proxy startup
* fix(web): fall back when readability is unavailable
* fix(desktop): hide window instead of closing on macos
* fix(webui): unify desktop header actions
* fix(webui): simplify prompt history rows
* fix(desktop): log notification delivery failures
* chore(desktop): clean source package artifacts
* fix(cron): support one-time relative reminders
* fix(webui): reveal scroll button in place
* Revert "fix(cron): support one-time relative reminders"
This reverts commit 4c4661da12.
* refactor(webui): extract token usage heatmap
* docs(desktop): clarify contributor guides
---------
Co-authored-by: chengyongru <2755839590@qq.com>
This commit is contained in:
@@ -19,7 +19,6 @@ from nanobot.providers.openai_responses.parsing import (
|
||||
parse_response_output,
|
||||
)
|
||||
|
||||
|
||||
# ======================================================================
|
||||
# converters - split_tool_call_id
|
||||
# ======================================================================
|
||||
@@ -478,7 +477,7 @@ class TestConsumeSse:
|
||||
async def on_reasoning(delta: str) -> None:
|
||||
deltas.append(delta)
|
||||
|
||||
content, tool_calls, finish_reason, reasoning = await consume_sse_with_reasoning(
|
||||
content, tool_calls, finish_reason, usage, reasoning = await consume_sse_with_reasoning(
|
||||
response,
|
||||
on_reasoning_delta=on_reasoning,
|
||||
)
|
||||
@@ -486,6 +485,7 @@ class TestConsumeSse:
|
||||
assert content == "answer"
|
||||
assert tool_calls == []
|
||||
assert finish_reason == "stop"
|
||||
assert usage == {}
|
||||
assert reasoning == "thinking briefly"
|
||||
assert deltas == ["thinking ", "briefly"]
|
||||
|
||||
@@ -506,7 +506,7 @@ class TestConsumeSse:
|
||||
},
|
||||
])
|
||||
|
||||
_, _, _, reasoning = await consume_sse_with_reasoning(response)
|
||||
_, _, _, _, reasoning = await consume_sse_with_reasoning(response)
|
||||
|
||||
assert reasoning == "cached summary"
|
||||
|
||||
@@ -527,7 +527,7 @@ class TestConsumeSse:
|
||||
async def on_reasoning(delta: str) -> None:
|
||||
deltas.append(delta)
|
||||
|
||||
_, _, _, reasoning = await consume_sse_with_reasoning(
|
||||
_, _, _, _, reasoning = await consume_sse_with_reasoning(
|
||||
response,
|
||||
on_reasoning_delta=on_reasoning,
|
||||
)
|
||||
@@ -545,10 +545,26 @@ class TestConsumeSse:
|
||||
{"type": "response.completed", "response": {"status": "completed"}},
|
||||
])
|
||||
|
||||
_, _, _, reasoning = await consume_sse_with_reasoning(response)
|
||||
_, _, _, _, reasoning = await consume_sse_with_reasoning(response)
|
||||
|
||||
assert reasoning == "part summary"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_raw_sse_usage_extracted(self):
|
||||
response = _SseResponse([
|
||||
{
|
||||
"type": "response.completed",
|
||||
"response": {
|
||||
"status": "completed",
|
||||
"usage": {"input_tokens": 10, "output_tokens": 5, "total_tokens": 15},
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
_, _, _, usage, _ = await consume_sse_with_reasoning(response)
|
||||
|
||||
assert usage == {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_tool_call_done_arguments_callback(self):
|
||||
response = _SseResponse([
|
||||
|
||||
Reference in New Issue
Block a user