Skip to content

fix: detect .todos file vs directory conflict in onboarding#206

Merged
marcus merged 2 commits intomainfrom
fix/194-todos-file-conflict
Feb 26, 2026
Merged

fix: detect .todos file vs directory conflict in onboarding#206
marcus merged 2 commits intomainfrom
fix/194-todos-file-conflict

Conversation

@marcus
Copy link
Owner

@marcus marcus commented Feb 26, 2026

Problem

When a .todos file (not directory) exists in a project, sidecar's onboarding silently fails — the setup dialog stays open, reinitializing in a loop, and clicking "Skip" shows "td is not installed" even though it is.

Root cause: An AI agent (or other tool) created a .todos file where sidecar expects a .todos directory for td's SQLite database.

Fix

  • Added CheckTodosConflict() in tdroot that uses Lstat to detect when .todos exists as a file or symlink-to-file instead of a directory
  • Plugin Init() now checks for the conflict before attempting monitor creation
  • View() renders a clear error with remediation instructions (mv .todos .todos.bak && td init)
  • Diagnostics() reports the conflict as an error state
  • performSetup() validates before calling td init instead of silently failing

Tests

5 new tests covering: no .todos, directory exists, file exists, symlink, and full plugin integration.

Also fixes 2 pre-existing test failures in tdmonitor (TestInitWithValidDatabase, TestDiagnosticsWithDatabase).

Fixes #194

marcus and others added 2 commits February 25, 2026 19:30
When a .todos file (not directory) exists, sidecar's onboarding now:
- Detects the conflict before attempting td init
- Shows a clear error with remediation instructions
- Reports the conflict in diagnostics

Fixes #194
TestInitWithValidDatabase and TestDiagnosticsWithDatabase were failing
because they checked for .todos/issues.db at the raw project path, but
monitor.NewEmbeddedWithOptions follows .td-root which redirects to a
different (unreachable) directory. Fix by resolving the database path
via tdroot.ResolveDBPath before checking the precondition, and extract
the shared logic into findProjectRootWithDB helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marcus marcus merged commit fb39dc1 into main Feb 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent onboarding failure when file named ".todos" exists.

1 participant