paperclip/ui/src/pages
Devin Foley aea35fe695
exe.dev config UX: advanced-options disclosure, form-default fix, SSH key handling (PAPA-407) (#7025)
## Thinking Path

> - Paperclip orchestrates AI agents and provisions sandboxed execution
environments for them; one of those provisioners is the exe.dev plugin,
which runs each agent inside a long-lived VM reached over SSH.
> - The instance-config form for that plugin is rendered generically by
`JsonSchemaForm` from the plugin's `instanceConfigSchema`, so any UX
problem with the form is split between the shared form component and the
plugin's schema/runtime code.
> - Users coming in cold hit a 12-field flat config they couldn't reason
about (PAPA-407), a form that silently submitted `cpu: 0` for untouched
optional fields (PAPA-407 root cause), a `sshPrivateKey` textarea that
truncated RSA-4096 keys at 4096 chars (PAPA-449), a save flow that
accepted clearly-malformed keys and only blew up at lease time with raw
SSH stderr (PAPA-450, PAPA-451), and a manifest that didn't distinguish
"essential" from "advanced" knobs (PAPA-410 / PAPA-411 — duplicate
sub-issues with identical scope; PAPA-418 reconciliation kept PAPA-410
canonical).
> - These problems all point at the same surface (exe.dev sandbox
config) and are tightly coupled in code — PAPA-449/450/451 patch fields
that PAPA-410/411 introduce — so they get reviewed together.
> - This pull request lands the shared-form changes (advanced-options
disclosure, optional-scalar defaults) and the exe.dev-specific changes
(manifest restructure, longer `maxLength`, stderr translation, save-time
key validation) as five focused commits stacked on `master`.
> - The benefit is a config form that defaults to the two fields a new
user actually needs (API key + SSH private key) with a collapsible
disclosure for the rest, no silent truncation or zero-default
submissions, and SSH key problems surfaced at save time with actionable
messages instead of cryptic post-provision failures.

## What Changed

- **JsonSchemaForm advanced-options disclosure** (PAPA-410, PAPA-411 —
same scope, see note above): adds `x-paperclip-advanced` /
`x-paperclip-group` schema annotations and renders flagged fields behind
a collapsible "Advanced options" disclosure that auto-opens when a
hidden field has a validation error. Exe.dev manifest is restructured to
use the new annotations, so essentials (`apiKey`, `sshPrivateKey`) show
by default while the long tail of optional knobs is grouped under "SSH
access" / "VM resources" / "More options" headings.
- **Omit optional scalar defaults** (PAPA-407): `getDefaultForSchema` no
longer materialises `0` / `""` for optional
`number`/`integer`/`string`/`secret-ref` fields without an explicit
`default`. Object recursion drops properties whose default is
`undefined`. Fields that declare a `default` (e.g. `sshPort: 22`) still
round-trip. Adds a regression test against `getDefaultValues`.
- **Raise `sshPrivateKey` `maxLength`** (PAPA-449): bumps the exe.dev
manifest cap from 4096 to 8192 so RSA-4096 OpenSSH private keys (which
can exceed 4 KB with comments/metadata) aren't silently truncated at
submit.
- **Translate `invalid format` SSH stderr** (PAPA-450):
`formatSshFailure` now recognises `Load key … invalid format` in
combined stderr/stdout and returns a specific message naming the
key-format problem ("isn't an OpenSSH/PEM private key — confirm the
secret starts with `-----BEGIN … PRIVATE KEY-----` and isn't the `.pub`
or a PuTTY `.ppk` export") instead of dumping the raw stderr.
- **Save-time SSH key validation** (PAPA-451):
`onEnvironmentValidateConfig` inline-parses `sshPrivateKey` and rejects
common failure modes — pasted public keys, PuTTY `.ppk` format, missing
`-----END-----` footer, non-base64 body — so the form surfaces an inline
error before any VM is provisioned. Secret-ref bindings (UUIDs) are
still passed through unchanged.

## Verification

CI gates (`pnpm typecheck`, `pnpm test`, the targeted vitest suites
below) all pass.

Run locally:

```bash
# Shared form
pnpm --filter @paperclipai/ui exec vitest run src/components/JsonSchemaForm
# 9 tests pass — includes the new "omits optional scalar fields" regression
# and the three advanced-options-disclosure tests.

# exe.dev plugin
cd packages/plugins/sandbox-providers/exe-dev && pnpm test
# 32 tests pass — includes the new sshPrivateKey-validation cases
# and the new "invalid format" stderr-translation case.
```

Manual smoke (after reinstalling the plugin so the DB manifest
refreshes):

1. Open the exe.dev environment config page. **Default view shows API
Key + SSH Private Key only**, with an "Advanced options" disclosure for
everything else (PAPA-410 / PAPA-411).
2. Paste a `.pub` file's contents into SSH Private Key, click Save.
**Inline error** rejecting the wrong-format key (PAPA-451).
3. Re-paste a valid OpenSSH/PEM private key longer than 4096 bytes —
saves cleanly (PAPA-449).
4. Save the form with everything optional left blank — server no longer
rejects with `"cpu must be greater than 0 when provided"` (PAPA-407).
5. Force a bad key through via a stored secret-ref binding and lease a
VM — failure message names the key-format problem instead of dumping raw
SSH stderr (PAPA-450).

## Risks

- **PAPA-410 / PAPA-411 manifest restructure** is the largest surface
here. Schemas using `x-paperclip-*` extensions are forward-compatible
with stricter JSON Schema validators (extensions are ignored by
default), and the form gracefully renders a flat layout when no field
opts in.
- **PAPA-407** changes form-default behaviour: optional scalar fields
that previously round-tripped as `""` / `0` will now be `undefined` and
absent from the submitted payload. Downstream consumers that expected
the empty-string/zero shape need to treat the field as optional.
Spot-checked the existing exe.dev driver — it already uses
`parseOptionalString` / `parseOptionalInteger`, which treat missing
fields as `null` rather than `0`/`""`.
- **PAPA-451** adds a save-time check, so a
previously-saved-but-malformed `sshPrivateKey` raw value will now fail
to re-save. Bound secret-refs are unaffected, matching how the user
reaches the bad-key state today (via the secrets picker).
- **PAPA-449** simply raises a cap; no semantic risk.
- **PAPA-450** only kicks in on the "invalid format" code path; existing
onboarding-marker branch is untouched.

## Model Used

- Provider: Anthropic
- Model: Claude Opus 4.7 (`claude-opus-4-7`)
- Capabilities used: code reading, code editing, test execution, git/PR
mechanics, Paperclip API for issue coordination

## Checklist

- [x] PR body sections present (Thinking Path, What Changed,
Verification, Risks, Model Used, Checklist)
- [x] Unit tests added for the new behaviours (JsonSchemaForm
default-value omission + advanced disclosure; exe.dev plugin validation
+ stderr translation)
- [x] Existing tests still pass locally (`vitest run` on both packages)
- [x] No raw secrets, IP addresses, or machine-local config in commits
or PR body
- [x] Commits are atomic per linked issue (PAPA-410 / PAPA-411,
PAPA-407, PAPA-449, PAPA-450, PAPA-451)
- [x] Branch is up-to-date with `origin/master`

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-29 18:19:37 -07:00
..
secrets Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
Activity.tsx [codex] Harden heartbeat scheduling and runtime controls (#4223) 2026-04-21 12:24:11 -05:00
AdapterManager.tsx Add cheap model profiles for local adapters (#4881) 2026-04-30 15:32:04 -05:00
AgentDetail.tsx [codex] Add skills CLI and catalog management (#6782) 2026-05-28 07:33:51 -10:00
Agents.test.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
Agents.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
ApprovalDetail.tsx fix: keep runtime UI changes self-contained 2026-04-10 22:36:45 -05:00
Approvals.tsx Add generic issue-linked board approvals 2026-04-06 21:24:38 -05:00
Auth.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
BoardClaim.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
BootstrapSetupUxLab.tsx [codex] Add private browser first-admin claim flow (#6755) 2026-05-27 21:15:01 -10:00
CliAuth.tsx Add browser-based board CLI auth flow 2026-03-23 08:46:05 -05:00
CloudUpstream.test.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
CloudUpstream.tsx [codex] Add local Cloud Upstream sync (#6548) 2026-05-22 09:56:22 -05:00
CloudUpstreamUxLab.tsx [codex] Add local Cloud Upstream sync (#6548) 2026-05-22 09:56:22 -05:00
Companies.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
CompanyAccess.test.tsx [codex] Add agent permissions and controls plan (#6386) 2026-05-22 08:12:52 -05:00
CompanyAccess.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
CompanyEnvironments.tsx exe.dev config UX: advanced-options disclosure, form-default fix, SSH key handling (PAPA-407) (#7025) 2026-05-29 18:19:37 -07:00
CompanyExport.tsx [codex] Polish board UI mobile flows (#6550) 2026-05-22 10:13:47 -05:00
CompanyImport.tsx [codex] Polish board UI mobile flows (#6550) 2026-05-22 10:13:47 -05:00
CompanyInvites.test.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
CompanyInvites.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
CompanySettings.test.tsx Clarify sandbox provider messaging in company environments (#4902) 2026-05-09 23:03:26 -07:00
CompanySettings.tsx Improve external agent invite flow (#6183) 2026-05-23 09:09:40 -05:00
CompanySettingsPluginPage.test.tsx [codex] Add agent permissions and controls plan (#6386) 2026-05-22 08:12:52 -05:00
CompanySettingsPluginPage.tsx [codex] Add agent permissions and controls plan (#6386) 2026-05-22 08:12:52 -05:00
CompanySkills.tsx [codex] Add skills CLI and catalog management (#6782) 2026-05-28 07:33:51 -10:00
Costs.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
Dashboard.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
DashboardLive.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
DesignGuide.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
ExecutionWorkspaceDetail.test.tsx [codex] Add workspace diff viewer plugin (#6071) 2026-05-18 08:50:06 -05:00
ExecutionWorkspaceDetail.tsx [codex] Add workspace diff viewer plugin (#6071) 2026-05-18 08:50:06 -05:00
GoalDetail.test.tsx fix goal view properties toggle 2026-03-30 12:49:22 +05:30
GoalDetail.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
Goals.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
Inbox.test.tsx [codex] UI and dev ops quality-of-life (#6384) 2026-05-19 15:52:39 -05:00
Inbox.tsx [codex] UI and dev ops quality-of-life (#6384) 2026-05-19 15:52:39 -05:00
InstanceAccess.tsx [codex] Add access cleanup and user profile page (#4088) 2026-04-20 06:10:20 -05:00
InstanceExperimentalSettings.tsx Add accepted-plan decomposition exact-once guards and UI state (#6831) 2026-05-28 23:30:18 -07:00
InstanceGeneralSettings.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
InstanceSettings.tsx Address Greptile review on agent runtime PR 2026-03-23 17:18:17 -05:00
InviteLanding.test.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
InviteLanding.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
InviteUxLab.test.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
InviteUxLab.tsx [codex] Bundle local branch fixes from PAP-10032 (#6604) 2026-05-25 07:25:26 -05:00
IssueChatLongThreadPerf.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
IssueChatUxLab.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssueDetail.test.tsx Add accepted-plan decomposition exact-once guards and UI state (#6831) 2026-05-28 23:30:18 -07:00
IssueDetail.tsx Add accepted-plan decomposition exact-once guards and UI state (#6831) 2026-05-28 23:30:18 -07:00
Issues.test.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
Issues.tsx [codex] Polish board UI mobile flows (#6550) 2026-05-22 10:13:47 -05:00
JoinRequestQueue.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
MyIssues.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
NewAgent.tsx Switch OpenCode to explicit static/local-aware model selection (#5117) 2026-05-03 13:01:34 -07:00
NotFound.tsx ui: add company-aware not found handling 2026-03-10 16:38:46 -05:00
Org.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
OrgChart.test.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
OrgChart.tsx [codex] Improve mobile org chart navigation (#4127) 2026-04-20 10:35:33 -05:00
PluginManager.tsx [codex] Show bundled plugins in plugin manager (#6734) 2026-05-26 07:32:45 -06:00
PluginPage.test.tsx Expand plugin host surface (#5205) 2026-05-05 07:42:57 -05:00
PluginPage.tsx Expand plugin host surface (#5205) 2026-05-05 07:42:57 -05:00
PluginSettings.test.tsx Expand plugin host surface (#5205) 2026-05-05 07:42:57 -05:00
PluginSettings.tsx Expand plugin host surface (#5205) 2026-05-05 07:42:57 -05:00
ProfileSettings.test.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
ProfileSettings.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
ProjectDetail.test.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
ProjectDetail.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
Projects.test.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
Projects.tsx [codex] Add resource membership controls (#6677) 2026-05-25 13:12:41 -05:00
ProjectWorkspaceDetail.test.tsx [codex] Add workspace diff viewer plugin (#6071) 2026-05-18 08:50:06 -05:00
ProjectWorkspaceDetail.tsx [codex] Add workspace diff viewer plugin (#6071) 2026-05-18 08:50:06 -05:00
RoutineDetail.tsx [codex] Add routine env secrets support (#6212) 2026-05-17 16:30:34 -05:00
Routines.test.tsx [codex] Roll up May 17 branch changes (#6210) 2026-05-17 17:15:06 -05:00
Routines.tsx Polish operator UI task controls (#5427) 2026-05-07 12:24:02 -05:00
RunTranscriptUxLab.tsx Tighten command transcript rows and dashboard card 2026-03-11 13:14:08 -05:00
Search.test.tsx Add full company search page (#5293) 2026-05-06 06:32:37 -05:00
Search.tsx Add full company search page (#5293) 2026-05-06 06:32:37 -05:00
Secrets.render.test.tsx [codex] Provider vault secrets UX (#6381) 2026-05-19 15:50:23 -05:00
Secrets.test.ts Add secrets provider vaults and remote import (#5429) 2026-05-09 18:22:17 -05:00
Secrets.tsx [codex] Provider vault secrets UX (#6381) 2026-05-19 15:50:23 -05:00
SystemNoticeUxLab.tsx Add recovery handoff system notices (#5289) 2026-05-06 06:05:58 -05:00
UserProfile.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
Workspaces.tsx [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00