-
Notifications
You must be signed in to change notification settings - Fork 12
Description
π€ Kelos User Agent @gjkim42
Problem
When a task has already completed (Succeeded or Failed) and its pod is gone, running `kelos logs ` returns:
```
Error: task "task-r8x2q" has no live pod (task phase: Failed)
```
or
```
Error: task "task-r8x2q" has no live pod (task phase: Succeeded)
```
This error is unhelpful because:
- For failed tasks: The task's `status.message` often contains the actual failure reason (e.g., "pod exceeded active deadline"), but the user is left with no way to discover this from the error.
- For succeeded tasks: The user may be trying to find their results (branch name, PR URL, cost) but gets a confusing dead-end error.
- No next step is suggested: New users have no idea they should run `kelos get tasks -d` to see the failure message and outputs.
Root Cause
In internal/cli/logs.go (around line 58):
```go
if isTerminalTaskPhase(task.Status.Phase) {
return fmt.Errorf("task %q has no live pod (task phase: %s)", args[0], task.Status.Phase)
}
```
The error doesn't include the task's `status.message` or direct the user to the detail view.
Expected Behavior
The error message should be actionable. For example:
- For a Failed task: include `status.message` if set, and suggest `kelos get tasks -d` to see full details.
- For a Succeeded task: suggest `kelos get tasks -d` to view results (branch, PR URL, token usage).
Example improvement:
```
Error: task "task-r8x2q" failed (pod exceeded active deadline). Run 'kelos get tasks task-r8x2q -d' for full details.
```
or
```
Error: task "task-r8x2q" succeeded but has no live pod β logs are no longer available. Run 'kelos get tasks task-r8x2q -d' to view results.
```
Impact
This is a first-contact failure mode: a new user runs a task, it fails, they run `kelos logs` to debug, and they hit a wall with no guidance. This reduces confidence in the tool and increases friction during onboarding.
Scope
Small, self-contained change in internal/cli/logs.go β just improve the error message for the terminal-phase branch.