Skip to content
PifeatureBackend3 files · +650 −55

Port copy-files bucket API from huggingface_hub to huggingface.js

Session from pi-sessions on Hugging Face by julien-c · CC-BY-4.0 · condensed by Coders Talk

1h 27msession
1interventions
GOAL

Port the copy_files feature from a specific huggingface_hub commit into the huggingface.js hub package, implementing hf:// handle parsing and file copying between buckets/repos.

  1. Prompt · +9m
    Check commit d82a7f7d in huggingface_hub and implement the same feature (copy_files/buckets cp) in this codebase.
  2. Agent did · +9m
    Read the reference commit's diffs (hf_api.py, _buckets.py, cli/buckets.py, tests) and studied the existing hub package's commit.ts, list-files.ts, paths-info.ts, and public.ts types to match patterns.
  3. Prompt · +16m
    Create a new copy-files.ts file in lib/, with a first simple draft of the implementation.
  4. Agent did · +20m
    Wrote copy-files.ts (parseHfCopyHandle + copyFiles), exported it from lib/index.ts, ran tsc, and fixed type errors (const reassignment, missing repoType property, unused variable).
  5. Agent did · +36m
    Committed the new copy-files.ts and index.ts export as a378bd9c, then a follow-up format commit and an unused-import cleanup commit.
  6. Prompt · +51m
    Start a very simple .spec.ts file testing only parseHfCopyHandle, with 2-3 simple test cases.
  7. Fail · +52m
    The new tests failed: repoType returned 'datasets' instead of 'dataset', and bucket path parsing grabbed only the namespace instead of namespace/bucket-name.
  8. Agent did · +55m
    Fixed both parsing bugs, reran vitest to get 3/3 passing, and committed the spec file plus fixes as 63643287.
  9. Intervention · +1h 2m
    Asked repeatedly (three times, across a long gap and an idle 'hello?') to rename ValueError to CopyHandleError; the agent's edits were incomplete/inconsistent, then couldn't explain what was missing, and the developer gave up on the model.
    Why: I kept asking for the same simple rename and it wasn't finishing the job across the file - it felt like the model had lost track of the change.
  10. Outcome · +1h 27m
    Session ends with the ValueError→CopyHandleError rename still incomplete; developer says they're switching to a different model.
VERDICT

I'd start next time by asking for the ValueError-to-CopyHandleError rename as a single focused task rather than tacking it on late, since that's where the model started losing track. Writing the parseHfCopyHandle spec file early was the correction that actually did the work - it caught two real parsing bugs (repoType and bucket-id slicing) that would've shipped otherwise. By the end the model couldn't reliably finish a simple rename across the file, which is why I cut the session short.

I tried this · 0

Discussion · 0

How Builds work