Skip to content

bug: MCP workspace_admin track of a fresh repo can never succeed — the first index runs inside the MCP request context and is killed at the 60s request deadline, rolling back registration #326

Description

@tiendungdev

Env: gortex v0.61.0, Windows 11 Pro, fresh empty store, repo of 2,305 admitted files (~25 MB source).

Repro

  1. Fresh store (no tracked repos), daemon running.
  2. MCP workspace_admin {operation:"track", path:<repo>}.
  3. The tool call returns MCP error -32001: request deadline exceeded after ~60s.
  4. Repo remains untracked: every subsequent call answers repository not tracked, and the daemon log shows tracked_roots: [].

Daemon log (timestamps trimmed)

09:50:15 indexer: shadow-swap decision repo="" bulk_loader=true first_index=true
         pre_nodes=0 files=2305 ... shadow_taken=true
09:50:50 daemon: mcp request lifetime ended session_id=... outcome=deadline
         deadline=60 error="context deadline exceeded"
09:51:03 mcp session cwd is not covered by any tracked repo ... tracked_roots=[]

The shadow first-index starts fine (config + gitignore layers applied — the 2,305-file admission is correct), but it is bound to the MCP request context; when the request lifetime hits the hardcoded 60s deadline the context cancels, the shadow dies, and the track never commits. There is no persisted job, so retrying just repeats the cycle. CLI gortex track (no 60s lifetime) is the only path that works.

Expected

track should either detach the initial index from the request lifetime (return accepted/job-id immediately, index continues server-side — the same way boot indexing works), or the request deadline for control-plane writes should scale with the work. As-is, MCP-driven tracking only works for repos that fully index in <60s.

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