Fix backend-switch AWS auth + add /workspace backup and terminal file drag-and-drop #8
Reference in New Issue
Block a user
Delete Branch "fix/backend-switch-aws-creds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Four related changes, all on top of latest
main.1. Fix stale AWS/Bedrock auth carrying over on backend switch
Switching a project's backend (e.g. Bedrock → Anthropic) left the recreated container still authenticating against Bedrock, and SSO kept firing after switching away. Root causes + fixes:
docker commitsnapshot, and commit always bakes the previous container's ENV into the image (an empty commit Config does not strip it, and the commit API can't remove env).create_containernow explicitly clears every managed auth key the active backend doesn't set (MANAGED_AUTH_KEYS), so create-time env overrides the stale baked-in values.awsAuthRefresh. It was written to~/.claude.json(persisted home volume) and never removed, so Claude Code kept invokingtriple-c-sso-refreshafter switching to a non-SSO backend. The entrypoint now deletes it whenAWS_SSO_AUTH_REFRESH_CMDis unset (idempotent both ways).Config.Envat create time, so a stop/start kept stale creds. They're now written to~/.aws/credentials(0600, secrets via exec env not argv) on every start, a stale~/.aws/configfrom a prior profile/SSO session is removed, and they're dropped from the bedrock fingerprint so a key rotation refreshes in place instead of forcing a recreation.2. "Backup" action — download a project's /workspace as .tar.gz
Manual button on each project card (next to Start/Reset when stopped, next to Files when running). Runs
tar czf -inside the container (excludes + gzip happen in-container, so a large workspace isn't streamed in full), excluding regenerablenode_modules/target/.git/objects, and streams to a host file via the native save dialog.3. Backup also captures sanitized home config
So MCP servers, settings, and skills set up directly via Claude Code (stored in
~/.claude.json/~/.claude, on the volumes a Reset wipes) survive a backup/restore. Secrets are stripped:~/.claude.jsonis filtered through jq to dropprimaryApiKey/oauthAccount/customApiKeyResponses(mcpServers/settings kept), and~/.claude/.credentials.json(OAuth tokens) is omitted. Staged underhome-claude/in the archive.4. Terminal file drag-and-drop
Drop files onto a terminal pane → copied into the container at
/tmp/triple-c-drops/<name>and their paths typed into the prompt for Claude Code to read (mirrors image-paste). Uses Tauri's webviewonDragDropEvent, guarded by the pane'sactiveflag + a bounds hit-test so a drop only affects the terminal it landed on.Verification
cargo check✅,tsc --noEmit✅,vite build✅, vitest 33/33 ✅ (7 pre-existing unhandled-error logs, unchanged).commit/env-precedence,tarexcludes + GNU-tar/jq behavior, sanitized home config, and credential-file precedence all verified against real containers.tauri dev. Ifcore:defaultdoesn't grant the webview drag-drop event in this setup, it's a one-line capability add.🤖 Generated with Claude Code