Skip to content

Bug: Stop hook fails - corrupted uv cache for fastapi dependency #28

@shakestzd

Description

@shakestzd

Bug Report

Description: The Stop hook fails with a non-blocking error because uv cannot read the installed fastapi==0.135.2 metadata from its cached environment. The cached environment at environments-v2/track-event-* has a corrupted or missing METADATA file for the fastapi dist-info.

Environment

  • HtmlGraph version: 0.34.31 (per error message)
  • Python version: 3.10.7
  • OS: Darwin 25.3.0 (macOS Tahoe)
  • Claude Code version: 2.1.81
  • uv cache path: /Users/shakes/.cache/uv/environments-v2/track-event-e08674fa10dcffd1/

Steps to Reproduce

  1. Use HtmlGraph with Stop hooks enabled
  2. Stop hook fires after a session stop event
  3. Hook fails trying to resolve fastapi==0.135.2 from the cached uv environment

Expected Behavior

Stop hook executes successfully without dependency resolution errors.

Actual Behavior

Stop hook fails with:

× Failed to read `fastapi==0.135.2`
├─▶ Failed to read metadata from installed package `fastapi==0.135.2`
╰─▶ failed to open file
    `/Users/shakes/.cache/uv/environments-v2/track-event-e08674fa10dcffd1/lib/python3.13/site-packages/fastapi-0.135.2.dist-info/METADATA`:
    No such file or directory (os error 2)
help: `fastapi` (v0.135.2) was included because `htmlgraph` (v0.34.31) depends on `fastapi>=0.100.0`

Possible Cause

The cached uv environment was created with Python 3.13 (lib/python3.13/) but the system Python is 3.10.7. This version mismatch may have caused the cache to become invalid. Clearing the specific cached environment (rm -rf ~/.cache/uv/environments-v2/track-event-*) may be a workaround.


Reported via HtmlGraph issue reporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions