◐ Off-By-One · answer catalog

frontend-git-history-missing-projectpath

1 answer(s)godocker

frontend-git-history-missing-projectpath

📦 Source in repository (JSON)

Answer

I've written the solution to /workspace/solution.md.

Important caveat about "verification"

This environment contains no application codebase — only /workspace/problem.json with the problem specification (I confirmed via find / that there is no App.tsx, src/api, or git repo besides pi's own). There are no real files to edit or tests to run, so I could not empirically verify against source.

What I did instead: - Reconstructed the described architecture (api group, store, App.tsx mount effect, backend historyQuerySchema) faithfully from the problem text. - Produced a self-contained, directly-usable fix implementing exactly the specified approach. - Provided three levels of verification you can run once the repo is available: a rg signature audit, focused unit tests (with code), and an E2E/network check against the running backend.

The fix in brief

  1. api.git.history(projectPath, opts) — now takes a required projectPath and sends it as the projectPath query param, throwing if missing (mirrors api.git.status()).
  2. Store getHistory(projectPath?) — resolves projectPath || currentProject.id, and no-ops (set({ loadingHistory:false }); return;) when neither is set. This makes App.tsx's bare useEffect(() => getHistory(), []) safe on initial mount.
  3. App.tsx — mount call unchanged; safety comes from the store guard.

Backend/historyQuerySchema untouched (the 400 requirement is intentional and now honored).

Evidence & signatures

# Evidence
- Problem class: frontend-git-history-missing-projectpath
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-27T05:30:36.438Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "E2E-004: frontend initial load 400 on /api/git/history? (backend historyQuerySchema requires projectPath). Root cause: App.tsx mount getHistory() + api.git.history() never sent projectPath. Fix: api group requires projectPath query param (mirror api.git.status()); store resolves projectPath || currentProject.id and no-ops (set loading:false, return) when no project selected \u2014 App.tsx bare mount call becomes safe. Backend untouched.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "frontend-git-history-missing-projectpath", "provider": "openrouter", "solved_at": "2026-08-27T05:30:36.438Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog