Skip to content

hf_push fails with ImportError after the user approves it #15

Description

@marekolszewski

What happens

Approving an hf_push permission prompt raises ImportError instead of pushing.

Cause

lqh/agent.py:1922 imports a function that no longer exists:

from lqh.tools.handlers import _execute_hf_push, _get_hf_api, _validate_path

handlers.py defines _execute_hf_push_dataset (line 4132) and _execute_hf_push_model (line 4281). Plain _execute_hf_push is gone. Commit 1594e14 (2026-05-19, "auto-detect dataset vs model") split it and missed this call site. grep -rn "_execute_hf_push\b" matches only agent.py:1922 and the call at agent.py:1936.

$ python -c "from lqh.tools.handlers import _execute_hf_push"
ImportError: cannot import name '_execute_hf_push' from 'lqh.tools.handlers'

Why it is reachable

handle_hf_push returns PERMISSION_REQUIRED when the repo is not already approved. The answer routes through _handle_permission_response (agent.py:1808) to _handle_hf_push_permission (agent.py:1900), which hits the bad import.

So it only affects the permission path, which is the first push to a given repo. Once permission is granted, handle_hf_push runs directly and works. New users hit it every time.

Note

The two replacement functions take different arguments than the old one, so this is more than a rename. The call site needs to detect dataset vs model and dispatch accordingly, which is why I am filing rather than sending a patch. Happy to turn it into a prompt if that is useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions