Skip to content

extensions: unify todo directory resolution across idle-compact and todos #118

@benvinegar

Description

@benvinegar

Problem

idle-compact.ts and todos.ts resolve todo directories differently:

  • idle-compact.ts derives path from PI_TODO_PATH or join('.pi','todos'), then applies process.cwd().
  • todos.ts has its own getTodosDir()/label logic and default semantics.

This can cause idle compaction to think there are no active todos when the todo tool is actually using a different directory.

Proposed solution

  • Extract shared todo-dir resolution utility used by both extensions.
  • Define one canonical resolution order:
    1. PI_TODO_PATH absolute/relative
    2. default .pi/todos relative to canonical runtime cwd (or explicit home-based path)
  • Add tests proving both extensions see the same effective todo dir under different cwd/env combinations.

Helpful context

  • pi/extensions/idle-compact.ts: TODO_DIR, hasInProgressTodos() path resolution via process.cwd().
  • pi/extensions/todos.ts: TODO_PATH_ENV, TODO_DIR_NAME, getTodosDir(process.cwd()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions