( ctx context.Context, resolvePlanPath func(context.Context) (chatPath string, home string, err error), )
| 54 | } |
| 55 | |
| 56 | func resolvePlanTurnPath( |
| 57 | ctx context.Context, |
| 58 | resolvePlanPath func(context.Context) (chatPath string, home string, err error), |
| 59 | ) (string, error) { |
| 60 | if resolvePlanPath == nil { |
| 61 | return "", xerrors.New("chat-specific plan path resolver is not configured") |
| 62 | } |
| 63 | |
| 64 | planPath, _, err := resolvePlanPath(ctx) |
| 65 | if err != nil { |
| 66 | return "", xerrors.Errorf("resolve chat-specific plan path: %w", err) |
| 67 | } |
| 68 | planPath = strings.TrimSpace(planPath) |
| 69 | if planPath == "" { |
| 70 | return "", xerrors.New("chat-specific plan path is empty") |
| 71 | } |
| 72 | |
| 73 | return planPath, nil |
| 74 | } |
| 75 | |
| 76 | // chatd consumes agent-normalized POSIX paths. Workspace agents are |
| 77 | // expected to convert separators to forward slashes before these |
no test coverage detected