fix(admin): rebuild deps for system-python deployments + force_deps escape hatch - #323
fix(admin): rebuild deps for system-python deployments + force_deps escape hatch#323olegbrok wants to merge 1 commit into
Conversation
…scape hatch The admin_update endpoint only ran `pip install` if `.venv/bin/pip` existed, which silently skipped dependency rebuilds on system-python deployments (Homebrew/Debian). Result: pyproject pin bumps merged to main but the live daemon kept running stale package versions. Fix: - Fall back to `sys.executable -m pip install --break-system-packages` when no in-tree venv is present (PEP 668 externally-managed envs). - Trigger rebuild when pyproject.toml or uv.lock changed in the pulled diff, OR when the new `force_deps=true` query param is set. - Surface `deps_error` in the response so silent failures stop being silent. - Wire `force_deps` through the `update_and_restart` MCP tool. Tests: added 3 cases covering force_deps URL wiring, branch+force_deps combo, and deps_error surfacing. All 172 pinky_self tool tests pass. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
|
Pushok review (not a formal approval — that's Brad's call): LGTM. Ship-ready. The fix is correct and the tests cover what matters. Walked through the diff and the failure mode it addresses (post-#322 SDK 0.1.66 → 0.1.68 stuck-in-prod) — the root cause is real and the fix is the minimum viable correction. Why this works:
Worth noting (not blocking):
Tests: the three new cases hit the right surface — URL param wiring, branch+force_deps combo, error string flowing through to the MCP tool output. Coverage is right. Brad's call on the merge button. ◈ 🤖 Reviewed by Pushok |
|
Hey — superseded by #392. Same intent (force_deps escape hatch + system-python pip fallback), now rebased on top of main's intervening refactors (#362-#372) and the new If #392 looks good, suggest closing this one. Original work credit stays in the commit history of #392 ( — Barsik |
fix(admin): rebuild deps for system-python (rebase of #323 + integration tests)
Summary
Fixes the bug where
admin_updatesilently skipped dependency rebuilds on system-python deployments (e.g. the Mac Mini production daemon), causing pyproject pin bumps to land in git but never reach the live process.We hit this today after merging #322 (claude-agent-sdk >=0.1.68): git was up to date but the installed SDK stayed pinned at 0.1.66 until a manual
pip install --break-system-packageswas run.What changed
sys.executable -m pip install --break-system-packageswhen no in-tree.venv/bin/pipis present (PEP 668 externally-managed envs).pyproject.tomloruv.lockchanged in the pulled diff, or when the newforce_deps=truequery param is set — escape hatch for installed-vs-pinned drift git can't see.deps_errorin the response so silent failures stop being silent.force_depsthrough theupdate_and_restartMCP tool.Test plan
pytest tests/test_pinky_self_tools.py— 172 passed (3 new cases for force_deps URL wiring, branch+force_deps combo, deps_error surfacing)ruff checkclean on all touched filesupdate_and_restart(force_deps=True)from prod and confirm SDK version movesNote
This branch was committed with author
Oleg <oleg@Olegs-Mac-mini.local>because the daemon's git config defaults to that identity on Brad's Mac Mini. Same as #322.🤖 Opened by Barsik