refactor(tasks): consolidate task-list path resolution to use getTaskDir
This commit is contained in:
parent
ace2688186
commit
d66e39a887
@ -4,7 +4,7 @@ import { existsSync, readdirSync } from "fs"
|
|||||||
import type { OhMyOpenCodeConfig } from "../../config/schema"
|
import type { OhMyOpenCodeConfig } from "../../config/schema"
|
||||||
import type { TaskObject, TaskStatus } from "./types"
|
import type { TaskObject, TaskStatus } from "./types"
|
||||||
import { TaskObjectSchema } from "./types"
|
import { TaskObjectSchema } from "./types"
|
||||||
import { readJsonSafe } from "../../features/claude-tasks/storage"
|
import { readJsonSafe, getTaskDir } from "../../features/claude-tasks/storage"
|
||||||
|
|
||||||
interface TaskSummary {
|
interface TaskSummary {
|
||||||
id: string
|
id: string
|
||||||
@ -23,9 +23,7 @@ For each task's blockedBy field, filters to only include unresolved (non-complet
|
|||||||
Returns summary format: id, subject, status, owner, blockedBy (not full description).`,
|
Returns summary format: id, subject, status, owner, blockedBy (not full description).`,
|
||||||
args: {},
|
args: {},
|
||||||
execute: async (): Promise<string> => {
|
execute: async (): Promise<string> => {
|
||||||
const tasksConfig = config.sisyphus?.tasks
|
const taskDir = getTaskDir(config)
|
||||||
const storagePath = tasksConfig?.storage_path ?? ".sisyphus/tasks"
|
|
||||||
const taskDir = storagePath.startsWith("/") ? storagePath : join(process.cwd(), storagePath)
|
|
||||||
|
|
||||||
if (!existsSync(taskDir)) {
|
if (!existsSync(taskDir)) {
|
||||||
return JSON.stringify({ tasks: [] })
|
return JSON.stringify({ tasks: [] })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user