Files
Brandon Charleson 4688c8f53a Fix keychain prompts and improve Augment cookie detection
## Keychain Permission Prompts Fix

### Problem
Development rebuilds changed code signature, causing 9+ keychain prompts
(once per credential: Claude, Codex, MiniMax, Copilot, Zai cookies/tokens).

### Solution
- Changed keychain accessibility from kSecAttrAccessibleAfterFirstUnlock
  to kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
- Created one-time migration (KeychainMigration.swift) to convert existing items
- First launch after update: 4-5 prompts (migration)
- Subsequent rebuilds: Zero prompts!

### Files Changed
- CookieHeaderStore.swift - Updated accessibility
- MiniMaxCookieStore.swift - Updated accessibility
- ZaiTokenStore.swift - Updated accessibility
- CopilotTokenStore.swift - Updated accessibility
- KeychainMigration.swift - New migration logic
- CodexBarApp.swift - Added migration call on startup

## Augment Cookie Detection Improvements

### Enhanced Cookie Discovery
- Added 'session' and 'web_rpc_proxy_session' to known cookie names
- Improved logging with cookie expiration details
- Fallback: attempt to use unrecognized cookies (auto-refresh handles expiration)
- Better debugging output for cookie troubleshooting

### Files Changed
- AugmentStatusProbe.swift - Enhanced cookie detection and logging

## Development Workflow Improvements

### New Scripts
- Scripts/launch.sh - Simple launch script (no rebuild)

### Documentation
- docs/DEVELOPMENT.md - Comprehensive development guide
- docs/KEYCHAIN_FIX.md - Detailed keychain fix explanation
- AUGMENT_COOKIE_FIX.md - Augment cookie troubleshooting guide
- README.md - Added development section

## Testing
- Verified zero keychain prompts on subsequent rebuilds
- Confirmed migration runs once and sets UserDefaults flag
- Tested Augment cookie auto-refresh with Chrome/Arc
- Validated app launches successfully after changes
2026-01-02 10:17:23 -08:00

33 lines
845 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Simple script to launch CodexBar (kills existing instance first)
# Usage: ./Scripts/launch.sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
APP_PATH="$PROJECT_ROOT/CodexBar.app"
echo "==> Killing existing CodexBar instances"
pkill -x CodexBar || pkill -f CodexBar.app || true
sleep 0.5
if [[ ! -d "$APP_PATH" ]]; then
echo "ERROR: CodexBar.app not found at $APP_PATH"
echo "Run ./Scripts/package_app.sh first to build the app"
exit 1
fi
echo "==> Launching CodexBar from $APP_PATH"
open -n "$APP_PATH"
# Wait a moment and check if it's running
sleep 1
if pgrep -x CodexBar > /dev/null; then
echo "OK: CodexBar is running."
else
echo "ERROR: App exited immediately. Check crash logs in Console.app (User Reports)."
exit 1
fi