Commit 4b19960
Fail fast for task jobs with missing prompt (#200)
## Summary
- When a task job (analyze, run, custom) has no stored prompt, the
worker now fails with a clear error message instead of falling through
to `git log` on the analysis type name
## Background (fixes #194)
The reported error was:
```
Error: prompt failed: build prompt: get commit info: git log: exit status 128
```
This happened because `roborev analyze complexity file.go` stores the
analysis type name ("complexity") in the `git_ref` field and the full
prompt in the `prompt` column. The worker is supposed to detect task
jobs via `IsTaskJob() && Prompt != ""` and use the stored prompt
directly, skipping `git log`.
The most likely cause is a **daemon version mismatch**. Prior to
v0.20.0, the worker recognized task jobs only when `git_ref == "prompt"`
(the hardcoded literal). The `IsTaskJob()` function that handles
arbitrary labels like "complexity" was introduced alongside the analyze
command in v0.20.0. If a stale daemon process from an older version is
still running (e.g., not killed by `ensureDaemon` due to a process
management edge case), analyze jobs fall through to the normal commit
path, which runs `git log "complexity"` and fails with exit status 128.
The reporter was on v0.23.1 with codex as the agent (not authenticated),
so the jobs also failed in 0s. The codex auth issue is separate, but the
confusing `git log` error is what this PR addresses.
## Fix
Added a defensive branch in the worker's prompt-building logic: if
`IsTaskJob()` is true but `Prompt` is empty, fail immediately with an
actionable error message suggesting `roborev daemon restart`, instead of
falling through to `git log`.
## Test plan
- [x] `go test ./internal/daemon/ -run TestWorker -v` passes
- [x] `go test ./...` passes
- [ ] Verify that a task job with missing prompt produces the new error
message instead of "git log: exit status 128"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent ae473cd commit 4b19960
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
294 | 299 | | |
295 | 300 | | |
296 | 301 | | |
| |||
0 commit comments