Skip to content

feat: make repo mandatory, remove default source & ref#208

Merged
stephantul merged 3 commits into
mainfrom
make-repo-mandatory
Jun 22, 2026
Merged

feat: make repo mandatory, remove default source & ref#208
stephantul merged 3 commits into
mainfrom
make-repo-mandatory

Conversation

@stephantul

Copy link
Copy Markdown
Contributor

This PR makes the repo argument mandatory for the MCP. The MCP used to take a path and ref argument on startup, but since MCP startup is hardcoded (not controlled by the agent/harness), it was difficult to use this parameter. The consequence of this was that it was possible for agents to send queries without a "repo", as the schema allowed this. This then led to exceptions in the MCP server (i.e., the calls returned no data, just an error message).

The one use case for adding a path, which is enterprise hosting of MCP servers, remains, but should be turned into another MCP server, which we'll add later.

Of note: no docs changes were needed, since this path option was not even mentioned there.

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/cli.py 100.00% <100.00%> (ø)
src/semble/mcp.py 100.00% <100.00%> (ø)
src/semble/types.py 100.00% <ø> (+2.32%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/test_cli.py
@pytest.mark.parametrize(
"argv",
[
["semble", "/some/path", "--ref", "main"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this as a parameterize, even though there's only a single option now , seemed sensible given that we want to expand this again.

@greptile-apps

greptile-apps Bot commented Jun 21, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge — the change is a clean removal of optional startup configuration and its downstream machinery, with no remaining dead code and fully updated tests.

All removed code paths (start_watcher, _watch_loop, _watcher_task, default_source, SearchResult.to_dict) have no remaining callers in the repo. The mandatory repo enforcement is correctly propagated through _get_index, create_server, and the tool schemas. Tests were updated comprehensively to match the new signatures. The watchfiles package is removed from both pyproject.toml and uv.lock consistently.

No files require special attention.

Reviews (2): Last reviewed commit: "Merge branch 'main' into make-repo-manda..." | Re-trigger Greptile

Comment thread src/semble/mcp.py
Comment thread src/semble/mcp.py Outdated
@stephantul stephantul requested a review from Pringled June 21, 2026 16:31
Comment thread src/semble/types.py
chunk: Chunk
score: float

def to_dict(self) -> dict[str, Any]:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was somehow a pre-existing piece of dead code. Strange!

@stephantul

Copy link
Copy Markdown
Contributor Author

@greptileai review

@Pringled Pringled left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One concern

Comment thread src/semble/mcp.py
def evict(self, source: str) -> None:
self._tasks.pop(self._compute_cache_key(source), None)

async def start_watcher(self, path: str) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm missing something, but by removing this the MCP index never updates anymore I think?

@stephantul stephantul merged commit 923dccd into main Jun 22, 2026
@stephantul stephantul deleted the make-repo-mandatory branch June 22, 2026 07:07
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.

2 participants