Skip to content

feat(studio): WiFi token memory#89

Merged
pbertsch merged 1 commit intomainfrom
feat/studio-wifi-token-memory
May 3, 2026
Merged

feat(studio): WiFi token memory#89
pbertsch merged 1 commit intomainfrom
feat/studio-wifi-token-memory

Conversation

@pbertsch
Copy link
Copy Markdown
Contributor

@pbertsch pbertsch commented May 3, 2026

Summary

Studio now remembers the agent token per discovered WiFi device. After a successful `ConnectWiFi`, subsequent mDNS-discovered sessions for that device prefill the token automatically — eliminating the only friction point in the v0.7.0 mDNS flow.

v0.7.1 PR 1 of 3.

How it works

  • Token store is a `Record<string, string>` keyed by the Bonjour instance name (e.g. `Patricks-iPhone`), persisted in localStorage as JSON.
  • On `wifi:device-found`: if a token is remembered for that name, the device list shows `🔑 saved` plus a `✕` forget button.
  • On device click: the token input is prefilled (still editable for cases where the device's token rotated).
  • On successful connect: the token (whether prefilled or freshly entered) is saved.
  • On `✕` click: removes the entry and toasts a confirmation.

Trust boundary

Tokens are persisted in the WebView's localStorage, which is sandboxed inside the Studio desktop app — same trust boundary as the user's filesystem. The agent token gates an LAN-only test surface (not production credentials), so this is an acceptable storage choice for v0.7.x. If we ever need real secret storage we'll move to macOS Keychain via the `keyring` Go package.

Keyed by name (not host:port) because IPs change across DHCP leases but device hostnames are stable.

Test plan

  • `tsc --noEmit` clean
  • Manual: first connect — open WiFi modal, click discovered device, paste token, connect. Verify subsequent reopen of modal shows `🔑 saved` for that device.
  • Manual: prefill — close + reopen modal, click the same device, verify token input is prefilled.
  • Manual: forget — click `✕` next to a remembered device, verify the saved tag and forget button disappear, verify token input is empty on next click.

Persist (deviceName → token) in localStorage after a successful
ConnectWiFi. On the next mDNS discovery for that device, prefill the
token input and show a "🔑 saved" tag. Each remembered device gets
a small "✕" button to forget its token.

Keyed by the Bonjour instance name (typically the device hostname)
since the IP can change across DHCP leases but the name is stable.
Tokens for an LAN-only test agent inside a desktop app are an
acceptable trust boundary; this is not a credential vault.

Pure frontend change — no Wails methods, no agent changes.
@pbertsch pbertsch requested a review from a team as a code owner May 3, 2026 00:01
@pbertsch pbertsch merged commit 37d72dc into main May 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant