Skip to content

Default coding-agent servers to reasoning off - #7521

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
Imagineer99:fix/start-coding-agent-reasoning
Jul 28, 2026
Merged

Default coding-agent servers to reasoning off#7521
danielhanchen merged 3 commits into
unslothai:mainfrom
Imagineer99:fix/start-coding-agent-reasoning

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add --reasoning on|off|auto to unsloth start
  • default auto-started coding-agent servers to --reasoning off
  • allow --reasoning auto to restore llama.cpp model-detected behavior and on to force reasoning

Why

Some reasoning models emit a complete tool call in reasoning_content instead of the structured tool_calls field expected by coding harnesses. The model can describe the correct edit without the harness ever executing it. This has also been reported upstream for Qwen3.5/3.6 in llama.cpp.

The default only applies when unsloth start launches its own server. Attaching to an existing Studio/server does not mutate or reload that server.

Before / after

Before, a Qwen3.5-9B Hermes run generated the requested patch inside reasoning content, but no operation was executed.

After, a fresh Windows auto-start logged and launched llama.cpp with:

--reasoning off

Pi then received a structured tool call, wrote and read reasoning-proof.txt containing STRUCTURED_TOOL_OK, and exited successfully.

Validation

  • targeted CLI/default/attach-path tests: 3 passed
  • full tests/test_start.py: 335 passed, 3 skipped
  • one unrelated existing Linux-only failure remains when a test monkeypatches os.name to nt, which makes pathlib reject WindowsPath on Linux

References:

@Imagineer99
Imagineer99 marked this pull request as ready for review July 28, 2026 08:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 343bcfd803

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread unsloth_cli/commands/start.py Outdated
Comment on lines +1008 to +1009
"--reasoning",
server.reasoning,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate the new llama flag on server support

When the outer CLI has been upgraded but the managed Studio environment still contains a llama-server version predating --reasoning, this unconditional default breaks every auto-started GGUF agent: studio.run explicitly supports re-executing a newer outer CLI into an older managed venv and forwards unknown options to llama-server, where the unsupported flag terminates startup before the health check succeeds. Pass this setting through a version-compatible mechanism or probe the installed llama-server before adding the argument.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2bbd9fc. The launcher now sets llama.cpp documented LLAMA_ARG_REASONING environment variable instead of forwarding the newer --reasoning flag. Current llama-server versions honor the env equivalent, while older managed versions safely ignore it rather than failing startup on an unknown argument. Regression coverage verifies the CLI flag is absent and the env defaults to off or carries an explicit mode.

Comment thread unsloth_cli/commands/start.py Outdated
enable_tools: bool = _ENABLE_TOOLS_OPTION,
tool_call_healing: Optional[bool] = _TOOL_CALL_HEALING_OPTION,
tool_call_nudging: Optional[bool] = _TOOL_CALL_NUDGING_OPTION,
reasoning: Literal["on", "off", "auto"] = _REASONING_OPTION,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Warn when a running server ignores reasoning

When a previous unsloth start has retained its auto-started server, rerunning with --reasoning on or --reasoning auto accepts the option but _require_studio immediately takes the attach path and never applies it, so the agent silently continues using the original off mode. The same attach path already warns for ignored sampling overrides; track an explicit reasoning override and likewise tell the user to stop and restart the server.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2bbd9fc. Reasoning is now kept unset until the user explicitly supplies --reasoning, so the attach path can distinguish an override from the auto-start default. Attaching with on, off, or auto now warns that the running server keeps its current mode and gives the stop-and-restart command. Omitted reasoning stays silent. Full test_start.py: 342 passed; Ruff and diff checks pass.

@Imagineer99

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2bbd9fcba2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 31699f9 into unslothai:main Jul 28, 2026
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants