diag: add example.com connectivity probe (PROBE_RESULT) to determine if Figma sandbox has internet egress; bump 0.1.11

This commit is contained in:
Hermes Agent committed 2026-09-19 18:01:33 +02:00
1 parent 7307fa6c76
commit 0f7005e4b1
5 files changed
+20 -4

No files matched your search

+7
View File
@@ -511,6 +511,13 @@ export default function () {
emit('MODELS_RESULT', { ok: false, error: 'fetch is not available in the plugin main thread', models: [], status: 0, requestEcho: echo })
return
}
// diagnostic: can the sandbox reach the public internet at all?
try {
const pr = await fetch('https://example.com')
emit('PROBE_RESULT', { msg: 'example.com reachable · status=' + pr.status })
} catch (pe) {
emit('PROBE_RESULT', { msg: 'example.com UNREACHABLE · ' + (pe != null ? (typeof pe === 'string' ? pe : JSON.stringify(pe)) : 'unknown') })
}
const base = payload.baseUrl.replace(/\/+$/, '')
const res = await fetch(base + '/models', {
headers: { Authorization: 'Bearer ' + payload.apiKey }
+8 -1
View File
@@ -29,7 +29,7 @@ const MIN_WINDOW_SIZE = { width: 320, height: 200 }
// very high — actual clamp is done by main via clampWindowSize (bounds*zoom).
// Full plugin version shown in the footer status bar. Keep in sync with package.json "version".
const PLUGIN_VERSION = '0.1.10'
const PLUGIN_VERSION = '0.1.11'
const fieldStyle = {
display: 'flex',
@@ -135,6 +135,13 @@ function SettingsPanel (props: { settings: Settings, setSettings: (s: Settings)
return dispose
}, [])
useEffect(function () {
const dispose = on('PROBE_RESULT', function (p: { msg: string }) {
logEvent('PROBE: ' + p.msg)
})
return dispose
}, [])
function patch (p: Partial<ProviderConfig>) {
if (provider == null) return
setSettings({