danielmiessler.fabric/internal/plugins/db/fsdb/env_lock_unix.go
Kayvan Sylvan 9b724f8cec fix: persist refreshed Codex tokens and reactivate configured vendors
- Persist rotated Codex OAuth tokens after every successful refresh.
- Reload stored credentials under cross-process locks before refreshing.
- Write environment updates atomically with secret-only file permissions.
- Preserve existing environment values while skipping empty replacements.
- Activate configured vendors lazily and surface configuration failures immediately.
- Reuse valid refresh tokens before starting interactive authentication.
- Localize Codex setup, provider, request, and persistence errors.
- Upgrade AI, cloud, telemetry, and supporting Go dependencies.
- Set Claude Opus 5 as default changelog summarizer.
- Document `.env` token sensitivity and rewrite behavior.
2026-08-27 18:12:08 -07:00

23 lines
331 B
Go

//go:build unix
package fsdb
import (
"os"
"runtime"
"golang.org/x/sys/unix"
)
func lockExclusive(f *os.File) error {
err := unix.Flock(int(f.Fd()), unix.LOCK_EX)
runtime.KeepAlive(f)
return err
}
func unlockExclusive(f *os.File) error {
err := unix.Flock(int(f.Fd()), unix.LOCK_UN)
runtime.KeepAlive(f)
return err
}