Ollama/Qwen3.5 returns empty final response when use_max_completion_tokens_param is enabled
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start by tracing how integration_openai maps max_tokens and use_max_completion_tokens_param into the /v1/chat/completions request sent to the Ollama-compatible endpoint. Reproduce the multi-step Context Agent request with Qwen3.5, then compare responses using max_completion_tokens versus max_tokens; done means the final assistant answer is returned and displayed instead of an empty successful task output.
Written by the indexing model from the issue text.
Description
To Reproduce
-
Configure
integration_openaiwith an Ollama OpenAI-compatible endpoint:http://<ollama-host>:11434/v1 -
Use:
- Nextcloud 33.0.7
- integration_openai 4.5.2
- context_agent 2.8.0
- Ollama 0.32.7
- Model
qwen3.5-32k:latest
Note: qwen3.5-32k:latest is a local Ollama model tag based on qwen3.5:latest, created with PARAMETER num_ctx 32768. No other model changes were made.
-
Configure
max_tokens=3000anduse_max_completion_tokens_param=1. -
Run a multi-step Context Agent request, for example:
How is the current weather in Dresden? -
Observe that the coordinate lookup and weather lookup complete successfully, but the final assistant response is empty.
-
The resulting TaskProcessing task ends with
STATUS_SUCCESSFULandoutput: "". -
Replay the same final
/v1/chat/completionsrequest directly against Ollama with the same message history and identical tool results. -
With
max_completion_tokens=3000, the response is:finish_reason="stop"content=""tool_calls=null
-
Change only the token parameter to
max_tokens=3000. -
The same request now returns:
finish_reason="stop"- normal final assistant content
tool_calls=null
-
In Nextcloud, configure:
llm_extra_params={"reasoning_effort":"none"}use_max_completion_tokens_param=0max_tokens=3000
-
Repeat the same Context Agent request.
-
The complete flow now succeeds: coordinate tool → weather tool → final answer synthesis → visible answer in the Nextcloud UI.
- Dominant language
- PHP
- Stars
- 76
- Forks
- 34
- Avg merge
- 4d 54m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/integration_openai
-
parseStreamChatResponse ignores the [DONE] sentinel and hangs until read timeout on keep-alive serversPossibly taken @mikemikimike claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nextcloud/integration_openai#446 ·
-
enhancement priority: normal
Difficulty 3/5 1-2 days Newbie friendliness 56/100
nextcloud/integration_openai#443 ·
-
Allow to send extra headers in the requests to the external servicePossibly taken @julien-nc claimed this 37 days ago. Openenhancement
nextcloud/integration_openai#436 · 1 assignee ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
nextcloud/integration_openai#407 · 4 comments ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
nextcloud/integration_openai#406 · 8 comments · 1 reaction ·
All issues in nextcloud/integration_openai
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
kanboard/kanboard#5929 · 1 comment · 3 reactions ·
Maintainers usually reply within 5 days
-
Rebuild 6.2.3 images on PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 (CVE-2026-109618, CVE-2026-109619)Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
swoole/docker-swoole#65 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
PHP-CS-Fixer/PHP-CS-Fixer#9899 ·
Maintainers usually reply within 1 day
-
REST: Add missing text domain and fix typos in REST API controller stringsPossibly taken @devmuhib009 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100