From 2196a048b1a980ff6a4d04918cbee69778186c83 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Apr 2026 03:10:27 +0000 Subject: chore: add next-steps.md session handoff summary https://claude.ai/code/session_01W8P6wwDYF7dpETXWVXCz5L --- next-steps.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 next-steps.md diff --git a/next-steps.md b/next-steps.md new file mode 100644 index 0000000..7b425cd --- /dev/null +++ b/next-steps.md @@ -0,0 +1,33 @@ +# Next Steps + +Branch: `claude/investigate-git-clone-failures-mlHGo` + +## Done this session + +- Fixed critical `sandboxDir` variable shadowing bug in `internal/executor/claude.go` (lines 119, 131) — changed `:=` to `=`. This was the root cause of git clone failures: sandboxes were never torn down, changes were never pushed back to origin, `/tmp` accumulated orphaned dirs. +- Fixed hardcoded `master` branch in `teardownSandbox` — now detects current branch from HEAD. +- Rewrote `CLAUDE.md` with accurate architecture, correct YAML key (`agent:` not `claude:`), complete state machine, all packages documented, known bugs and design debt called out. +- Created `docs/IMPROVEMENT_PLAN.md` with 20 prioritized issues, each with root cause, file location, and concrete fix. + +## Immediate next steps + +1. **Delete or implement GeminiRunner** (`internal/executor/gemini.go`) — it silently returns hardcoded fake output. Any task with `agent.type: gemini` produces wrong results in production. Deleting it is the safe path. + +2. **Wrap execution creation in a transaction** — `execute()` calls `CreateExecution` then `UpdateTaskState(RUNNING)` as separate writes. Add `storage.CreateExecutionAndSetRunning()`. + +3. **Fix `context.Background()` in resume path** — `handleAnswerQuestion()` in `api/server.go` submits with `context.Background()` instead of the server's root context. + +4. **Add `Pool.Shutdown(ctx)`** — `dispatch()` goroutine leaks on server shutdown; `workCh` is never closed. + +5. **Remove dead code: `QuestionRegistry`** — created in `NewPool`, stored on `Pool.Questions`, never read. Remove along with `QuestionHandler` interface. + +6. **Fix `parseStream` ignoring `scanner.Err()`** — silent data loss if stdout read fails mid-stream. + +7. **Remove changestats extraction from `api.Server.processResult()`** — pool already does it; the second extraction is idempotent but confusing. + +## To dogfood (run tasks through claudomator itself) + +- Build: `go build -o claudomator ./cmd/claudomator/` +- Init + serve: `./claudomator init && ./claudomator serve` +- Set `project_dir` in tasks to point at the canonical repo (`/workspace/claudomator` per CLAUDE.md) +- The sandbox fix means agent work will now actually be committed and pushed back -- cgit v1.2.3