Skip to content

Fix consistency reconciliation across deps, workflows, and artifacts#85

Merged
xpcmdshell merged 6 commits intomainfrom
codex/consistency-reconciliation
Mar 14, 2026
Merged

Fix consistency reconciliation across deps, workflows, and artifacts#85
xpcmdshell merged 6 commits intomainfrom
codex/consistency-reconciliation

Conversation

@xpcmdshell
Copy link
Copy Markdown
Owner

@xpcmdshell xpcmdshell commented Mar 12, 2026

Summary

  • make Session.remove_dep() remove configured packages from the active environment for the in-process, subprocess, and container executors
  • refresh persisted workflow reads in long-lived namespaces and the container workflow API so external file changes are observed without restart
  • reconcile Redis artifact metadata and file-backed dependency state against their backing store on read
  • adjust MCP dep workflow tests to use a leaf package (colorama) for add/remove coverage

What changed

  • normalized remove_dep() results across the main executors and updated the container /api/deps/remove endpoint to uninstall as well as update config
  • refreshed persisted workflow list/get/search/invoke paths and fixed stale-cache WorkflowLibrary.remove() success reporting
  • made RedisArtifactStore prune stale metadata when payload keys are gone
  • made FileDepsStore reload requirements.txt on reads and before mutations so external edits stay visible
  • hardened cached subprocess venv reuse by validating that ipykernel still imports before reusing an existing env
  • updated MCP dep add/list/remove tests to use colorama / colorama>=0.4, which keeps the tests focused on remove_dep() behavior without using a package in the Jupyter kernel dependency chain

Verification

  • uv run ruff check src/py_code_mode/deps/store.py src/py_code_mode/execution/in_process/executor.py src/py_code_mode/execution/subprocess/executor.py src/py_code_mode/execution/subprocess/venv.py src/py_code_mode/execution/container/server.py src/py_code_mode/execution/container/client.py src/py_code_mode/execution/container/executor.py src/py_code_mode/execution/in_process/workflows_namespace.py src/py_code_mode/workflows/library.py src/py_code_mode/artifacts/redis.py tests/test_executor_deps_methods.py tests/test_skills_namespace_decoupling.py tests/test_semantic.py tests/container/test_container_api.py tests/test_redis_artifacts.py tests/test_deps_store.py tests/test_deps_installer.py tests/test_subprocess_executor.py
  • uv run pytest tests/test_executor_deps_methods.py tests/test_skills_namespace_decoupling.py tests/test_semantic.py tests/container/test_container_api.py tests/test_redis_artifacts.py tests/test_deps_store.py tests/test_deps_installer.py tests/test_subprocess_executor.py
  • ./.venv/bin/ruff check tests/test_mcp_server.py
  • uv run pytest tests/test_mcp_server.py -k 'add_dep or remove_dep or list_deps' -q
  • manual checks outside pytest:
    • FileDepsStore external requirements.txt edit reflected by list() / exists()
    • persisted workflow edit/delete reflected by WorkflowsNamespace.invoke() / search()
    • RedisArtifactStore pruned stale metadata after payload deletion
    • real subprocess session: Session.remove_dep("colorama") removed config, uninstalled from the venv, and after reset import colorama failed with ModuleNotFoundError

Notes

  • Deno sandbox removal semantics remain best-effort because Pyodide uninstall is not a true supported uninstall path.
  • This PR does not attempt to solve concurrent writer locking/races.
  • This PR does not add subprocess dep-protection. Uninstalling kernel-critical packages from a shared cached subprocess env can still break that env; the MCP tests now avoid that sharp edge instead of exercising it.

@xpcmdshell xpcmdshell merged commit cfca257 into main Mar 14, 2026
9 checks passed
@xpcmdshell xpcmdshell deleted the codex/consistency-reconciliation branch March 14, 2026 07:31
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