tmux-python / tmux-python/libtmux-mcp

`--repo` without `[project.scripts]` exits with a traceback

Open Beginner friendly
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
13
Forks
0
Avg merge
13h 52m
Merged PRs (30d)
4

Description

Summary

A --repo pointing at a project whose pyproject.toml has no [project.scripts] raises RuntimeError out of resolve_repo_meta with a full traceback, rather than the one-line diagnostic every other failure in the script prints. --entry cannot rescue it either: the derived-value lookup runs before the override is applied.

A nonexistent --repo path is handled cleanly, so this is specific to the no-scripts case.

Reproduction
printf '[project]\nname = "x"\n' > "$SB/bare/pyproject.toml"
run use-local --repo "$SB/bare" --cli cursor --no-preflight
run use-local --repo "$SB/bare" --entry libtmux-mcp --cli cursor --no-preflight
Expected

A one-line message and a non-zero exit, matching how the script reports every other bad input. --entry should let a caller name the entry point when it cannot be derived.

Actual
  File ".../scripts/mcp_swap.py", line 732, in resolve_repo_meta
    raise RuntimeError(msg)
RuntimeError: <sandbox>/bare/pyproject.toml has no [project.scripts] — cannot derive entry

The repo's own tests assert "Traceback" not in captured.err for CLI-boundary failures elsewhere, so this path is inconsistent with the intended contract.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scripts/mcp_swap.py at resolve_repo_meta around lines 710-735, then trace how --entry is applied and how other CLI-boundary failures are reported. Reproduce with a pyproject.toml lacking [project.scripts], using both --repo and --entry. Done means both cases emit a one-line diagnostic without "Traceback" and exit non-zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.