Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Ollama/Qwen3.5 returns empty final response when use_max_completion_tokens_param is enabled

Open
#426 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
ollama, php
Domain
api, backend

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

bug

To Reproduce

  1. Configure integration_openai with an Ollama OpenAI-compatible endpoint: http://<ollama-host>:11434/v1

  2. 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.

  1. Configure max_tokens=3000 and use_max_completion_tokens_param=1.

  2. Run a multi-step Context Agent request, for example: How is the current weather in Dresden?

  3. Observe that the coordinate lookup and weather lookup complete successfully, but the final assistant response is empty.

  4. The resulting TaskProcessing task ends with STATUS_SUCCESSFUL and output: "".

  5. Replay the same final /v1/chat/completions request directly against Ollama with the same message history and identical tool results.

  6. With max_completion_tokens=3000, the response is:

    • finish_reason="stop"
    • content=""
    • tool_calls=null
  7. Change only the token parameter to max_tokens=3000.

  8. The same request now returns:

    • finish_reason="stop"
    • normal final assistant content
    • tool_calls=null
  9. In Nextcloud, configure:

    • llm_extra_params={"reasoning_effort":"none"}
    • use_max_completion_tokens_param=0
    • max_tokens=3000
  10. Repeat the same Context Agent request.

  11. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/integration_openai

All issues in nextcloud/integration_openai

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.