Skip to content

release: admin force_deps escape hatch (cherry-pick of #392) - #393

Merged
olegbrok merged 2 commits into
mainfrom
release/2026-05-05-force-deps
May 6, 2026
Merged

release: admin force_deps escape hatch (cherry-pick of #392)#393
olegbrok merged 2 commits into
mainfrom
release/2026-05-05-force-deps

Conversation

@olegbrok

@olegbrok olegbrok commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why a cherry-pick instead of beta→main

Beta still carries 4 stale Codex/runtime commits (#357/#358/#360/#361) that predate main's api.py route extraction (#362#372, #376) and need a design call before integration. Cherry-picking just #392 keeps stable clean.

Commits

  • fix(admin): rebuild deps for system-python deployments + force_deps escape hatch
  • test(admin): cover force_deps + force interaction at endpoint level

Test plan

🤖 Opened by Barsik

Oleg and others added 2 commits May 5, 2026 20:41
…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>
Adds 4 tests in TestAdminUpdateForceDepsIntegration verifying:
- force_deps=True triggers pip install on a clean (no-op) pull
- force=True + force_deps=True combine correctly (reset + reinstall)
- default behavior skips pip when pyproject.toml is unchanged
- pip install failures surface as deps_error in the response

Mirrors the matching MCP-tool-level coverage in test_pinky_self_tools.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@olegbrok
olegbrok merged commit 750e3d7 into main May 6, 2026
8 checks passed
@olegbrok
olegbrok deleted the release/2026-05-05-force-deps branch May 6, 2026 03:46
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.

1 participant