Skip to content

[Bug]: uv run oh crashes with TypeError (unexpected keyword argument 'permission_mode') #82

@damoon50

Description

@damoon50

What happened?

When I run uv run oh, the CLI shows Connecting to backend... and then exits with a traceback.
Actual behavior:

  • Backend exits with code 1
  • Error: TypeError: run_backend_host() got an unexpected keyword argument 'permission_mode'
    Expected behavior:
  • uv run oh should start the interactive TUI normally.

Steps to reproduce

  1. Clone the repository and enter project directory:
    git clone https://github.com/HKUDS/OpenHarness.git
    cd OpenHarness
  2. Install dependencies:
    uv sync --extra dev
  3. Run interactive mode:
    uv run oh
  4. Observe crash after Connecting to backend... with TypeError.

Expected behavior
uv run oh should launch the interactive TUI session.
Actual behavior
Backend exits with code 1 because run_backend_host() does not accept permission_mode.
Root cause
run_repl() forwards permission_mode to run_backend_host(...), but:

  • run_backend_host function signature does not include permission_mode
  • BackendHostConfig does not include permission_mode
  • the value is not passed through to build_runtime(...)
    Proposed fix
    Propagate permission_mode end-to-end in backend host:
  • Add permission_mode: str | None = None to BackendHostConfig
  • Add permission_mode parameter to run_backend_host(...)
  • Pass permission_mode=self._config.permission_mode into build_runtime(...) in ReactBackendHost.run()
    Verification after patch
  • uv run oh --backend-only no longer throws TypeError
  • uv run oh no longer fails from this argument mismatch

Environment

  • OS: Windows 11
  • Shell: PowerShell ((base) conda environment)
  • Python: Anaconda Python (traceback path shows D:\anaconda\Lib\asyncio\...)
  • Install method: from source (uv sync --extra dev, then uv run oh)
  • Provider profile at runtime: minimax (but issue appears before any model response, likely provider-independent)
  • Base URL in active profile: https://api.minimax.chat/v1

Relevant logs or screenshots

(base) PS E:\ASUS\Github\OpenHarness> uv run oh
Connecting to backend...
Traceback (most recent call last):
  File "E:\ASUS\Github\OpenHarness\src\openharness\cli.py", line 1432, in main
    asyncio.run(...)
  File "D:\anaconda\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
  File "D:\anaconda\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "D:\anaconda\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
  File "E:\ASUS\Github\OpenHarness\src\openharness\ui\app.py", line 33, in run_repl
    await run_backend_host(...)
TypeError: run_backend_host() got an unexpected keyword argument 'permission_mode'
ℹ backend exited with code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions