Conversation
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
There was a problem hiding this comment.
Pull request overview
This PR aims to address blocking behavior (Issue #113) by converting Nextcloud API interactions and most tool implementations to async, so long-running tool calls don’t block processing of other conversations.
Changes:
- Switched core Nextcloud interactions from
NextcloudApp/NextcloudtoAsyncNextcloudAppand updated call sites toawaitasync methods. - Converted most tools to async and replaced sync HTTP calls with
niquests.async_api. - Updated task processing helper and logging to be async-friendly (with calendar tools explicitly remaining sync/blocking per PR description).
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| ex_app/lib/tools.py | Load tools using AsyncNextcloudApp and await async availability/config reads. |
| ex_app/lib/nc_model.py | Move chat model execution to _agenerate with async scheduling/polling via Nextcloud OCS. |
| ex_app/lib/main.py | Make enable handler and background polling/reporting use async Nextcloud APIs. |
| ex_app/lib/logger.py | Make log() async and await Nextcloud log calls. |
| ex_app/lib/agent.py | Update agent entrypoint typing to AsyncNextcloudApp. |
| ex_app/lib/all_tools/youtube.py | Update tool loader signature to async Nextcloud app. |
| ex_app/lib/all_tools/weather.py | Convert weather tool to async HTTP calls. |
| ex_app/lib/all_tools/talk.py | Convert Talk tools to async Nextcloud Talk API usage. |
| ex_app/lib/all_tools/openstreetmap.py | Convert OSM tools to async HTTP calls. |
| ex_app/lib/all_tools/openproject.py | Convert OpenProject OCS calls to async. |
| ex_app/lib/all_tools/mcp.py | Convert MCP config reads/logging to async. |
| ex_app/lib/all_tools/mail.py | Convert Mail OCS calls/logging to async. |
| ex_app/lib/all_tools/lib/task_processing.py | Convert task scheduling/polling helper to async and add explicit schedule failure. |
| ex_app/lib/all_tools/image_gen.py | Convert image generation tool to async task processing + async OCS URL lookup. |
| ex_app/lib/all_tools/here.py | Convert HERE API key fetch + HTTP call to async. |
| ex_app/lib/all_tools/files.py | Convert Files tools to async OCS + async download. |
| ex_app/lib/all_tools/duckduckgo.py | Update tool loader signature to async Nextcloud app. |
| ex_app/lib/all_tools/doc-gen.py | Convert doc generation to async task processing + async URL lookup. |
| ex_app/lib/all_tools/deck.py | Convert Deck HTTP calls to async. |
| ex_app/lib/all_tools/context_chat.py | Convert context chat tool to async task processing. |
| ex_app/lib/all_tools/contacts.py | Convert Contacts DAV/OCS calls to async. |
| ex_app/lib/all_tools/calendar.py | Keep calendar operations sync via NextcloudApp while adapting outer tool interface to async. |
| ex_app/lib/all_tools/audio2text.py | Convert transcription tool to async task processing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
|
seems like caldav supports async now, might be worth to create an issue in nc_py_api to add the api there too nice fix meanwhile for the sync functions here in context_agent :) |
|
I would kindly ask to only review the changes in this PR. We can and should definitely improve the code base, but I'd rather not have to fix the whole codebase just because I touched everything :S |
|
cool, resolved the ones that were not directly related to async changes. |
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
and keep long poll interval if no tasks are running Signed-off-by: Marcel Klehr <mklehr@gmx.net>
b54b43f to
9af27ee
Compare
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
maybe also in pyproject.toml |
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
fixes #113
Sadly couldn't easily make the calendar tools non-blocking, so they remain blocking, but those HTTP requests should not take super long.. 🤷