Commit 2a26dbb
fix(app-studio): make sandbox runner reach ready and preview work in portal
Several bugs prevented the App Studio sandbox from becoming ready and the
preview from loading inside the portal.
sandbox-runner template (startCommand default):
- kro embeds schema defaults into the generated CRD without escaping
newlines, so the multi-line block scalar made CRD creation fail with
"invalid character '\n' in string literal" and the RGD never activated
(no CRD, no instances, no pod). Keep the default single-line and
base64-encode the Vite shim.
- kro also rewrites inner double quotes to single quotes, so
--port "$SANDBOX_PORT" shipped as '$SANDBOX_PORT' and never expanded.
Use no double quotes and bare $SANDBOX_PORT / $SHIM.
- The Vite config shim must live in the workspace (not /tmp) so Node can
resolve the bare `import 'vite'`; it is written as a gitignored dotfile.
The import is now best-effort and falls back to a plain
{ server: { host, allowedHosts } } config when vite cannot be resolved
(the no-package.json / npx path), so allowedHosts is applied there too.
preview gateway:
- The portal embeds the preview in a cross-site iframe, so the auth cookie
is a third-party cookie that Chrome blocks by default: direct navigation
worked but the portal iframe did not. Mark the cookie Partitioned (CHIPS)
so it survives in the partitioned third-party context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0d050b9 commit 2a26dbb
3 files changed
Lines changed: 69 additions & 3 deletions
File tree
- providers
- app-studio/previewgateway
- infrastructure/install/templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| |||
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 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 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
32 | 86 | | |
33 | 87 | | |
34 | 88 | | |
| |||
0 commit comments