Skip to content

Fix OpenClaw start default to local TUI - #6937

Merged
wasimysaid merged 6 commits into
unslothai:mainfrom
Imagineer99:fix/openclaw-tui-local-default
Jul 8, 2026
Merged

wasimysaid merged 6 commits into
unslothai:mainfrom
Imagineer99:fix/openclaw-tui-local-default

Conversation

@Imagineer99

Copy link
Copy Markdown
Member

Summary

  • Launch OpenClaw's normal local TUI by default from unsloth start openclaw.
  • Preserve explicit OpenClaw subcommands passed by the user.
  • Add no-launch regression coverage for the default and explicit-subcommand paths.

Root Cause

Current OpenClaw builds can route bare openclaw to Crestodian/setup mode. unsloth start openclaw used the bare command, so a successful Unsloth model connection could still open Crestodian instead of the normal coding-agent TUI. Launching openclaw tui --local selects the expected main local agent directly.

Validation

  • User-confirmed manual WSL test: patched command opens openclaw tui - local embedded - agent main with the Unsloth model.
  • python -m py_compile unsloth_cli/commands/start.py unsloth_cli/tests/test_start.py
  • git diff --check
  • Targeted OpenClaw pytest: 4 passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the openclaw command execution in unsloth_cli/commands/start.py to default to launching the local TUI (['tui', '--local']) when no explicit arguments are provided, while still preserving explicit subcommands. It also adds corresponding unit tests in unsloth_cli/tests/test_start.py to verify this behavior. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@wasimysaid wasimysaid self-assigned this Jul 7, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@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: 803d16b3b5

ℹ️ 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 +1418 to +1419
if not openclaw_args or openclaw_args[0].startswith("-"):
openclaw_args = ["tui", "--local", *openclaw_args]

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 Preserve OpenClaw global flag passthrough

When a caller passes an OpenClaw global flag through this passthrough wrapper, e.g. unsloth start openclaw --no-launch --profile test or --dev, ctx.args[0] starts with - and this rewrites the recipe from the formerly valid openclaw --profile test into openclaw tui --local --profile test. I checked the OpenClaw CLI usage, which places globals before the command (openclaw [--dev] [--profile <name>] <command>), and the TUI options list does not include --profile/--dev, so these pass-through invocations now fail instead of reaching OpenClaw.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, fixed in 396cac1. Since OpenClaw's grammar is openclaw [--dev] [--profile ] and a leading '--flag value' is ambiguous between a global (--profile test) and a tui option (--message hi), the wrapper can't reinterpret it safely. It now defaults to 'tui --local' only when there are no passthrough args, and forwards everything else verbatim so OpenClaw parses it under its own grammar. The bare-launch default is preserved; explicit subcommands and global flags now pass through untouched. Added a regression test for --profile passthrough.

The first-arg startswith('-') branch rewrote passthrough globals into a broken
command: OpenClaw's grammar is openclaw [--dev] [--profile <name>] <command>, so
'unsloth start openclaw --profile test' became 'openclaw tui --local --profile
test', but tui does not accept --profile (or --dev), so the invocation failed.

A leading '--flag value' is ambiguous between a global (--profile test) and a tui
option (--message hi), so it cannot be reinterpreted safely. Default to the local
TUI only when no passthrough args are given, and forward everything else verbatim
so OpenClaw parses it under its own grammar. The bare-launch default (the point
of this change) is preserved; explicit subcommands and global flags pass through.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

@wasimysaid
wasimysaid marked this pull request as ready for review July 8, 2026 11:25
@wasimysaid
wasimysaid merged commit 6ef0936 into unslothai:main Jul 8, 2026
30 of 43 checks passed
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 6ef0936180

ℹ️ 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".

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.

3 participants