Skip to content

bug: per-repo .gortex.yaml changes require a full daemon restart — daemon reload drops the workspace-config cache but nothing re-reads it; re-track short-circuits #320

Description

@tiendungdev

Env: gortex daemon vv0.61.0+58dc39b, Windows 11 Pro (10.0.26200), one tracked repo (~2.6k files, Go+TS+SQL+MD), MCP facade v1.

Repro

  1. Repo is tracked and indexed. Edit <repo>/.gortex.yaml: add exclude: entries for two already-indexed directories and a guards.rules block.
  2. MCP workspace_admin {operation:"reindex"} → walk still admits the excluded dirs (scoped reindex over them reports file_count: 309), and change {operation:"guards"} still answers no guard rules configured. Expected if the config were live: ~0 files walked, rules evaluated.
  3. Run gortex daemon reload, then reindex again → same stale behavior.
  4. MCP workspace_admin {operation:"track", path:<repo>} → returns repository already tracked, config still not re-read.
  5. Full daemon restart → config finally applies: full walk drops 2613 → 2305 files, guards evaluate (a positive test fires a violation).

Analysis (from reading internal/config/manager.go)

  • ConfigManager.Reload() re-reads the global config and drops the workspace cache, with the comment "individual .gortex.yaml files are re-read lazily on demand".
  • But the only writer of that cache is LoadWorkspaceConfig, which is invoked at track/boot time. The indexer/EffectiveExclude path never calls it for an already-tracked prefix, so "lazily on demand" never happens — after a reload the repo effectively runs with no workspace config (not even the old one) until restart.
  • track on an existing repo short-circuits before reloading the workspace config.

Expected

Either Reload() (or the next reindex after it) re-runs LoadWorkspaceConfig for each tracked repo, or re-track refreshes it. If restart-only is intended, docs should say so — today the reload path silently leaves the repo config-less.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions