[Bug]: upgrade failing
What happened?
Upgrade failed: cal.py", line 767, in rename os.rename(self, target) ~~~~~~~~~^^^^^^^^^^^^^^ PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\mjiva\.local\bin\ductor.exe' -> 'C:\Users\mjiva\pipx\trash\nghvikjq.ductor.exe'
Steps to Reproduce
Upgrading error
Expected Behavior
Upgrade remotely from telegram.
I'd have to kill all processes to upgrade manually.
Operating System
Windows
Environment
Local (pip install)
Which LLM provider?
Codex
ductor version
0.5.5
/diagnose output
EscapeVelocity:
System Diagnostics
───
Version: 0.6.0
Configured: codex / gpt-5.3-codex
Effective runtime: codex / gpt-5.3-codex
🔄 Codex Model Cache:
Last updated: 2026-02-25T17:58:33.054482+00:00
Models cached: 5
Default model: gpt-5.3-codex
───
file.rename(_get_trash_file(file))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python313\Lib\pathlib\_local.py", line 767, in rename
os.rename(self, target)
~~~~~~~~~^^^^^^^^^^^^^^
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\mjiva\\.local\\bin\\ductor.exe' -> 'C:\\Users\\mjiva\\pipx\\trash\\nghvikjq.ductor.exe'
2026-02-26 09:35:55 [INFO] aiogram.event:dispatcher.py:178: [cb:6469281849] Update id=334725810 is handled. Duration 9556 ms by bot id=8365158724
2026-02-26 09:37:14 [INFO] ductor_bot.bot.handlers:handlers.py:49: [msg:6469281849] Command dispatched cmd=/diagnose
2026-02-26 09:37:14 [INFO] ductor_bot.orchestrator.core:core.py:338: [msg:6469281849] Message received text=/diagnose
2026-02-26 09:37:14 [INFO] ductor_bot.orchestrator.commands:commands.py:168: [msg:6469281849] Diagnose requested
Recent logs (last 50 lines):
2026-02-26 08:18:30 [INFO] ductor_bot.bot.message_dispatch:message_dispatch.py:125: [msg:6469281849:019c9708] Streaming flow completed fallback=False content=True
2026-02-26 08:18:30 [INFO] aiogram.event:dispatcher.py:178: [msg:6469281849:019c9708] Update id=334725807 is handled. Duration 277232 ms by bot id=8365158724
2026-02-26 08:19:27 [INFO] ductor_bot.bot.message_dispatch:message_dispatch.py:74: [msg:6469281849] Streaming flow started
2026-02-26 08:19:27 [INFO] ductor_bot.orchestrator.core:core.py:338: [msg:6469281849] Message received text=patch it please.
2026-02-26 08:19:27 [INFO] ductor_bot.orchestrator.flows:flows.py:283: [msg:6469281849] Streaming flow starting
2026-02-26 08:19:27 [INFO] ductor_bot.orchestrator.flows:flows.py:56: [msg:6469281849:019c9708] Session resolved sid=019c9708 new=False msgs=8
2026-02-26 08:19:27 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:61: [msg:6469281849:019c9708] Codex CLI wrapper: cwd=C:\Users\mjiva\.ductor\workspace, model=gpt-5.3-codex
2026-02-26 08:19:27 [INFO] ductor_bot.cli.service:service.py:164: [msg:6469281849:019c9708] CLI streaming starting label=main model=gpt-5.3-codex
2026-02-26 08:19:27 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:339: [msg:6469281849:019c9708] Codex stream cmd: C:\Users\mjiva\AppData\Roaming\npm\codex.CMD exec resume --json --dangerously-bypass-approvals-and-sandbox -- 019c9708-d451-7c23-8ceb-da2cd18c1c13
2026-02-26 08:19:27 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:212: [msg:6469281849:019c9708] Codex subprocess starting pid=26316
2026-02-26 08:24:22 [INFO] ductor_bot.cli.service:service.py:206: [msg:6469281849:019c9708] CLI streaming completed label=main fallback=False
2026-02-26 08:24:22 [INFO] ductor_bot.orchestrator.flows:flows.py:325: [msg:6469281849:019c9708] Streaming flow completed
2026-02-26 08:24:22 [INFO] ductor_bot.bot.message_dispatch:message_dispatch.py:125: [msg:6469281849:019c9708] Streaming flow completed fallback=False content=True
2026-02-26 08:24:22 [INFO] aiogram.event:dispatcher.py:178: [msg:6469281849:019c9708] Update id=334725808 is handled. Duration 294284 ms by bot id=8365158724
2026-02-26 08:24:59 [INFO] ductor_bot.bot.message_dispatch:message_dispatch.py:74: [msg:6469281849] Streaming flow started
2026-02-26 08:24:59 [INFO] ductor_bot.orchestrator.core:core.py:338: [msg:6469281849] Message received text=stuck at scanning email s for statements and then pipeline complete but redd scr
2026-02-26 08:24:59 [INFO] ductor_bot.orchestrator.flows:flows.py:283: [msg:6469281849] Streaming flow starting
2026-02-26 08:24:59 [INFO] ductor_bot.orchestrator.flows:flows.py:56: [msg:6469281849:019c9708] Session resolved sid=019c9708 new=False msgs=9
2026-02-26 08:24:59 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:61: [msg:6469281849:019c9708] Codex CLI wrapper: cwd=C:\Users\mjiva\.ductor\workspace, model=gpt-5.3-codex
2026-02-26 08:24:59 [INFO] ductor_bot.cli.service:service.py:164: [msg:6469281849:019c9708] CLI streaming starting label=main model=gpt-5.3-codex
2026-02-26 08:24:59 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:339: [msg:6469281849:019c9708] Codex stream cmd: C:\Users\mjiva\AppData\Roaming\npm\codex.CMD exec resume --json --dangerously-bypass-approvals-and-sandbox -- 019c9708-d451-7c23-8ceb-da2cd18c1c13
2026-02-26 08:24:59 [INFO] ductor_bot.cli.codex_provider:codex_provider.py:212: [msg:6469281849:019c9708] Codex subprocess starting pid=33124
2026-02-26 08:34:21 [INFO] ductor_bot.cli.service:service.py:206: [msg:6469281849:019c9708] CLI streaming completed label=main fallback=False
2026-02-26 08:34:22 [INFO] ductor_bot.orchestrator.flows:flows.py:325: [msg:6469281849:019c9708] Streaming flow completed
2026-02-26 08:34:22 [INFO] ductor_bot.bot.message_dispatch:message_dispatch.py:125: [msg:6469281849:019c9708] Streaming flow completed fallback=False content=True
2026-02-26 08:34:22 [INFO] aiogram.event:dispatcher.py:178: [msg:6469281849:019c9708] Update id=334725809 is handled. Duration 562727 ms by bot id=8365158724
2026-02-26 08:58:33 [INFO] ductor_bot.cli.gemini_cache_observer:gemini_cache_observer.py:83: GeminiCacheObserver: refreshing cache
2026-02-26 08:58:33 [INFO] ductor_bot.cli.gemini_cache_observer:gemini_cache_observer.py:86: Gemini cache refreshed: 5 models
2026-02-26 08:58:34 [INFO] ductor_bot.cli.codex_cache_observer:codex_cache_observer.py:62: CodexCacheObserver: refreshing cache
2026-02-26 08:58:34 [INFO] ductor_bot.cli.codex_cache_observer:codex_cache_observer.py:64: Codex cache refreshed: 5 models
2026-02-26 09:35:46 [INFO] ductor_bot.bot.app:app.py:467: [cb:6469281849] Callback data=upg:yes:0.6.0
2026-02-26 09:35:55 [ERROR] ductor_bot.bot.app:app.py:809: [cb:6469281849] Upgrade failed: Data\Roaming\Python\Python313\site-packages\pipx\util.py", line 90, in safe_unlink
Relevant log output
LLM self-diagnosis (optional)
No response
Additional context
No response
Before submitting
- [x] I have searched existing issues for duplicates.
- [ ] I am running the latest version.
Hey! Thanks for reporting this — this was a real issue on Windows where pipx upgrade tries to overwrite ductor.exe while the running bot process holds a lock on it.
This has been fixed in v0.6.3 (and the underlying fix shipped in v0.6.1). Here's what changed:
- Windows now uses
pipx runpip ductor install --upgradeinstead ofpipx upgrade, which upgrades the package inside the pipx venv without touching the locked global exe. - The upgrade pipeline now always verifies the installed version after the command, regardless of exit code — because pipx may report failure (due to the exe lock) even though the package was successfully upgraded inside the venv.
- If PyPI CDN hasn't propagated the new version yet, you get a friendly message instead of a raw pip error.
To get the fix, you'll need to do one manual upgrade:
pipx runpip ductor install --upgrade ductor
After that, future /upgrade commands from Telegram will work without the PermissionError.