- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Handle Qwen CLI refresh process cleanup #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
| WalkthroughDestructor logic in QwenOAuthConnector now performs guarded shutdown of a background CLI refresh process: attempts graceful terminate with timeout, escalates to kill if needed, suppresses exceptions, and clears the process reference. Unit tests added to validate normal, hung, and error scenarios for cleanup, including file watcher stop and process handling. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  participant App as App
  participant Conn as QwenOAuthConnector
  participant Watch as FileWatcher
  participant Proc as CLI Refresh Process
  App->>Conn: __del__ / cleanup()
  rect rgb(238, 245, 255)
    note right of Conn: Guarded shutdown
    Conn->>Watch: stop()
    alt Process exists and running
      Conn->>Proc: terminate()
      Conn->>Proc: wait(timeout)
      alt wait times out
        Conn->>Proc: kill()
        Conn->>Proc: wait(timeout)
      else exits in time
        note over Proc,Conn: Process ended
      end
    else No process / not running
      note right of Conn: Skip process termination
    end
    note right of Conn: Suppress exceptions
    Conn->>Conn: _cli_refresh_process = None
  end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
 Pre-merge checks and finishing touches✅ Passed checks (3 passed)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
 🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (AGENTS.md) 
 Files: 
 src/**/*.py📄 CodeRabbit inference engine (AGENTS.md) 
 Files: 
 🪛 Ruff (0.13.3)src/connectors/qwen_oauth.py918-920:  (S110) 918-918: Do not catch blind exception:  (BLE001) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
 🔇 Additional comments (5)
 Comment  | 
Summary
Testing
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -o addopts='' tests/unit/connectors/test_qwen_oauth_cleanup.py -vvPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -o addopts=''(fails: missing optional dev dependencies such as pytest-asyncio, respx, pytest_httpx, hypothesis)https://chatgpt.com/codex/tasks/task_e_68ec2685724083339dafb8594c547032
Summary by CodeRabbit