Skip to content

Todo persistence ignores T3CODE_HOME and hardcodes ~/.t3code #111

Closed

Description

@harrryyd

Problem

apps/server/src/todoPersistence.ts:7 hardcodes the todo data directory to Os.homedir() + "/.t3code":

export const T3CODE_DIR = Os.homedir() + "/.t3code";
export const TODOS_PATH = T3CODE_DIR + "/todos.json";
export const TODOS_ARCHIVE_PATH = T3CODE_DIR + "/todos-archive.json";

This ignores the T3CODE_HOME environment variable entirely. Every other persistence module in the codebase respects the configured base directory — todos is the only holdout.

Impact

AGENTS.md requires all dev instances to use isolated state directories:

Always run dev with an isolated home directory:

./scripts/dev.sh → sets T3CODE_HOME=~/.t3-hcode

When running an isolated dev server, the todo module reads and writes the user's real production todo file at ~/.t3code/todos.json. This:

  • Corrupts the production data with test mutations
  • Leaks production data into the dev session
  • Violates the dev-isolation contract

Fix

Thread the configured base directory (from ServerConfig) through to todoPersistence.ts, matching the pattern used by every other persistence module:

export const readTodos = (config: { baseDir: string }) => ...

Or resolve T3CODE_DIR from ServerConfig.providerStatusCacheDir (or equivalent base-dir config key).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds initial triage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions