Repository navigation
Commit d874ac4
committed
fix(mcp-server): respect Vite base in agent module injection
injectAgent always inserted /@id/octane/agent as a root-absolute URL,
but Vite serves its /@id/ handler under the configured base prefix.
With a non-/ base the script request would 404, so __OCTANE_AGENT__
never appeared and openApp timed out with a misleading error.
Detect the base from Vite's @vite/client script tag already present in
the transformed HTML, and prefix the agent module URL with it. When no
@vite/client tag is found, fall back to /.1 parent 053b6fb commit d874ac4
1 file changed
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | | - | |
| 90 | + | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
| |||
0 commit comments