Commit 29ebfd7
committed
fix(cli): also detect bm/bm.exe entrypoints in mcp pre-flight scan
Codex P1 on #776: the previous matcher required the literal string
'basic-memory' somewhere in argv, so a process started via the
supported `bm mcp` alias entrypoint slipped through and the reset
proceeded against a live MCP — the exact bug the pre-flight is
supposed to block.
Extract the matching to _is_basic_memory_mcp() and recognize:
- basic-memory / basic_memory tokens (any position)
- bm script invocations across path conventions (`bm`, `/usr/local/bin/bm`,
`bm.exe`, `~/.venv/Scripts/bm.exe`) using both PurePosixPath and
PureWindowsPath so cross-OS test fixtures work regardless of the
host platform.
Test now covers both the alias forms and the negative cases (`mcp`
appearing as a substring or in an unrelated server's argv).
Signed-off-by: phernandez <paul@basicmachines.co>1 parent 9c4b1f7 commit 29ebfd7
2 files changed
Lines changed: 47 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
26 | 56 | | |
27 | 57 | | |
28 | 58 | | |
| |||
51 | 81 | | |
52 | 82 | | |
53 | 83 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 84 | + | |
| 85 | + | |
59 | 86 | | |
60 | 87 | | |
61 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
58 | | - | |
59 | | - | |
60 | 69 | | |
61 | | - | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
| |||
0 commit comments