Skip to content

Committed ast_rag_config.json points at a private LAN, so a fresh clone hangs ~6min on first init #62

Description

@r0h1tb

Summary

ast_rag_config.json is committed to the repo pointing at a private LAN, and it is auto-loaded from the working directory. A fresh clone therefore tries to reach 192.168.2.109 on first run and hangs until every connection times out. There is no environment-variable override, so the only ways out are editing a tracked file or knowing to pass --config.

Verified on a fresh clone of main (ff8cf65)

git clone https://github.com/lexasub/raged.git && cd raged
export NEO4J_URI=bolt://localhost:7687 NEO4J_PASSWORD=... QDRANT_URL=http://localhost:6333
python -m ast_rag init .
ERROR:ast_rag.repositories.schema_manager:Failed to create index ast_node_id_idx:
  Couldn't connect to 192.168.2.109:7687 (resolved to ('192.168.2.109:7687')):
  Timed out trying to establish connection to ResolvedIPv4Address(('192.168.2.109', 7687))

Failed after 361 seconds, with correct NEO4J_* / QDRANT_URL env vars exported the whole time.

What the committed file points at

key value
neo4j.uri bolt://192.168.2.109:7687
qdrant.url http://192.168.2.109:6333
summarizer.llm.base_url http://192.168.2.109:1113/v1
embedding.remote_url http://192.168.2.6:1113/v1/embeddings

Two distinct hosts, so this looks like a personal dev environment rather than a placeholder. (Worth a glance at whether anything else in there is sensitive — I only looked at the URLs.)

Root cause

# ast_rag/cli.py:104-112
def _load_config(config_path: Optional[str] = None) -> ProjectConfig:
    if config_path and Path(config_path).exists():
        return ProjectConfig.model_validate_json(Path(config_path).read_text())
    # Check for ast_rag_config.json in CWD
    default = Path("ast_rag_config.json")
    if default.exists():
        return ProjectConfig.model_validate_json(default.read_text())
    return ProjectConfig()

Precedence is --config → committed file → defaults. Nothing reads the environment. Confirmed directly:

>>> os.environ["NEO4J_URI"]        # 'bolt://localhost:7687'
>>> _load_config(None).neo4j.uri   # 'bolt://192.168.2.109:7687'

ProjectConfig() defaults are sane — the committed file is what shadows them.

Also inconsistent with the README

README §Configuration says "Create ast_rag_config.json in project root" and shows localhost values. But the file already exists, so a reader following that instruction either silently skips the step or overwrites tracked content and shows up dirty in git status.

Suggested fix

  1. git rm --cached ast_rag_config.json, add it to .gitignore, and ship ast_rag_config.example.json with localhost values instead. The README instruction then becomes true.
  2. Optionally let env vars override — NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, QDRANT_URL — which is what CI and containers expect, and what I assumed would work here.
  3. Optionally drop neo4j.connection_timeout for the first connection so a wrong host fails in seconds rather than six minutes.

(1) alone fixes the reported breakage; (2) and (3) are quality-of-life and I'd rather you pick than guess.

Possibly related: #30 (agent runs MCP but doesn't use config) — different symptom, same config-resolution area.

Happy to send a PR for whichever subset you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions