Changes needed for Vellum Assistant on Mac Mini#9335
Conversation
| if (account) sshArgs.push(`--account=${account}`); | ||
| console.log("\ud83d\udd27 Running install script on instance..."); | ||
| await exec("gcloud", sshArgs); | ||
| try { unlinkSync(installScriptPath); } catch {} |
There was a problem hiding this comment.
🟡 Temp file leaked when recoverFromCurlFailure throws during SCP/SSH exec
The new resolveInstallScriptPath() writes the embedded install script to a temp file (/tmp/vellum-install-<pid>.sh). In recoverFromCurlFailure, the cleanup unlinkSync at line 486 is placed after both exec calls but is not in a finally block. If exec("gcloud", scpArgs) at line 473 or exec("gcloud", sshArgs) at line 485 throws, the temp file is never deleted.
Root Cause
Previously, resolveInstallScriptPath returned a path to an existing file on the filesystem (no temp file was created), so there was nothing to clean up. Now that the function writes embedded content to a temp file (cli/src/lib/gcp.ts:375-378), all callers must ensure cleanup even on error paths.
The hatchCustom function in cli/src/commands/hatch.ts:503-505 correctly uses a finally block for cleanup. But recoverFromCurlFailure in gcp.ts does not:
await exec("gcloud", scpArgs); // can throw
await exec("gcloud", sshArgs); // can throw
try { unlinkSync(installScriptPath); } catch {} // skipped if above throwsImpact: A temp file is left behind in /tmp on every failed recovery attempt. Low severity since it's in the OS temp directory and only on error paths.
Prompt for agents
In cli/src/lib/gcp.ts, in the recoverFromCurlFailure function (lines 454-487), wrap the SCP and SSH exec calls (lines 473 and 485) in a try/finally block so that the temp file at installScriptPath is always cleaned up, even if exec throws. Move the unlinkSync at line 486 into the finally block. This matches the pattern used in cli/src/commands/hatch.ts lines 482-505 where the hatchCustom function correctly uses try/finally for temp file cleanup.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7f8230e81
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| const sshKeyPath = process.env.VELLUM_SSH_KEY_PATH; | ||
|
|
||
| const installScriptPath = resolveInstallScriptPath(); |
There was a problem hiding this comment.
Create temp install script inside cleanup guard
resolveInstallScriptPath() now writes a temporary file and can throw (for example when /tmp is full or not writable), but it is called before entering the try/finally cleanup block. In that failure path, startupScriptPath is never deleted, leaving a startup script in /tmp that includes sensitive values like ANTHROPIC_API_KEY and RUNTIME_PROXY_BEARER_TOKEN; moving temp install-script creation inside the guarded block (or adding an outer finally) avoids this leak.
Useful? React with 👍 / 👎.
…canonical send to selectThread (#9361) * fix(macos): add disabled guard to SwiftUI conversation zoom commands (#9310) The SwiftUI CommandGroup buttons bypass AppKit's validateMenuItem callback, so conversation zoom shortcuts (Cmd+/−/0) were always active even on non-conversation panels. Add .disabled() modifiers matching the existing isConversationVisible guard. Co-authored-by: Claude <noreply@anthropic.com> * feat: reskin Mobile card to match Guardian Verification visual pattern (#9311) Restructure the Mobile settings card so it uses the same row-based layout as the Telegram, SMS, and Phone Calling cards: - Connected devices now display as channelStatusRow entries (icon + name + Remove button) instead of the old custom list with bordered buttons - Device Pairing row uses the 140px guardian-label layout with info tooltip, mirroring the Guardian Verification rows in other cards - Status warnings (no gateway, no token, regenerating) display inline in the pairing row rather than as standalone blocks below the button - "Show QR Code" button renamed to "Pair Device" for consistency - Removed formattedDeviceDate helper (no longer needed) Co-authored-by: Claude <noreply@anthropic.com> * fix: preserve text in stripHeavyContent, add early-return guard (#9313) Co-authored-by: Claude <noreply@anthropic.com> * fix: guard trimForBackground against in-flight pagination (#9314) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: omit textSegments when truncated, handle legacy tool results in rehydrate (#9315) Co-authored-by: Claude <noreply@anthropic.com> * fix: restore Button semantics for heartbeat run row expansion (#9304) Replace onTapGesture with Button + contentShape(Rectangle()) to preserve keyboard activation and VoiceOver accessibility while keeping the full-row tap target. * fix: clear isContentStripped after rehydration for re-trim eligibility (#9317) Co-authored-by: Claude <noreply@anthropic.com> * fix(macos): use macOS 14-compatible SF Symbol for refresh buttons (#9318) Replace "arrow.trianglehead.2.counterclockwise" (SF Symbols 6 / macOS 15+) with "arrow.triangle.2.circlepath" (SF Symbols 1 / macOS 11+) so the refresh icons on Platform, Gateway, and Tunnel status rows actually render on macOS 14 (Sonoma). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: positional tool call matching, cache invalidation, contentOrder fix in rehydrate (#9319) Co-authored-by: Claude <noreply@anthropic.com> * fix: same-timestamp getNextMessage + separate text truncation flag (#9320) Co-authored-by: Claude <noreply@anthropic.com> * fix(macos): improve refresh button UX on Connect status rows (#9321) - Move refresh icon next to status text instead of right-aligned - Remove bounce animation when spin stops (use .identity instead of .default) - Add 0.5s minimum spin duration so the icon always visibly spins Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(macos): simplify Platform connection error to "Could not connect" (#9324) Replace verbose error.localizedDescription (e.g. "Could not connect to the server.") with a concise "Could not connect" in the Platform health check on the Connect tab. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: fail local hatch if base data directory already exists (#9322) Prevents accidentally overwriting an existing assistant's data by checking if the .vellum directory exists before proceeding with hatch. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: populate cachedInputFull on expand via onChange to prevent flash (#9325) Co-authored-by: Claude <noreply@anthropic.com> * fix: proper compound cursor for deterministic pagination (#9326) Co-authored-by: Claude <noreply@anthropic.com> * fix: prevent pagination timeout from misclassifying late responses (#9327) Co-authored-by: Claude <noreply@anthropic.com> * fix(macos): simplify Telegram guardian verification help text into single line (#9328) Co-authored-by: Claude <noreply@anthropic.com> * fix(macos): resolve two build errors on main (#9329) 1. Replace .identity animation (unavailable in current Swift) with .default 2. Add public isConversationZoomEnabled accessor so the executable target can check conversation visibility without accessing internal members Co-authored-by: Claude <noreply@anthropic.com> * fix: remove unused parseFrontmatter function in CLI skills command (#9330) Co-authored-by: Claude <noreply@anthropic.com> * feat: add vellum login/logout/whoami commands (#9178) * feat: add vellum login/logout/whoami commands Add platform authentication commands to the CLI: - `vellum login --token <token>` validates and stores a platform session token - `vellum logout` clears the stored token - `vellum whoami` shows the currently authenticated user Token is stored at ~/.vellum/platform-token (same path used by the assistant daemon), enabling `vel import` to filter assistants by the logged-in user. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use allauth session endpoint instead of removed /v1/users/ The UserViewSet at /v1/users/ was removed from the platform. Switch to the allauth headless session endpoint (/_allauth/app/v1/auth/session) which returns user info via X-Session-Token auth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: respect BASE_DATA_DIR and enforce 0600 on existing token files - Derive platform token path from BASE_DATA_DIR (matching the assistant daemon's getRootDir() behavior) instead of hardcoding homedir() - Call chmodSync after writeFileSync to ensure 0600 permissions even when the file already exists (writeFileSync mode only applies on creation) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(macos): fix build errors from cross-module access and invalid Animation member (#9332) MainWindow and MainWindowState need public access since they're accessed from the vellum-assistant-app executable target. Also fix .identity (not a valid Animation member) to .default in SettingsConnectTab. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * feat: outbound guardian verification via code entry in Settings UI (#9333) Add submit_outbound_code guardian action so users receive a verification code via SMS/Telegram/voice call and enter it in the macOS Settings UI instead of displaying a code to copy. Voice calls now speak the code (no DTMF required). Existing /guardian_verify command fallback preserved. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * revert #9333 + rework guardian: show code in UI, reply in channel (#9334) * Revert "feat: outbound guardian verification via code entry in Settings UI (#9333)" This reverts commit b651371. * revert #9333 + rework guardian verification: show code in UI, user replies in channel Reverts the "enter code in UI" approach from #9333 and instead: - SMS/Telegram outbound messages no longer include the verification code - Messages ask the user to reply with the code shown in the Vellum app - Voice verification is unchanged (DTMF via phone call) - The code is only visible in the trusted Settings UI, not sent over the channel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * Changes needed for Vellum Assistant on Mac Mini (#9335) * feat: accept bare verification codes and simplify guardian verify copy (#9336) - Accept bare hex/numeric codes as verification replies (no /guardian_verify prefix needed) - Simplify channel message copy to 'Reply with the code you were given' - Remove expiry time commentary from verification messages - Remove guardian_verify from Telegram bot commands - Update skills and architecture docs to match new flow Co-authored-by: Claude <noreply@anthropic.com> * feat: use 6-digit codes for all channels and update verification copy (#9338) - All channels now use 6-digit numeric verification codes (was 64-char hex for SMS/Telegram) - SMS/Telegram: 'Vellum assistant guardian verification requested. Reply with the 6-digit code you were given.' - Voice: 'You are receiving a guardian verification call for your Vellum assistant. Please enter your 6-digit verification code using your keypad.' - Dropped per-assistant name prefix from templates (now always says Vellum assistant) Co-authored-by: Claude <noreply@anthropic.com> * docs: update skills and architecture for 6-digit verification codes (#9339) Co-authored-by: Claude <noreply@anthropic.com> * fix: prevent voice/phone call threads from leaking into desktop side nav (#9340) Voice-bound conversations were appearing in the macOS desktop thread list after session restore because the filter explicitly allowed sourceChannel=voice. Guardian verification calls also leaked because they had no channel binding. Pointer messages set userMessageChannel=voice which contaminated origin channel. - Remove voice exception from desktop thread filters (restore + pagination) - Add voice channel binding to guardian verification conversations - Remove misleading "See voice thread" pointer text and channel metadata Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * docs: align guardian verification copy with create_challenge flow (#9341) * feat: install CLI symlink during desktop hatch and add --version flag (#9342) * feat: install CLI symlink during desktop hatch and add --version flag Creates /usr/local/bin/vellum symlink pointing to the bundled vellum-cli binary during hatch when VELLUM_DESKTOP_APP is set. This works for both dev mode (DerivedData) and production (/Applications) builds, complementing the existing AppDelegate symlink which skips dev mode. Also adds --version/-v flag support to the CLI entry point. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use lstatSync to handle dangling symlinks during CLI symlink install existsSync follows symlinks and returns false for broken links, causing symlinkSync to throw EEXIST on stale symlinks. Now uses lstatSync to detect and clean up dangling symlinks correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: add non-null assertion for Drizzle or() return type in conversation-store (#9351) Co-authored-by: Claude <noreply@anthropic.com> * fix: remove unused existsSync import in CLI gcp.ts (#9352) Co-authored-by: Claude <noreply@anthropic.com> * fix(notifications): deduplicate conversation-viewed events by moving canonical send to selectThread Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Ashlee Radka <ashleeradka@gmail.com> Co-authored-by: V <vincent@vellum.ai> Co-authored-by: David Vargas Fuertes <vargas@vellum.ai> Co-authored-by: siddseethepalli <siddseethepalli@gmail.com>
https://www.loom.com/share/4c4cb93b8e5f4fd0a58d313bafd1585f